User report: on a system with pre-existing legacy claude-code v2.1.112 (cli.js layout), running uclaude_install.sh announced "SEA install complete: v2.1.120" "Patch status: patched" "Update complete." yet `claude --version` still showed 2.1.112. Root cause: 1. ensure_claude_code() ran `npm install -g @anthropic-ai/claude-code@2.1.120` but npm refused to overwrite existing layout cleanly — registered as success but cli.js stayed in place. 2. SEA install in /usr/lib/.../@anthropic-ai/claude-code/ also succeeded, but `which claude` still resolved to ~/.npm-global/bin/claude → legacy cli.js because that prefix wins on PATH. 3. Updater's get_installed_version() found legacy cli.js first, reported 2.1.112. Three fixes: A. ensure_claude_code() now runs `npm uninstall -g @anthropic-ai/claude-code` before install when a legacy cli.js is detected, then runs install with --force. This guarantees clean SEA layout. B. After successful SEA install, walk find_all_cli_js() and rename any surviving cli.js → .legacy.bak. PATH resolution can no longer pick stale cli.js over /usr/bin/claude. C. Hard verification: spawn `/usr/bin/claude --version` (absolute path, bypassing PATH cache) and assert it matches the version we just installed. Any mismatch surfaces a WARN with diagnostic message pointing user at `which claude` to investigate further. After this fix the same install flow on the user's machine will report v2.1.120 and `claude --version` will agree. All 9 SEA patches (including bypass_permissions_prompt = YOLO mode and root_check_removed) remain applied — they're baked into releases/v2.1.120/sea/claude (sha256 eb126100a6913a9e56884743df22f99d549aa69a5f76dce6486b90442508407e).
56 KiB
Executable File
56 KiB
Executable File