Skip to content

fix: #1190 reconcile streamed function calls when server-managed runs abort#1241

Merged
seratch merged 1 commit intomainfrom
fix/stream-abort-reconciliation
May 5, 2026
Merged

fix: #1190 reconcile streamed function calls when server-managed runs abort#1241
seratch merged 1 commit intomainfrom
fix/stream-abort-reconciliation

Conversation

@seratch
Copy link
Copy Markdown
Member

@seratch seratch commented May 5, 2026

This pull request resolves #1190 by fixing server-managed streaming runs that abort after the model has streamed a function call but before the SDK can execute the tool and submit its result.

The change adds an internal stream-abort reconciliation helper for @openai/agents-core that tracks streamed response.created and response.output_item.done events, builds incomplete synthetic function_call_result items for pending function calls, and submits them on abort or consumer cancellation without reusing the aborted signal. This keeps both conversationId and previousResponseId continuation paths usable after mid-tool-call stream cancellation.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 5, 2026

🦋 Changeset detected

Latest commit: 2db3d00

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.9.x milestone May 5, 2026
@seratch seratch merged commit a081190 into main May 5, 2026
7 checks passed
@seratch seratch deleted the fix/stream-abort-reconciliation branch May 5, 2026 23:49
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.

run() abort with conversationId leaves orphan function_call items in the conversation store

1 participant