Skip to content

fix(codex): preserve valid tool inputs and result pairing - #65

Merged
NishantJoshi00 merged 4 commits into
mainfrom
codex/issue-59-native-tools
Sep 23, 2026
Merged

NishantJoshi00 merged 4 commits into
mainfrom
codex/issue-59-native-tools

Conversation

@NishantJoshi00

@NishantJoshi00 NishantJoshi00 commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

Issue: #59

What changed and why?

This follows #60. Raw ApplyPatch arguments can still export as a JSON object even though Codex requires custom_tool_call.input to be a string. Serialize those arguments as text, while unwrapping native patch envelopes unchanged.

Keep foreign WebSearch calls in their existing function-call form. Converting their arguments directly to a native search action can omit the required action type, while leaving a function_call_output without its matching function call. Native search conversion needs to handle both sides together.

Track pending patch calls in message order so a completed ID can be reused by a shell command, edit, write, or raw patch. Scope reader-side duplicate suppression to each function/custom call occurrence; a later canonical result must not erase an earlier call's only result.

Add regressions for reuse in both directions and duplicate shell/patch result records in either order, including structured error output. Exercise overlapping calls, out-of-order completion, and ID reuse through a saved and reloaded Codex session. Extend coverage for shell working directories and call IDs, multiline and empty-file patches, and raw patch inputs. Document the patch format's newline, replace-all, and write limitations.

Dependency

Follows #60, now merged into main. This PR targets main and contains the follow-up fixes and regression coverage.

Validation

  • Repository pre-push checks: formatting, both Clippy configurations, all workspace tests, and both WASM configurations. Rust 1.96.1 covers the declared 1.96 minimum.
  • 392 tests passed; one existing doctest is ignored.
  • Verified that all three pairing checks fail against pre-fix commit 1663f72 for wrong native result types or lost results, then pass with the fix.
  • Local CLI smoke test exported six calls reusing one ID with matching results. Installed Codex CLI 0.156.1 applied all four generated patch fixtures, covering an edit, multiline file creation, an empty file, and a multi-file raw patch.

The smoke test checks serialization and native patch application. It does not run a model-backed resumed turn.

@NishantJoshi00
NishantJoshi00 force-pushed the codex/issue-59-native-tools branch from 61947c7 to 8bc21f8 Compare September 23, 2026 22:04
NishantJoshi00 added a commit that referenced this pull request Sep 23, 2026
Restore Codex-native shell and patch calls when exporting transcripts. Follow-up correctness fixes and regression coverage are in #65.
@NishantJoshi00
NishantJoshi00 changed the base branch from codex/issue-59-base to main September 23, 2026 22:09
@NishantJoshi00
NishantJoshi00 merged commit aaa1f9d into main Sep 23, 2026
10 checks passed
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