fix(cursor): route native fallbacks through code mode - #1896
fix(cursor): route native fallbacks through code mode#1896luvyoun0224-beep wants to merge 2 commits into
Conversation
|
✅ Deterministic PR hygiene checks passed. |
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
⏳ DRAFT
What to do
Review readiness checklist
0/4 boxes ticked. This PR stays in draft until every box above is ticked. |
|
Reviewed as the candidate canonical PR for the #1887/#1896 consolidation. Do not close #1887
The reason this matters more than a style preference: #1895 exists specifically to remove Four more things live only in #1887 and would be lost:
Worth saying explicitly that these two PRs are not duplicates in kind. This one is This PR is still draft, so nothing is blocked by this note. The parser fix here (flattening |
|
Reviewed as the intended canonical of the #1887/#1896 pair, and it is the right choice — the But do not merge this and close #1887 as superseded, because one guard would be lost and
That is the same defect #1895 was opened to remove — naming tools the turn may not actually To become canonical, this needs #1887's:
Items 1 and 2 are the substantive ones: guidance depends on model compliance, the rewrite does Merge mechanics: this branch is currently clean against |
One merged, four carried, and one plan decision reversed. #1900 landed with its three gates verified in the diff first - HTTPS-only non-loopback discovery, the Bearer refused before any plain-HTTP request builder, and a clean EOF with open tool calls emitting a typed error rather than done. The reversal is #1887. The plan had it closed as superseded by #1896; it holds the catalog-aware guard that decides the bridge from what the request actually advertised, where #1896 hardcodes the names off a boolean. Closing it would have re-introduced the defect #1895 exists to remove. Also recording the process correction that held: WP6 faulted me for merging #1902 before its CI could be judged, and #1900 was merged three minutes after its run reported success rather than eight minutes before.
I merged the train into a scratch worktree off origin/dev instead of predicting conflicts, and the planned order fails twice. lidge-jun#1887 conflicts only because lidge-jun#1896 exists - they are the duplicate pair this plan already flagged, sharing five native-exec files plus live-transport. Choosing lidge-jun#1896 as canonical and dropping lidge-jun#1887 makes the whole train clean. lidge-jun#1896 also wins on scope: lidge-jun#1887 additionally drags in tool-definitions.ts and two docs files that lidge-jun#1900 already touches. lidge-jun#1903 is stale independently of the train. Merged alone onto current dev it still conflicts in src/types.ts, so no resequencing fixes it - the branch needs its author to rebase. Recording the honest expectation up front: four of the five are drafts or conflicting, so this work-phase should land lidge-jun#1900 and carry the rest with reasons rather than pretending the order was the obstacle.
The simulation reproduced exactly; my explanation of it did not. I wrote that lidge-jun#1887 conflicts only because lidge-jun#1896 exists, naming the shared native-exec files. In the sequence I actually ran, lidge-jun#1896 had not been merged yet. Isolating it: lidge-jun#1887 alone is clean, and so is each of lidge-jun#1900, lidge-jun#1895 and lidge-jun#1896 paired with it - the conflict needs lidge-jun#1900 and lidge-jun#1895 together, and it lands in tool-definitions.ts, which is not a native-exec file and has nothing to do with lidge-jun#1896. I presented dropping lidge-jun#1887 as evidence-driven when the evidence pointed elsewhere. The more serious one: closing lidge-jun#1887 as superseded would have deleted a guard this plan calls critical. lidge-jun#1896's codeModeBridgeGuidance hardcodes exec and the mcp_opencodex-responses names on a boolean; lidge-jun#1887 derives them from the advertised catalog and returns none when exec is not advertised. That is the plan's own no-hardcoded-exec matrix row, and it is the exact defect lidge-jun#1895 exists to remove - so making lidge-jun#1896 canonical without migrating would re-introduce it one PR after deleting it. Five items are now listed as migration prerequisites. Also corrected: the scope comparison is a wash rather than a win for lidge-jun#1896, and lidge-jun#1903 is a 32-file cross-cutting change rather than a rebase-and-merge item.
Summary
functionsnamespace now flattens ordinary client functions and its nested freeformcustom execinto top-level internal tools.shell_command/exec_commandfallback instructions with the real code-mode contract: top-levelexec, then nestedtools.exec_command(...)ortools.apply_patch(...), withtext(...)output.additional_toolsshape, filesystem, shell, fetch, MCP-resource, mutation, and live-transport propagation paths.This follows #1844. That change fixed system guidance, but two gaps remained: Codex 0.147 groups
custom execunder the reservedfunctionsnamespace, which the parser dropped, and Cursor-native rejection responses still directed models to top-level tools that do not exist in code mode.Verification
tests/cursor-*.test.tsfiles: 602 passbun run typecheckbun run privacy:scangit diff --checkGet-Content package.jsonand read version2.22.0; the following model continuation hit the account's Cursor resource limit, so the probe did not receive its requested final formatted line.bun testwas attempted on Windows; it stopped making progress during unrelated integration tests and was interrupted after more than 90 seconds without output.Checklist
AI assistance was used for implementation and test preparation; the resulting diff and verification output were reviewed locally.
Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
All CI tests are green on my local testing.
I pushed my PR to the latest dev commit.
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.