Repository navigation
fix(cursor): use factual tool redirects for Claude-family models - #6664
Conversation
Explicit Claude-family Cursor targets now receive factual tool guidance and native-tool refusals, without instructions to conceal the redirect. The routing-commentary sniffer is no longer armed for them. Empty catalogs report no available tools; other model families keep their legacy wording. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing (6)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review. 📝 WalkthroughWalkthroughCursor now selects tool guidance and native-execution denial wording by model. Claude-family models receive factual guidance based on available tools. Other models retain legacy wording. Routing-commentary handling and tests cover the model-specific behavior. ChangesCursor tool wording
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix Sequence Diagram(s)sequenceDiagram
participant ProtobufRequest
participant LiveTransport
participant NativeExec
participant NativeExecFS
ProtobufRequest->>ProtobufRequest: Build guidance with request model ID
LiveTransport->>NativeExec: Pass model ID, redirect hint, and plainToolWording
NativeExec->>NativeExec: Select fallback redirect when needed
NativeExec->>NativeExecFS: Pass plainToolWording to mutation refusal
Merge Risk: ⚪ Minimal · up to No concrete merge-blocking behavior issue was identified in the reviewed changes; the remaining noted uncertainty does not establish a current risk. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 22.22% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 18 functions across 8 files. (2 skipped: 2 unsupported.)
✨ 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 |
|
✅ Deterministic PR hygiene checks passed. |
⏳ DRAFT
What to do
Review readiness checklist
0/4 boxes ticked. UI screenshot waived by a maintainer comment. |
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
Maintainer lane note (compat hardening sweep, lane B). Original change by @geunwoojun99; maintainer commits pushed to this branch (no force-push).
Verification on |
|
Maintainer integration into
|
Summary
execcell; separately listed tools remain callable at the top level.shell_command,exec_command, orapply_patchtools.Related
Upstream issue #1992 (Cursor adapter injects hide-from-user policy that downstream agents treat as prompt injection) was closed as completed, but the concealment wording this change removes for Claude-family targets is still present on
dev. This change does not alter that wording for other model families.Verification
Commands below run from the repository root unless they explicitly enter
docs-site. Result excerpts are copied from executed checks; no unrun check is reported as passing.Security review of the diff against
origin/devcovered secrets, authentication, and unsafe defaults; no exposed secrets, auth changes, or broadened execution permissions/defaults were found.Regression proof
Before the fixes, the new selected regressions reproduced the Claude continuation abort, nonexistent-tool wording for two empty-catalog paths, and catalog-less fallback ignoring an advertised MCP tool. The non-Claude abort/retry control already passed.
After the fixes, the same selection passed. It includes fragmented factual prose followed by a tool call in both code-mode and flat-shell Claude continuations, the unchanged non-Claude abort/retry behavior, every denied filesystem/shell/fetch frame with empty catalogs, and fallback using an actual MCP definition.
Final local checks
The changed-suite was run twice with identical commands.
VALIDATION_TMPDIRdenotes a pre-provisioned session-isolated temporary directory; its machine-specific value is deliberately omitted. The temporary-root override does not change the test selection. The first run failed; the second, identical rerun on the same working tree passed.Run 1 failures were confined to five files:
tests/claude-integration/claude-management-api.test.tstests/claude-integration/claude-messages-endpoint.test.tstests/claude-integration/claude-models-discovery.test.tstests/claude-integration/claude-native-passthrough.test.tstests/claude-integration/claude-picker-recovery.test.tsRun 1 also reported one unhandled
ENOENTreadingca.peminclaude-picker-recovery.test.ts. In run 1 the first failure inclaude-management-api.test.tswas a 30 s timeout inside a synchronous child-process call (loadBundledCodexCatalog), after which later tests in the same file failed withSPEND_LEDGER_OWNER_HOME_CONFLICTbecause the timed-out test's server still held the process-wide spend-ledger owner. This is an inference from the captured stack traces, not a root-cause confirmation; the trigger of the initial timeout (likely machine load) was not identified.Clean-
devcomparison. The 68 failing test names were extracted from the run-1 log with timing suffixes stripped (68 distinct names in the five files above) and the five files were run with the same command on cleandev(f92482065, detached worktree$BASELINE_WORKTREE,node_modulessymlinked from the primary checkout) and on this branch. The two runs were sequential, each with its ownTMPDIR, and used the repository-pinned Bun 1.4.0 first onPATH:Name comparison: shared failures 0, branch-only failures 0, dev-only failures 0. None of the 68 run-1 failures reproduced on either tree, and no run-1 failure reproduced in the identical full changed-suite rerun on this branch. The five files also pass when run together without the other 592 files, so no further per-file isolation run was needed. Conclusion: the run-1 failures are not reproducible and are not attributable to this change; they are consistent with a transient timeout cascade in the first run, but because they did not reproduce on clean
deveither, "pre-existing ondev" is not claimed. The 597-file selection itself could not be run on cleandev, because--changed=devselects nothing there; that exact interleaving was not compared.Dependency installation passed; the documentation build did not. No clean-
devbuild comparison was executed in this validation pass, and no baseline claim is made.Scope exception and remaining coverage
devis one commit ahead of this PR (within the gate's at-most-10 policy); CodeRabbit reviewed the exact PR head with no actionable comments, and no Codex or CodeRabbit review threads are present.Checklist
🤖 Generated with Claude Code
Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
Required local validation passed; commands, results, and any full-suite exception are documented.
I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.
Summary by CodeRabbit