Conversation
Drix10
force-pushed
the
fix/codex-apply-patch-denormalization
branch
from
September 22, 2026 20:19
382a939 to
2c35a80
Compare
This was referenced Sep 23, 2026
This branch has not been deployed
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.
Issue: #59
What changed and why?
to_commonalready normalizes Codex's native tools into canonical ones(
exec_command/shell→Bash,apply_patch→Edit/Write), butfrom_commonhad no reverse mapping: it emitted the canonical names back asfunction_calllines, which the Codex runtime cannot validate, breakingtxcript continue <id> --with codex.Now
from_commonreplays native shapes:{"type":"function_call","name":"Bash","arguments":"{...}"}After:
{"type":"function_call","name":"exec_command","arguments":"{\"cmd\":\"ls\"}"}{"type":"function_call","name":"Edit",...}After:
{"type":"custom_tool_call","name":"apply_patch","input":"*** Begin Patch\n*** Update File: src/main.rs\n@@\n-old\n+new\n*** End Patch"}Write→*** Add Fileenvelope; multi-fileRaw ApplyPatchpasses itsenvelope through unwrapped. Patch results emit
custom_tool_call_output(with
exit_codecarrying the error bit) so they pair on replay.Bashextras with no native slot (timeout, description, background) aredropped — same lossiness as the inbound normalizer, noted in a comment.
replace_alldegrades to a single application (no envelope equivalent).Tests: extended the
codexintegration module pertests/README.md—exec_commandemission asserts the parsedcmdfield and that no"Bash"name leaks; new test proves the Edit envelope round-trips through
to_commonlosslessly, includingis_error. Reproduced first: the threefrom_common_denormalizes_*tests fail onmain, all 12 pass with the fix.Checks:
cargo test -p txcript --no-default-features --test integration codex(12 passed),
cargo fmt --checkandcargo clippy -p txcript --all-targets(zero warnings) — run under the GNU toolchain, as my machine has no MSVC
linker; CI's MSVC run will confirm.