Skip to content

fix(streaming): reconcile pending Responses tool calls on abort - #5

Open
fscfede-beep wants to merge 6 commits into
mainfrom
fix/responses-stream-abort-reconciliation-runner-3561
Open

fix(streaming): reconcile pending Responses tool calls on abort#5
fscfede-beep wants to merge 6 commits into
mainfrom
fix/responses-stream-abort-reconciliation-runner-3561

Conversation

@fscfede-beep

Copy link
Copy Markdown
Owner

Summary

Runner-level implementation of streamed Responses abort reconciliation, motivated by openai/openai-python#3561.

When a server-managed Responses stream is cancelled after a function_call has been emitted, the runner records the pending call and reconciles it with a fresh non-streaming model request containing function_call_output(status='incomplete', output='aborted'), then preserves the original cancellation signal.

The generic transport streaming close path is untouched.

Design

  • pending calls are tracked in run_internal/run_loop.py, where the runner already owns conversation_id / previous_response_id and turn lifecycle;
  • reconciliation uses the existing get_response_with_retry path and server conversation tracker;
  • reconciliation is isolated from generic model transport cleanup;
  • cancellation is not allowed to cancel the reconciliation task once started;
  • terminal response events clear the pending set to avoid duplicate reconciliation.

Tests

Added deterministic tests for early function_call tracking, terminal clearing, and abort payload construction. The repository CI should provide the final verification for the full runner path.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

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