feat(tool-call-mapping): emit compact file-edit diffs and raw io#283
Open
duclvz wants to merge 1 commit into
Open
feat(tool-call-mapping): emit compact file-edit diffs and raw io#283duclvz wants to merge 1 commit into
duclvz wants to merge 1 commit into
Conversation
Replace whole-file diff expansion with hunk-local oldText/newText plus locations, normalized rawInput/rawOutput, and patchUpdated mapping for Codex file-change tool calls.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces whole-file diff expansion in Codex file-change tool calls with the compact
per-hunk representation Codex actually sends, and populates the ACP
tool_callmetadata fields that were previously left empty. This brings the adapter closer to
the ACP v1 tool-call contract and matches the behavior of other ACP adapters (e.g.
Claude Agent ACP).
What changed
createUpdateFileContentnow parses the unifiedpatch and emits one
diffcontent block per hunk with localizedoldTextandnewText, instead of reading the source file and expanding to whole-filecontents. Also drops the disk read entirely, so edits still render correctly
when the source file is unavailable or already patched.
locations— every file-change tool call now includes affected paths (andthe first-hunk line number for updates / rename source + destination for moves).
rawInput/rawOutput— the tool call carries the normalizedFileUpdateChange[]asrawInput, and terminal updates carry{ status, success }asrawOutput.item/fileChange/patchUpdated— previously ignored; now mapped to atool_call_updatecarrying the refreshed hunks/locations while status staysin_progress.tool_callfor eachhistorical file change; the snapshot now includes the new fields.
Test plan
npm run typechecknpm test(288 passing)file-change-events.test.ts:patchUpdatednotification → compact content + metadatain_progressemitNotes
content[]still see valid diffentries, just scoped to hunks instead of whole files.
turn/diff/updatedanditem/fileChange/outputDeltaremain intentionallyignored — the reproduced Codex 0.144 traffic did not emit them.