Skip to content

[WRONG BRANCH] fix(cursor): preserve top-level apply_patch guidance - #302

Draft
luvs01 wants to merge 1 commit into
mainfrom
codex/fix-code-mode-guidance-for-apply_patch
Draft

[WRONG BRANCH] fix(cursor): preserve top-level apply_patch guidance#302
luvs01 wants to merge 1 commit into
mainfrom
codex/fix-code-mode-guidance-for-apply_patch

Conversation

@luvs01

@luvs01 luvs01 commented Aug 17, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Fix contradictory model guidance emitted for Cursor code mode when a top-level apply_patch tool is present.
  • The previous wording unconditionally listed apply_patch as a nested-only helper, which could conflict with catalogs that actually advertise apply_patch as a top-level tool.

Description

  • Compute a codeModeNestedOnlyNames list that excludes apply_patch when apply_patch is advertised, and use it in the code-mode guidance text so only genuinely nested helpers are forbade at top level.
  • Replace the hard-coded nested-only string with quotedNames(codeModeNestedOnlyNames) in buildCursorToolGuidanceSystemNote in src/adapters/cursor/tool-definitions.ts.
  • Add a regression test keeps a visible top-level apply_patch callable in code mode to tests/cursor-tool-definitions.test.ts that verifies mixed catalogs advertise apply_patch as callable and do not emit contradictory guidance.

Testing

  • Ran git diff --check which reported no problems.
  • Ran the focused suite bun test tests/cursor-tool-definitions.test.ts which passed (25 pass, 0 fail).
  • Ran bun run typecheck which completed successfully; running the full bun run test surfaced unrelated failures/timeouts in other suites so the run was not used as verification for this focused change.

Codex Task

Summary by CodeRabbit

  • Bug Fixes
    • Improved code-mode guidance when file-editing tools are available at the top level.
    • Prevented available editing tools from being incorrectly described as unavailable.
  • Tests
    • Added coverage confirming that top-level editing tools remain callable and recommended for file changes.

@github-actions

Copy link
Copy Markdown

Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Aug 17, 2026
@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: cc88bb6f-345d-45fd-b01e-3e16cbe051de

📥 Commits

Reviewing files that changed from the base of the PR and between 2bd271f and 77559d1.

📒 Files selected for processing (2)
  • src/adapters/cursor/tool-definitions.ts
  • tests/cursor-tool-definitions.test.ts

Included review availability: Your plan includes up to 3 reviews per rolling hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Code-mode guidance now computes nested-only tool names based on advertised tools. It omits apply_patch from the unavailable-tools warning when that tool is available at the top level. A regression test verifies the resulting guidance.

Changes

Cursor code-mode guidance

Layer / File(s) Summary
Dynamic nested-tool warning
src/adapters/cursor/tool-definitions.ts, tests/cursor-tool-definitions.test.ts
The guidance includes exec_command and shell_command as nested-only tools, and includes apply_patch only when it is not advertised. The test confirms that top-level apply_patch remains callable and is not described as unavailable.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to 77559

This narrowly adjusts Cursor guidance so a top-level apply_patch remains callable while nested-only helpers remain restricted; no actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: lidge-jun, ingwannu

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the Cursor guidance fix for preserving top-level apply_patch behavior, which matches the main change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-code-mode-guidance-for-apply_patch

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot changed the title fix(cursor): preserve top-level apply_patch guidance [WRONG BRANCH] fix(cursor): preserve top-level apply_patch guidance Aug 17, 2026
@github-actions

github-actions Bot commented Aug 17, 2026

Copy link
Copy Markdown

⏳ DRAFT

  • wrong target branch (main); retarget to dev.

What to do

  • Retarget this PR to dev — all contributions go to dev.

Its title has been prefixed with [WRONG BRANCH].
This pull request was already a draft. Its draft status will be preserved after every issue above is resolved.

@github-actions
github-actions Bot marked this pull request as draft August 17, 2026 05:10
@luvs01 luvs01 closed this Aug 19, 2026
@luvs01 luvs01 reopened this Aug 19, 2026
@luvs01 luvs01 closed this Aug 19, 2026
@luvs01 luvs01 reopened this Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aardvark bug Something isn't working codex

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant