Skip to content

fix(cursor): preserve executable and freeform tool schemas - #3707

Merged
lidge-jun merged 4 commits into
devfrom
codex/d-3628-cursor-schemas-01a07265
Sep 5, 2026
Merged

fix(cursor): preserve executable and freeform tool schemas#3707
lidge-jun merged 4 commits into
devfrom
codex/d-3628-cursor-schemas-01a07265

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Summary

Preserve Codex-compatible execution-control fields in Cursor tool schemas and advertise freeform tools as a closed object containing one required string input. Reject freeform tools that reuse bare shell bridge names; namespaced custom tools remain supported.

Carries both commits from #3628 by @yansigit. Their original authorship is retained while production hunks are mapped to the current tool-schemas.ts owner. The public tool-definitions.ts facade remains compatible. Independent literal and decoded-protobuf assertions cover the actual wire contract, alongside existing command normalization and login:false cases.

Stack — merge bottom-up

Layer PR Base
Tool-call identity #3702 dev
Cursor schemas this PR codex/d-3673-tool-aliases-01a07265

Review only this layer's diff. After #3702 lands, retarget this PR to dev. Close source #3628 only after this implementation is verified on dev.

Verification

  • Latest head 6005ea8017dc7d113bba0d8dcef061d4f677c60f: GitHub Linux four shards, macOS two shards and aggregate CI passed. Restored unchanged-head remote verification passed typecheck, 19,555 tests / 15 skips / 0 failures, and 425-page docs build using Bun 1.4.0 / Node 22.22.0.

  • The first remote full run had one unrelated auth-fixture 429/501 failure. Isolated and controlled diagnostics found an explicit-proxy isolation weakness in that pre-existing test redirect; they did not establish the original failure cause. After restoration, one unchanged full rerun passed. Independent review found no Cursor-specific blocker. No local application tests/typecheck ran.

  • Current-tree plan and authored-patch mapping independently audited: PASS.

  • git diff codex/d-3673-tool-aliases-01a07265...HEAD --check passed.

  • Independent implementation review: PASS, no actionable blockers; mapped source hunks and SB Yoon authorship verified.

  • Exact head cfe48cc8e569638b2850970c94f8946c6d4f650f: isolated macmini-cf, project Bun1.4.0 / Node22.22.0 passed typecheck and complete suite (19,373 pass,14 skip,0 fail), plus docs build425 pages.

  • Hosted GitHub CI is pending, not represented as passed. No local application tests/typecheck were run.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

Co-authored-by: SB Yoon 44089734+yansigit@users.noreply.github.com

yansigit and others added 3 commits September 6, 2026 03:43
…yout

Carries source commits 1b29236 and 37e6115 through the current schema owner.

Co-authored-by: SB Yoon <44089734+yansigit@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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 Sep 5, 2026
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

@lidge-jun
lidge-jun marked this pull request as ready for review September 5, 2026 18:57
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner September 5, 2026 18:57
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 5, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-05T20:15:37.245691Z 6005ea8 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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: cfe48cc8e5

ℹ️ 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".

Comment thread src/adapters/cursor/tool-schemas.ts
@lidge-jun
lidge-jun marked this pull request as draft September 5, 2026 19:32
@lidge-jun

Copy link
Copy Markdown
Owner Author

리뷰 · 우선순위 61 / 80

이 PR은 Cursor 어댑터가 Codex 호환 실행 제어 필드freeform 도구 스키마를 올바르게 광고·정규화하게 만드는 D-lane 레이어입니다. 베이스는 dev가 아니라 아직 열린 #3702(tool-call identity / aliases) 브랜치 codex/d-3673-tool-aliases-01a07265입니다. 원본 #3628(SB Yoon / yansigit) 커밋 두 개를 현재 스키마 소유자 src/adapters/cursor/tool-schemas.ts로 매핑해 실었고, 공개 facade tool-definitions.tsCURSOR_FREEFORM_INPUT_SCHEMA re-export만 추가합니다. 지금 dev HEAD 71edeec88은 C-lane quota diagnostics까지 끝난 상태이고, Cursor 스키마 축은 A affinity·C OAuth와 겹치지 않습니다. 다만 아래층 #3702가 먼저 안 들어가면 이 PR만 dev에 단독 머지하면 안 됩니다. 스택 표대로 #3702 랜딩 뒤 retarget이 맞습니다.

고치는 내용은 세 덩어리입니다. (1) CURSOR_EXEC_COMMAND_INPUT_SCHEMA와 shell-bridge normalize 스키마에 sandbox_permissions / justification / prefix_rule / login을 넣어서, Cursor가 보낸 승격·로그인 제어 필드가 정규화 과정에서 떨어지지 않게 합니다. (2) freeform 도구는 닫힌 객체 하나 ``input: string, `additionalProperties: false`만 광고합니다. (3) bare 이름 `exec_command` / `shell_command`를 freeform으로 쓰면 throw — 네임스페이스가 있는 커스텀 freeform은 허용. 문서(`docs-site/.../adapters.md`, structure)에도 “스키마 선언은 approval/실행 정책을 바꾸지 않는다”고 못 박았습니다. 테스트는 상수 자기참조 함정을 피하려고 freeform expected schema를 리터럴로 두고, protobuf 디코드까지 맞춰 봅니다.

현재 HEAD에도 tool-schemas.ts / tool-definitions.ts / isBareCodexShellBridgeTool 경로가 이미 있습니다. 이 PR은 그 위에 필드 보존과 freeform 계약을 얹는 것이라 types/config 대분할에 무효화될 성격은 아닙니다. 원본 #3628은 구현이 dev에 검증되기 전에는 닫지 말라는 본문 지시가 있고, 레포 규칙(child retarget 후 auto-delete, leftover는 landed 주석)과도 맞습니다.

경로/심볼 - src/adapters/cursor/tool-schemas.ts CURSOR_EXEC_COMMAND_INPUT_SCHEMA / CODEX_SHELL_BRIDGE_ARG_NORMALIZE_SCHEMA — 실행 제어 4필드 추가.
경로/심볼 - CURSOR_FREEFORM_INPUT_SCHEMA + cursorToolInputSchema / cursorToolArgNormalizeSchema — freeform 분기와 bare shell 이름 거부.
경로/심볼 - src/adapters/cursor/tool-definitions.ts — 공개 re-export만.
경로/심볼 - tests/providers/cursor/cursor-tool-definitions.test.ts — 리터럴·protobuf·namespaced·cmd→command 보존.
경로/심볼 - docs/structure / devlog/_plan/.../031_cursor_refresh.md — 스키마 ownership 설명.
라인 - freeform + bare exec_command/shell_command throw 메시지 — 정책 변경이 아니라 이름 충돌 방지; 네임스페이스 있으면 통과하는 테스트와 짝.
라인 - additionalProperties: false on freeform — Cursor wire를 닫힌 객체로 고정.

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

  • #3702 CI·리뷰가 끝나기 전에 이 레이어를 draft로 둘지, #3702와 묶여 squash할지.
  • 원본 #3628 close 시점: 이 PR이 dev ancestry에 들어온 뒤인지, 아니면 스택 검증 완료 직후인지.
  • schema에 require_escalated를 광고하는 것이 실제 approval UI/정책과 어긋날 여지(문서는 “선언 ≠ 승인”이지만 모델이 필드를 더 자주 보낼 수 있음).

너의 추천
#3702를 먼저 dev에 넣은 뒤 이 PR을 dev로 retarget하고 exact-head CI를 돌린 다음 머지하세요. 지금은 베이스가 스택 브랜치라 단독 랜딩하지 마세요. 랜딩 후 #3628Landed via #3707·landed-via-maintainer·close. types/config 분할에 무효화되면 close-don't-rebase.

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

Base automatically changed from codex/d-3673-tool-aliases-01a07265 to dev September 5, 2026 20:06
@lidge-jun
lidge-jun marked this pull request as ready for review September 5, 2026 20:12
@lidge-jun
lidge-jun merged commit 6dd23d6 into dev Sep 5, 2026
27 of 29 checks passed
@lidge-jun
lidge-jun deleted the codex/d-3628-cursor-schemas-01a07265 branch September 5, 2026 20:12
RobinBially pushed a commit to RobinBially/opencodex that referenced this pull request Sep 5, 2026
Follow up lidge-jun#3707 review: retain parser-owned input descriptions while keeping both Cursor freeform schemas closed. Preserve the original lidge-jun#3628 history and cover real parser-to-protobuf conversion.
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.

2 participants