Skip to content

Recognise a replayed turn whose arguments the harness rewrote - #58

Merged
dylanuys merged 1 commit into
stagingfrom
fix/harness-replay-normalized-calls
Nov 19, 2026
Merged

dylanuys merged 1 commit into
stagingfrom
fix/harness-replay-normalized-calls

Conversation

@dylanuys

Copy link
Copy Markdown
Contributor

What changed

A coding harness's replayed tool-calling turn gets its provider reasoning state back only when the router model recognises the reply it came from. That match compared the calls' arguments exactly, and a harness rewrites its own record of a call: Claude Code fills in an Edit call's default replace_all and trims a leading cd to the working directory from a Bash command. Those turns, including every edit, were still sent without their reasoning state.

A replayed turn is now matched to its reply by call IDs and functions. The turn is sent as the model wrote it, with the original arguments, not as the harness recorded it. A turn that calls a different function under the same ID is still left as it arrived.

Validation

  • The router test now covers a turn replayed with rewritten arguments (restored, with the original arguments) and one replayed with a different function (left alone). It fails without the change.
  • pytest packages/yugos/tests passes (585 tests); ruff check and ruff format --check pass on the changed files.
  • Observed in live Claude Code sessions before the change: turns with rewritten arguments were the only tool-calling turns that did not get their state back. Not yet re-run live with this change.

🤖 Generated with Claude Code

A harness rewrites its own record of a tool call, such as filling in an
argument's default or trimming a command, so a replayed turn rarely
carried the reply's exact arguments and kept losing its reasoning state.
A turn is now matched to its reply by call IDs and functions, and is sent
as the model wrote it.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T03:53:42.008235Z 19dd5c2 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@dylanuys
dylanuys merged commit 96965f5 into staging Nov 19, 2026
2 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