Repository navigation
apply_patch: Codex's patch tool beside edit, freeform on Responses - #254
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
Security findingsAdvisory findings (4)
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 041c40099d
ℹ️ 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".
|
@codex review Live check on
Generated by Claude Code |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d137b29833
ℹ️ 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".
There was a problem hiding this comment.
🛡️ Codex Security Review · Automatically triggered
Here are some automated security review suggestions for this pull request.
Reviewed commit: d137b29833
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
d137b29 to
60f5d08
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 60f5d08ac0
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dd435d8406
ℹ️ 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".
|
About the red
Generated by Claude Code |
8871e7a to
823fcf8
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 823fcf8892
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 156159dccb
ℹ️ 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".
1508c33 to
38a0951
Compare
|
Rebased onto main (b4420df). The @codex review Generated by Claude Code |
There was a problem hiding this comment.
🛡️ Codex Security Review · Automatically triggered
Here are some automated security review suggestions for this pull request.
Reviewed commit: 38a095198c
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 38a095198c
ℹ️ 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".
|
@codex review Generated by Claude Code |
1 similar comment
|
@codex review Generated by Claude Code |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 13c9b75ade
ℹ️ 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".
|
@codex review Generated by Claude Code |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3d313abd35
ℹ️ 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".
|
@codex review Generated by Claude Code |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ed1ff7654d
ℹ️ 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".
There was a problem hiding this comment.
🛡️ Codex Security Review · Automatically triggered
Here are some automated security review suggestions for this pull request.
Reviewed commit: ed1ff7654d
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
|
@codex review Generated by Claude Code |
The daemon gets apply_patch beside edit and write: Codex's patch format, checked whole before any file is written, with Codex's lenient context matching. On Responses it is a custom tool constrained by Codex's Lark grammar, its call stored as sent and answered with a custom_tool_call_output (tools.custom, schema 55); on Anthropic a function taking the patch as input. New bots get apply_patch on a Responses model and edit otherwise; the approver judges a patch by every file it names, and Sonny draws one as a diff. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGFtCdGun1rPhhwTSrG
…patch paths kept An insertion with no context goes at the end of the file, so a later chunk can change an earlier line; replacements are applied in file order and overlapping chunks fail instead of panicking. A moved file keeps the source's permissions. The approver reads the paths recovered from a cut patch preview. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGFtCdGun1rPhhwTSrG
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGFtCdGun1rPhhwTSrG
A sandboxed bot's patch is confined like its writes: each file it changes is checked against the bot's roots before any is written, and the files are written through the sandbox's helper. A patch that changes a file outside them escapes, and is gated as an escaping write. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGFtCdGun1rPhhwTSrG
… only regular files for a diff A sandboxed patch is staged before it takes a process slot, and one that only deletes takes none. Sonny's diff of an edit or a patch reads the file as it is now only when it is a regular file within the daemon's size limit, so a FIFO never blocks the screen. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGFtCdGun1rPhhwTSrG
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGFtCdGun1rPhhwTSrG
…ipped Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGFtCdGun1rPhhwTSrG
…ound Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGFtCdGun1rPhhwTSrG
…nes compared Only the punctuation pass makes new strings, once for the whole file rather than for each chunk, and one update compares at most 50 million lines before it fails with invalid_patch. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGFtCdGun1rPhhwTSrG
52e9cc4 to
372eda8
Compare
|
Rebased onto main again (4deb990). The @codex review Generated by Claude Code |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
@codex review The code review on 372eda8 has shown "running" since 06:52Z, more than an hour, so I'm asking again. The security review of this commit is clean and CI is green. Generated by Claude Code |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
@codex review Generated by Claude Code |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 372eda8d1c
ℹ️ 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".
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
…cked in one sort Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGFtCdGun1rPhhwTSrG
|
@codex review Generated by Claude Code |
There was a problem hiding this comment.
🛡️ Codex Security Review · Automatically triggered
Here are some automated security review suggestions for this pull request.
Reviewed commit: 687450c5a3
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
|
@codex review Generated by Claude Code |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: af05f6bb00
ℹ️ 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".
…one placing budget Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGFtCdGun1rPhhwTSrG
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
@codex review Generated by Claude Code |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
The third item from the tools-vs-Codex comparison. The daemon gets Codex's
apply_patchbesideeditandwrite, and a new bot gets the file editor its model family is trained on:apply_patchfor a Responses model (GPT),editfor an Anthropic one (Claude). Codex has noedittool and Claude Code has no patch tool, so each family keeps the one it knows. Both stay in the daemon, so an eval can decide later whether one should go.The tool
src/tools/patch.rsparses and applies Codex's patch format:*** Begin Patch, then any number ofAdd File,Delete FileandUpdate File(with an optionalMove to) sections, then*** End Patch.@@line is allowed. A malformed patch fails withinvalid_patchand the line it fails on.patch_context_not_foundand names the file and the lines.*** End of Fileanchors a chunk at the end. CRLF files keep their line endings.Success. Updated the following files:followed byA,MandDlines.On the wire
apply_patchis a custom tool whose call is the patch itself, constrained by Codex's Lark grammar. GPT models are trained on this form. The model'scustom_tool_callis stored as sent and answered with acustom_tool_call_output.toolstable gains acustomcolumn (schema 55 → 56). It lets a result, a cancellation or a denial answer each call in its own kind of item.apply_patchis a plain function that takes the patch asinput.{"input": ...}, so preparing a call, the approver and every client see one shape for both families.Who gets it
agent_client::default_tools(providers, model)picks the default set:shell, read, write, wait, history, plusapply_patchfor a Responses-family provider oreditotherwise.agent run --newuses it when neither--toolsnor a role names tools.--newand triggers.Approver and display
agentshows a pending patch whole. A started call shows its files:apply_patch a.rs → b.rs, +c.rs, -d.rs.git diffthat deletes a file is drawn.Tests
cargo test --workspacepasses, except the two sandfs tests insonny/tests/task.rs. They need fuse3, which the cloud container lacks.AGENT_TEST_RUNTIME=1 python3 -m unittest discover -s tests: all 486 pass, run before rebasing. After rebasing onto Declared tools a client answers: hold, then park, with gates #248,test_answeredand the new patch test pass.test_a_patch_is_a_custom_tool_call_answered_in_kindruns a fake Responses model that sends acustom_tool_call. It checks that the tool is declared as a Lark custom tool, that the call goes back unchanged with acustom_tool_call_output, and that the files changed.cargo clippy --workspace --all-targetsis clean.chatgpt/gpt-6-solagainst a scratch daemon:--newbot gotapply_patchand noedit.custom_tool_callthat updated one file and added another.custom_tool_call_output, and the next request went through.🤖 Generated with Claude Code