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
{{ message }}
Repository navigation
streaming: aborted cross-provider responses and ensemble streams report status 200 instead of 499 #1004
Two streaming paths report status_code: 200 on usage events for streams the client aborted mid-flight, where the equivalent single-model chat path correctly reports 499 (CLIENT_CLOSED_REQUEST). Both predate the trace-foundation work (verified present at 4a98a83); surfaced during an independent audit of the OTLP trace PR.
Path 1 — cross-provider /v1/responses streaming: the stream guard tracks reached_end, but the status choice only consults guardrail_blocked (422 vs 200), ignoring reached_end == false. An aborted stream therefore emits a terminal usage event with status_code: 200.
Path 2 — streaming ensemble: the judge-stream completion path hardcodes 200 regardless of whether the synthesized answer's stream reached EOF.
Impact: per-status telemetry (usage rows, http.response.status_code on exported spans, status-labelled Prometheus counters) counts aborted streams as successes on these two paths, inconsistent with the single-model chat path.
Expected precedence, matching the chat stream guard: !reached_end → 499; guardrail block → 422; otherwise 200. Worth a paced-stream abort e2e per path when fixing — the existing suites only drain streams to EOF.
#794 - feat(usage): estimate tokens locally when the upstream reports no usage [merged] #807 - fix(routing): honour routing.retries on the streaming chat path [merged] #842 - feat(telemetry): split upstream and downstream latency on UsageEvent [merged] #882 - feat(routing): mid-stream fallback — resume a committed stream on fallback targets [merged] #893 - feat(proxy): mid-stream fallback for /v1/messages — both dispatch legs [open]
📝 Issue Planner
Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.
Create Plan
🧪 Issue enrichment is currently in open beta.
You can configure auto-planning by selecting labels in the issue_enrichment configuration.
To disable automatic issue enrichment, add the following to your .coderabbit.yaml:
issue_enrichment:
auto_enrich:
enabled: false
💬 Have feedback or questions? Drop into our discord!
Activity
coderabbitai commentedon Aug 20, 2026
🔗 Related PRs
#794 - feat(usage): estimate tokens locally when the upstream reports no usage [merged]
#807 - fix(routing): honour routing.retries on the streaming chat path [merged]
#842 - feat(telemetry): split upstream and downstream latency on UsageEvent [merged]
#882 - feat(routing): mid-stream fallback — resume a committed stream on fallback targets [merged]
#893 - feat(proxy): mid-stream fallback for /v1/messages — both dispatch legs [open]
📝 Issue Planner
Check the box below or use the
@coderabbitai plancommand to generate an implementation plan and prompts that you can use with your favorite coding assistant.🧪 Issue enrichment is currently in open beta.
You can configure auto-planning by selecting labels in the issue_enrichment configuration.
To disable automatic issue enrichment, add the following to your
.coderabbit.yaml:💬 Have feedback or questions? Drop into our discord!
fix(usage): record what happened to a stream that failed after its 200