Skip to content

fix(cursor): silent-redirect framing for native-tool denial payloads - #2665

Open
lidge-jun wants to merge 6 commits into
codex/cursor-gap-7from
codex/cursor-gap-8
Open

fix(cursor): silent-redirect framing for native-tool denial payloads#2665
lidge-jun wants to merge 6 commits into
codex/cursor-gap-7from
codex/cursor-gap-8

Conversation

@lidge-jun

Copy link
Copy Markdown
Owner

Summary

  • Even after the gap-6/7 guidance hardening, live cursor/grok-4.6 Codex sessions still probed Cursor-native Shell first and then NARRATED the fallback ("Shell이 차단되어 브리지로 전환합니다"), often twice with duplicated status lines. Root cause: the denial payload text itself frames the event as a policy block ("is disabled", "not executed locally", denial exitCode/aborted), which the model dutifully reports as a surface switch before retrying.
  • Rewrites every native-denial payload as a silent imperative redirect: shell (nativeShellDisabledMessage), filesystem read/ls/grep + write/delete refusals, and fetch. New framing states the exact bridge action to take NOW, keeps the [Bug] Cursor Auto repeats tool continuations on Windows PowerShell 5.1, causing excessive token usage #604 host-shell adaptation guidance, and explicitly forbids narrating the redirect, commenting on tool availability, or re-announcing the task. No denial-framing vocabulary remains ("blocked/disabled/not executed/denied/차단").

Stacked on #2662 (codex/cursor-gap-7).

Verification

  • bun test tests/cursor-silent-redirect.test.ts — 3 pass (forbidden-vocabulary regex over all three denial surfaces + narration prohibition present).
  • bun test tests/cursor-native-exec.test.ts tests/cursor-blob.test.ts tests/cursor-tool-definitions.test.ts — 128 pass 0 fail total.
  • bun x tsc --noEmit — clean.
  • End-to-end acceptance runs via non-interactive codex exec adversarial QA against the restarted local proxy (transcripts recorded in devlog/_plan/260826_cursor_responses_gap).

Checklist

@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner August 26, 2026 04:32
@coderabbitai

coderabbitai Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (2)
  • ^dev$
  • ^preview$

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 35e69c41-6bd7-42e0-9ca3-bfaf720cc372

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

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

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

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0278fff287

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


const NATIVE_FETCH_DISABLED =
"Cursor-native fetch is not executed locally. Use the Codex shell bridge tool `shell_command` (aliases: `exec_command`, `mcp_opencodex-responses_shell_command`, `mcp_opencodex-responses_exec_command`) with curl or wget.";
"Re-issue this fetch NOW through the catalog shell tool `shell_command` (aliases: `exec_command`, `mcp_opencodex-responses_shell_command`, `mcp_opencodex-responses_exec_command`) with curl or wget. Do NOT narrate this redirect or comment on tool availability — just make the bridge call.";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Forbid re-announcement in every redirect payload

When a native fetch is rejected, this message omits the explicit do NOT re-announce the task instruction included in the shell and general filesystem redirects; codexNativeMutationRefusal in native-exec-fs.ts omits it as well. Because duplicated task announcements are one of this change's stated failure modes, fetch and write/delete probes can still reproduce that behavior, while the new network test checks only denial vocabulary. Apply the complete silent-redirect instruction to both strings and assert the actual returned denial payloads.

AGENTS.md reference: src/AGENTS.md:L24-L26

Useful? React with 👍 / 👎.

@lidge-jun

Copy link
Copy Markdown
Owner Author

리뷰 · 우선순위 55 / 80

설명

이 풀 리퀘스트는 Cursor 네이티브 도구를 거절할 때 쓰는 글자를, 막혔다는 말이 아니라 지금 브리지로 다시 보내라는 명령으로 바꿉니다. 지금 dev의 src/adapters/cursor/native-exec-shell.ts 84-96줄 nativeShellDisabledMessage는 Route this through the Codex bridge라고 하지만, 거절 결과는 98-113줄에서 exitCode 1과 aborted true를 붙입니다. src/adapters/cursor/native-exec-fs.ts 46줄과 49-50줄, native-exec-network.ts 9-10줄은 disabled 또는 not executed locally라는 말을 씁니다. 모델이 그 말을 읽고 표면을 바꾼다고 사용자에게 말한 뒤, 같은 일을 브리지로 한 번 더 합니다.

고침은 세 표면의 글자에서 blocked, disabled, not executed, denied, 차단을 빼고 Re-issue this ... NOW와 Do NOT narrate를 넣습니다. #604의 호스트 셸 주의와 한 번만 고쳐서 다시 시도하라는 문장은 남깁니다. 같은 PR이 tool-result-normalize의 브리지 이름에 shell, local_shell, container.exec를 더합니다. gap-7이 브리지 이름만 봐서, Codex CLI가 광고하는 shell 빈 출력이 다시 설명되지 않았던 문제를 이어서 고친 것입니다.

테스트는 셸 메시지 함수와, 파일 소스에서 상수를 정규식으로 뽑는 방식입니다. 상수 따옴표가 바뀌거나 여러 줄이 되면 테스트가 빈 문자열을 비교할 수 있습니다. 네트워크 테스트는 파일 앞 15줄만 봅니다. 더 큰 한계는 프로토콜 필드입니다. 글자를 조용히 바꿔도 rejectedShellResult는 여전히 실패와 aborted입니다. 모델이 텍스트가 아니라 구조 필드를 보면 여전히 거절로 읽습니다. NOW와 Do NOT narrate가 어떤 모델에는 잔소리로 남아, 그 문장 자체를 인용할 수도 있습니다.

이 PR은 베이스가 #2662입니다. 현재 dev(7181ebd) 위에 혼자 합칠 수 없습니다. 라이브 QA 표는 S4가 한 번 실패하고, 빈 결과 이름 확장 뒤에 통과했다고 적습니다. S2b는 주석이 두 번 나오는 잔여가 있습니다. 프롬프트 문장만으로 탐색을 없애는 일은 스택 전체가 같은 방향을 유지해야 효과가 있습니다.

src/adapters/cursor/native-exec-shell.ts:85 - 거절 글자에 막힘 표현이 남아 모델이 표면 전환을 말로 설명합니다.
src/adapters/cursor/native-exec-shell.ts:105 - exitCode 1과 aborted true가 남아, 글자를 바꿔도 구조는 실패입니다.
tests/cursor-silent-redirect.test.ts - 소스 파일을 읽어 상수를 뽑으므로 문자열 모양이 바뀌면 검사가 빈 값이 됩니다.
경로/심볼 - 베이스가 #2662라 현재 dev에는 혼자 합칠 수 없습니다.
경로/심볼 - shell과 local_shell 이름을 빈 출력 설명에 넣으면, 다른 제공자의 같은 이름 도구까지 바꿀 수 있습니다.

메인테이너의 판단이 필요한 지점

  • 거절을 텍스트만 바꿀지, protobuf 실패/aborted 필드도 성공처럼 보이게 바꿀지 정해야 합니다.
  • Codex CLI 네이티브 이름 shell을 Cursor 브리지 빈 출력 로직에 섞어도 될지 정해야 합니다.
  • #2662가 먼저 들어간 뒤에만 볼지 정해야 합니다.

너의 추천

#2650-#2662 스택이 먼저 들어간 뒤에 이 PR을 마지막에 합치세요. 지금 dev에 직접 합치지 마세요. 합치기 전에는 거절 결과의 aborted 필드가 모델에 어떻게 보이는지 확인하고, 소스 파일을 읽는 테스트는 상수 export로 바꾸세요. 미리보기 배포는 계획에 없습니다.

이 댓글은 grok-bot이 작성했습니다

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant