Skip to content

Proxy Codex apply_patch onto Corbits file tools - #505

Merged
TheGreatAxios merged 7 commits into
mainfrom
cl-6696-proxy-codex-native-tool-names-onto-corbits-tools
Aug 23, 2026
Merged

Proxy Codex apply_patch onto Corbits file tools#505
TheGreatAxios merged 7 commits into
mainfrom
cl-6696-proxy-codex-native-tool-names-onto-corbits-tools

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Summary

  • On Codex sessions, advertise and execute an apply_patch proxy that parses the Codex patch envelope and forwards through posix write_file / edit_file / delete_file (permission plugins included).
  • Primary Skywalker still denies product mutation tools; implement/docs leaves keep apply_patch via allowlists. Docs leaves refuse Delete/Move when delete_file is not allowed.
  • Centralizes product-mutation tool ownership so thrash, auto-allow, classify, and primary-deny treat apply_patch like the write trio.

Verification

  • bun run typecheck and pre-commit build pass
  • Targeted: codex-apply-patch, codex-tool-proxies, codex-tool-mount, product-mutation-tools, tool-sets tests pass
  • Full bun run test running / to confirm on CI

Fixes CL-6696

@linear-code

linear-code Bot commented Aug 22, 2026

Copy link
Copy Markdown

CL-6696

Why: Codex-trained models call apply_patch from pinned instructions, but
Corbits only advertised write_file/edit_file/delete_file. That dialect
mismatch hurts Codex evals versus Codex-native harnesses.

What changed: Codex-only apply_patch proxy (parse envelope, forward through
posix write/edit/delete), shared product-mutation ownership, primary deny
unchanged, IMPLEMENT/DOCS allowlists, docs leaves refuse Delete/Move via
allowDelete. Bridge text left for the next stacked change.

Test plan: bun test on codex-apply-patch, codex-tool-proxies,
codex-tool-mount, product-mutation-tools, tool-sets; bun run typecheck.
createUpdatePlanProxy called runTool("manage_tasks", ...), but runTool
forwards only to posixTools, which has no manage_tasks handler — every
update_plan call errored with "unknown tool: manage_tasks". Give
createCodexToolProxies its own runManageTasks callback and wire each
mount site (tools.ts, subagent/run.ts) to the same manage_tasks logic
their stringTool handler already uses. Also fix requireOk's hardcoded
"apply_patch failed" label to use the actual label argument.

Tests: dropped the manage_tasks special case from the apply_patch mock
recorder (posixTools has no such handler, so it now falls through to
the accurate "unknown tool" branch), and added coverage that dispatches
through the real parseManageTasksArgs/applyManageTasks pair and through
the real createAgentToolset mount with unstubbed posixTools — both
would have caught the dead dispatch.
Empty createPosixTools stub hid write_file/edit_file/delete_file, so the
primary DIY-remains expects could never pass. Use the real mount like the
update_plan e2e case.
@TheGreatAxios
TheGreatAxios force-pushed the cl-6696-proxy-codex-native-tool-names-onto-corbits-tools branch from 17b95cf to 00ab2d9 Compare August 23, 2026 00:36
@TheGreatAxios
TheGreatAxios merged commit e796cd5 into main Aug 23, 2026
5 checks passed
@TheGreatAxios TheGreatAxios mentioned this pull request Aug 23, 2026
2 tasks
TheGreatAxios added a commit that referenced this pull request Aug 27, 2026
…ol-names-onto-corbits-tools

Proxy Codex apply_patch onto Corbits file tools
TheGreatAxios added a commit that referenced this pull request Aug 27, 2026
…ol-names-onto-corbits-tools

Proxy Codex apply_patch onto Corbits file tools
@TheGreatAxios
TheGreatAxios deleted the cl-6696-proxy-codex-native-tool-names-onto-corbits-tools branch August 27, 2026 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant