Skip to content

stream_events: synthesize SSE for locally executed tools #276

Description

@leseb

Context

Praxis core #988 and AI #756 establish one logical client-visible Responses SSE lifecycle across IRR inference rounds. Backend-originated events, response identity normalization, terminal-event handling, and loop continuation are therefore outside this issue.

Server-side execution filters such as openai_mcp_dispatch and openai_web_search also create or update tool activity locally in ResponsesState. Those changes do not necessarily originate in the model backend's SSE stream and still need Responses-compatible client-visible events.

Scope

Synthesize SSE only for tool activity generated locally by server-side execution filters:

  • MCP call and result progress events.
  • Web-search progress events that were not already emitted by the upstream model.
  • Shared event injection and ordering needed by those filters.

File-search-specific progress events remain tracked by #313. MCP tool-listing failure events remain tracked by #320.

Ownership

Acceptance criteria

  • Locally generated MCP activity is emitted exactly once using valid Responses event shapes.
  • Locally generated web-search activity not already present in the upstream stream is emitted exactly once.
  • Synthesized events use the logical response ID and valid output indices and sequence numbers.
  • Synthesized events are emitted before events from the resumed model response.
  • No duplicate response lifecycle events or duplicate output items are produced across rounds.
  • The final response.completed snapshot agrees with the items previously emitted to the client.
  • Non-streaming behavior remains unchanged.
  • End-to-end tests assert event type, ordering, identity, sequence numbering, and deduplication for model → tool → model flows.

Out of scope

Relationships

Metadata

Metadata

Assignees

Type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions