Repository navigation
Fix stale Claude shim recursion - #6164
Satwik-Jain wants to merge 3 commits into
Conversation
|
@Satwik-Jain is attempting to deploy a commit to the Manaflow Team on Vercel. A member of the Team first needs to authorize it. |
Greptile SummaryThis PR fixes an infinite-recursion bug (
Confidence Score: 5/5Safe to merge. The change is a 4-line addition to a case statement with no effect on any code path outside find_real_claude, and the regression test confirms the stale-shim scenario resolves to the correct binary. The fix is minimal and surgical — a single glob pattern added to an existing case statement. The pattern /cmux-cli-shims//claude in a bash case correctly matches any depth prefix and covers every per-surface shim directory. Existing checks for CMUX_CLAUDE_WRAPPER_SHIM and CMUX_CLAUDE_WRAPPER_SHIM_ROOT remain in place as first-priority guards; the new branch adds defense-in-depth for inherited stale shims not reflected in those env vars. The accompanying regression test exercises the exact failure scenario described in the PR and confirms the right binary is selected. No files require special attention. Important Files Changed
Reviews (2): Last reviewed commit: "Address shim resolution review feedback" | Re-trigger Greptile |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthrough
ChangesShim Exclusion and Test Coverage
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 20 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (20 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
You had this first; main now rejects inherited |
Summary
cmux-cli-shims/*/claudeentry while resolving the real Claude binaryRoot cause
If cmux is launched from a cmux terminal, its process can inherit that surface's Claude shim in
PATH. A new terminal prepends its own shim, but the wrapper previously excluded only the shim named by the currentCMUX_CLAUDE_WRAPPER_SHIMvariables. It could therefore select the inherited stale shim asREAL_CLAUDE, causing the wrappers to invoke each other until the growing argument list failed withE2BIG.Validation
expected user claude after stale shim, got 'stale-shim --version'python3 tests/test_claude_wrapper_user_binary_resolution.pypython3 tests/test_claude_wrapper_hooks.pypython3 tests/test_issue_2448_shell_claude_wrapper_dispatch.pybash -n Resources/bin/cmux-claude-wrapperCMUX_ZIG=/opt/homebrew/opt/zig@0.15/bin/zig ./scripts/reload.sh --tag fix-stale-claude-shimNo user-facing strings or localization resources changed.
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.Summary by cubic
Prevents infinite recursion in the Claude wrapper when a terminal inherits a stale cmux shim. The wrapper now rejects any per-surface shims and aligns shim-path matching with the shell/Swift shims to always use the user’s real Claude.
cmux-cli-shims/*/claudecandidates during REAL_CLAUDE resolution.Written for commit 069a29a. Summary will update on new commits.
Summary by CodeRabbit
Bug Fixes
claudebinaries undercmux-cli-shimsas shim references, ensuring it skips stale shim paths when resolving the real executable.Tests
claudeoutput.