Skip to content

fix: Claude catalog terminals bypass failed npm shims#108627

Merged
steipete merged 2 commits into
mainfrom
codex/prefer-claude-desktop-terminal
Jul 16, 2026
Merged

fix: Claude catalog terminals bypass failed npm shims#108627
steipete merged 2 commits into
mainfrom
codex/prefer-claude-desktop-terminal

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Fixes #108608

What Problem This Solves

Fixes an issue where users opening a local Claude Code catalog session in Control UI would get Error: claude native binary not installed. when their login shell selected Anthropic's failed npm placeholder even though a working native Claude installation was available.

Why This Change Was Made

The Anthropic plugin now recognizes the exact failed npm placeholder, including npm-style cross-platform command shims, without executing it. It prefers the native installer at ~/.local/bin/claude, then the newest Claude Desktop-managed binary on macOS, while preserving the user's login-shell PATH; if no working replacement exists, terminal capability is hidden instead of launching a guaranteed failure.

User Impact

Open in terminal now resumes Claude sessions with a working native executable on affected machines. Machines that only have the failed npm placeholder no longer offer a terminal action that cannot succeed.

Evidence

  • Before: live verification reproduced the exact npm-placeholder error from the selected login-shell claude; the Claude Desktop native executable on the same host returned 2.1.209 (Claude Code).
  • End to end: an isolated Gateway on the affected macOS host exposed a synthetic Claude session in Control UI. Opening its context menu and choosing Open in terminal created a connected terminal, and the matching host process was ~/Library/Application Support/Claude/claude-code/2.1.209/claude.app/Contents/MacOS/claude --resume 10860800-0000-4000-8000-000000000001 rather than /opt/homebrew/bin/claude.
  • Negative probe: removing the isolated native executable and restarting the Gateway changed Open in terminal to disabled with Terminal opening is unavailable for this session.
  • Focused regression: node scripts/run-vitest.mjs extensions/anthropic/session-catalog.test.ts — 21/21 passed.
  • Changed-surface proof: Blacksmith Testbox run — format, lint, extension/test typechecks, plugin boundaries, import cycles, and policy guards passed.
  • Autoreview: clean after accepting and fixing the package-manager shim portability finding.

@steipete
steipete merged commit 8c95491 into main Jul 16, 2026
84 checks passed
@steipete
steipete deleted the codex/prefer-claude-desktop-terminal branch July 16, 2026 05:17
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 16, 2026
* fix(anthropic): prefer native Claude catalog terminals

* chore: keep release notes in PR body
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Claude terminal selects broken npm shim over Desktop native binary

1 participant