Skip to content

fix(agents-core): preserve nested agent-tool approval attribution on restore#996

Merged
seratch merged 2 commits intomainfrom
fix/nested-agent-tool-approval-attribution
Feb 20, 2026
Merged

fix(agents-core): preserve nested agent-tool approval attribution on restore#996
seratch merged 2 commits intomainfrom
fix/nested-agent-tool-approval-attribution

Conversation

@seratch
Copy link
Member

@seratch seratch commented Feb 20, 2026

This pull request fixes a nested interruption resume bug where a tool approval raised inside an agent-as-tool flow could be restored as if it belonged to the outer agent after RunState serialization/deserialization. This is just a data reference bug in interruption data object, so the HITL logic works correctly regardless of it.

The change updates the agents-core runtime to keep an internal reference from agent-tools back to their source agent and extends run-state agent map reconstruction to traverse agent-tools in addition to handoffs. This preserves the correct RunToolApprovalItem.agent for flows like main-agent > agent-as-tool > tool-with-interruption, and adds a regression assertion to lock that behavior in after RunState.fromString(...).

@changeset-bot
Copy link

changeset-bot bot commented Feb 20, 2026

🦋 Changeset detected

Latest commit: f3719c4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@openai/agents-core Patch
@openai/agents-extensions Patch
@openai/agents-openai Patch
@openai/agents-realtime Patch
@openai/agents Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added this to the 0.4.x milestone Feb 20, 2026
@seratch
Copy link
Member Author

seratch commented Feb 20, 2026

@codex review again

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Keep them coming!

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@seratch seratch merged commit 76a695e into main Feb 20, 2026
6 checks passed
@seratch seratch deleted the fix/nested-agent-tool-approval-attribution branch February 20, 2026 02:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments