Skip to content

Conform to Responses API resumable streaming and cancellation#1486

Closed
jayy-77 wants to merge 1 commit intoexo-explore:mainfrom
jayy-77:streaming-and-cancellation-fix
Closed

Conform to Responses API resumable streaming and cancellation#1486
jayy-77 wants to merge 1 commit intoexo-explore:mainfrom
jayy-77:streaming-and-cancellation-fix

Conversation

@jayy-77
Copy link
Copy Markdown

@jayy-77 jayy-77 commented Feb 16, 2026

Motivation

[#1356](Responses API: implement resumable streaming and cancellation)

Changes

Why It Works

Test Plan

Manual Testing

Automated Testing

@AlexCheema
Copy link
Copy Markdown
Contributor

Review Findings

Critical Bugs (2) — will crash at runtime

1. Missing ResponsesStreamEvent import in responses.py
src/exo/master/adapters/responses.py:194 — the new on_event parameter uses Callable[[ResponsesStreamEvent], None] but ResponsesStreamEvent is never imported. This will raise NameError at runtime when generate_responses_stream() is called.

Fix: Add ResponsesStreamEvent to the import block from exo.shared.types.openai_responses (line 10–32).

2. Wrong kwarg for TaskCancelled in cancel_openai_response
src/exo/master/api.py:1340TaskCancelled(command_id=command_id) passes command_id, but TaskCancelled requires cancelled_command_id (it's a separate field from the auto-generated base command_id). This will raise a Pydantic validation error at runtime when cancelling a response.

Fix: TaskCancelled(cancelled_command_id=command_id)


basedpyright strict-mode errors (2)

3. Unused import defaultdict in responses_store.py
src/exo/master/responses_store.py:11from collections import defaultdict is imported but never used. basedpyright reportUnusedImport.

4. Protected member access _new_event in responses_store.py
src/exo/master/responses_store.py:58ResponsesStore.mark_cancelled() accesses stored._new_event, which is a protected member of _StoredResponse. basedpyright reportPrivateUsage.

Fix: Add a public method like notify_waiters() to _StoredResponse and call that instead.


Summary

Bugs 1 and 2 are blockers — both will crash at runtime. The basedpyright issues will also fail CI (uv run basedpyright must pass with 0 errors per project rules).

@exo-explore exo-explore deleted a comment from AlexCheema Feb 18, 2026
@exo-explore exo-explore deleted a comment from AlexCheema Feb 18, 2026
@exo-explore exo-explore deleted a comment from AlexCheema Feb 18, 2026
@rltakashige rltakashige changed the title Add OpenAI Responses streaming support Conform to Responses API resumable streaming and cancellation Feb 20, 2026
@jayy-77 jayy-77 closed this Mar 4, 2026
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.

2 participants