You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After praxis-proxy/praxis#986 provides the shared bounded SSE codec, migrate
Praxis AI's provider-neutral SSE framing code to that praxis-filter API.
Praxis AI currently has several independently evolved framing paths:
apis/src/openai/sse/frame.rs
apis/src/openai/sse/responses/parser.rs
apis/src/openai/responses/stream_events/
apis/src/anthropic/stream_events/
filters/src/agentic/a2a/sse.rs
the A2A parser reuse in filters/src/token_usage/count.rs
The refactor should share only the transport-independent SSE record framing.
Provider event schemas, JSON decoding, lifecycle validation, accumulation,
translation, failure policy, response IDs, and sequence handling remain owned
by their existing AI modules.
Replace apis/src/openai/sse/frame.rs with the shared incremental decoder and
encoder, removing the local implementation once all callers are migrated.
Migrate the Responses, Anthropic, A2A, and token-usage consumers where their
framing requirements match the shared contract.
Do not introduce a common provider event model; each consumer retains its
typed event parsing and lifecycle rules above the shared SSE records.
Preserve each consumer's existing pass-through, transformation, fail-open or
fail-closed, terminal-event, and end-of-stream behavior.
Preserve raw event bytes where a pass-through consumer requires byte-exact
forwarding. If the shared codec cannot support a required behavior, refine filter: add a bounded incremental SSE codec praxis#986 rather than adding another AI-local framing parser.
Retain consumer-specific limits such as event count, accumulated state, JSON
size, and lifecycle timeouts; the shared framing bounds do not replace them.
Tests cover arbitrary chunk splits, UTF-8 splits, LF/CRLF, comments,
multiline data, multiple events per chunk, incomplete EOF, malformed input,
and framing-limit overflow through the migrated production callers.
No migrated streaming path buffers the complete response or weakens
downstream backpressure.
Remove obsolete duplicate parser tests and replace them with focused adapter
tests plus the shared codec's conformance coverage.
Non-Goals
Moving OpenAI ResponsesState, Anthropic translation, A2A task semantics, or
token accounting into Praxis.
Implementing GET /v1/responses/{id}?stream=true, event persistence, starting_after, or replay journals.
Changing Pingora transport, BodyMode::Stream, or StreamingTerminalResponse.
Combining provider-specific stream filters into one filter.
Description
After praxis-proxy/praxis#986 provides the shared bounded SSE codec, migrate
Praxis AI's provider-neutral SSE framing code to that
praxis-filterAPI.Praxis AI currently has several independently evolved framing paths:
apis/src/openai/sse/frame.rsapis/src/openai/sse/responses/parser.rsapis/src/openai/responses/stream_events/apis/src/anthropic/stream_events/filters/src/agentic/a2a/sse.rsfilters/src/token_usage/count.rsThe refactor should share only the transport-independent SSE record framing.
Provider event schemas, JSON decoding, lifecycle validation, accumulation,
translation, failure policy, response IDs, and sequence handling remain owned
by their existing AI modules.
Acceptance Criteria
filter: add a bounded incremental SSE codec praxis#986.
apis/src/openai/sse/frame.rswith the shared incremental decoder andencoder, removing the local implementation once all callers are migrated.
framing requirements match the shared contract.
typed event parsing and lifecycle rules above the shared SSE records.
fail-closed, terminal-event, and end-of-stream behavior.
forwarding. If the shared codec cannot support a required behavior, refine
filter: add a bounded incremental SSE codec praxis#986 rather than adding another AI-local framing parser.
size, and lifecycle timeouts; the shared framing bounds do not replace them.
multiline data, multiple events per chunk, incomplete EOF, malformed input,
and framing-limit overflow through the migrated production callers.
downstream backpressure.
tests plus the shared codec's conformance coverage.
Non-Goals
ResponsesState, Anthropic translation, A2A task semantics, ortoken accounting into Praxis.
GET /v1/responses/{id}?stream=true, event persistence,starting_after, or replay journals.BodyMode::Stream, orStreamingTerminalResponse.Dependencies
Parent Epic
Related
stream_events