Skip to content

fix(runner): persist resumed tool guardrail results - #4654

Open
FU-max-boop wants to merge 1 commit into
openai:mainfrom
FU-max-boop:fix/durable-tool-guardrail-publication
Open

fix(runner): persist resumed tool guardrail results#4654
FU-max-boop wants to merge 1 commit into
openai:mainfrom
FU-max-boop:fix/durable-tool-guardrail-publication

Conversation

@FU-max-boop

@FU-max-boop FU-max-boop commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Summary

This pull request fixes a recovery gap after resolving interrupted function-tool approvals with a client-managed Session. When an approved tool, its input and output guardrails, and its lifecycle hooks completed but the resumed Session append raised, the caller retained a RunState that omitted the completed guardrail audit results. A later retry could reconcile the tool call and output through #4650, but it could not reconstruct those results without rerunning user code.

  • Publish the accepted guardrail-result prefix plus the current resumed step's results to the same RunState before the fallible Session append in both runner paths.
  • Keep caller-mutated streaming result lists outside the durable ownership boundary by sourcing the streaming prefix from accepted state.
  • Preserve the existing public result types, ordering, and RunState schema.

Test plan

  • Added a four-row public Runner matrix covering same-mode and cross-mode recovery, live and JSON state, and both before-commit and commit-then-raise Session outcomes.
  • Verified exactly-once tool effects, input/output guardrails, start/end hooks, Session history, public results, durable state, and final model input.
  • Ran .agents/skills/code-change-verification/scripts/run.sh on the final commit and current main; formatting, lint, typecheck, and the full test suite all passed.

Issue number

Closes #4646

Checks

  • I've added new tests, if relevant
  • I've run .agents/skills/code-change-verification/scripts/run.sh
  • I've confirmed all verification steps pass
  • If using Codex, I've run /review before submitting this PR

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.

NextStepInterruption bypasses resumed Session-write recovery and loses tool guardrail results

1 participant