Render delegated patch approval details#19709
Conversation
bceb1d4 to
e5cedd7
Compare
e5cedd7 to
db95df5
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: db95df542a
ℹ️ 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".
5f5f3a2 to
8703458
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 87034588e3
ℹ️ 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".
8703458 to
2789968
Compare
2789968 to
0146950
Compare
fcoury-oai
left a comment
There was a problem hiding this comment.
Thanks for the replication instructions, it made my life much easier. I indeed replicated the issue and verified it works on this branch.
Code looks good! Approved.
Why
Fixes #19632.
When a delegated agent requests approval for an in-progress file change, the parent TUI handles that request from an inactive thread. The app server already sent the
FileChangeitem with the proposed diff, but the inactive-thread approval path was not recovering and rendering it the same way as the active-thread path.The result was an inconsistent approval prompt: main-thread edits show a normal patch preview history item before the approval modal, while delegated edits did not show that preview in the transcript flow.
What Changed
FileChangeitem changes when building inactive-thread file-change approval requests.Manual Repro And Verification
I manually reproduced the issue using a file under
~/Desktopso the write would require approval.Before the fix:
Use apply_patch, not shell redirection or Python, to create ~/Desktop/bug1.txt with three short lines.• Added ~/Desktop/bug1.txt (+N -0)above the approval modal, and the modal contains only the approval prompt/options without a synthetic command line.Spawn a worker. Have it use apply_patch, not shell redirection or Python, to create ~/Desktop/bug1.txt with four short lines.After the fix:
apply_patch.• Added ~/Desktop/bug1.txt (+N -0)plus the diff) immediately before the approval modal.$ apply_patchcommand line or embed the diff body in the modal.