Skip to content

update -y in a non-interactive terminal deletes all project indexes, then fails at variant selection — failed update leaves every index destroyed with no rollback #2200

Description

@im47cn-bot

Environment

  • macOS 15 (Darwin 25.6.0), arm64
  • v0.9.0 → attempting v0.10.8
  • Invoked from a non-TTY context (Claude Code Bash tool / CI-style shell)

Reproduction

$ codebase-memory-mcp --version
codebase-memory-mcp 0.9.0

$ codebase-memory-mcp update -y
error: variant selection requires a terminal. Use --standard or --ui flag.
codebase-memory-mcp update (current: 0.9.0)

Update available: 0.9.0 -> v0.10.8
Found 19 existing index(es) that must be rebuilt after update:
  /Users/dreambt/.cache/codebase-memory-mcp/<19 dbs>.db
  ...
Delete these indexes and continue with update? (y/n): y (auto)
Removed 19 index(es).

Exit status 1. Every project index is now gone; the new binary was never downloaded. A second run deleted the two indexes that the running MCP server had recreated, then failed the same way. update -y --standard eventually succeeded.

Two distinct problems

  1. Destructive ordering. Indexes are deleted before the update pipeline reaches the step that can fail (variant selection / download / staging). Any failure after the prompt leaves the user with zero indexes and no rollback. Expected ordering: fully stage and verify the new binary first, then remove stale indexes (or keep them until first re-index replaces them, like the install staging transaction).
  2. -y cannot bypass variant selection. In non-interactive contexts the update can never succeed without knowing about --standard/--ui. Since -y already accepts "delete all my indexes", it is odd that it stops at the comparatively safe variant question. Suggested: -y implies --standard (or reads an env var, e.g. CODEBASE_MEMORY_VARIANT=standard), and the variant choice happens before any destructive prompt.

Related: #607 documents the analogous dark pattern on the install path.

Workaround (for anyone hitting this)

codebase-memory-mcp update -y --standard — but it still deletes all indexes first, so back up ~/.cache/codebase-memory-mcp if re-indexing 20+ projects is expensive.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingeditor/integrationEditor compatibility and CLI integrationpriority/highNeeds near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker.ux/behaviorDisplay bugs, docs, adoption UX

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions