Skip to content

fix(logs): count a finished stream as success after disconnect - #250

Merged
caigee-cmd merged 1 commit into
mainfrom
fix/completed-stream-not-canceled
Sep 29, 2026
Merged

caigee-cmd merged 1 commit into
mainfrom
fix/completed-stream-not-canceled

Conversation

@caigee-cmd

Copy link
Copy Markdown
Owner

Summary

  • A stream that already delivered its terminal frame is logged as success when the client disconnects afterward.
  • A disconnect before the stream finishes stays canceled, and a real upstream failure stays an error.
  • OpenAI, Anthropic, and Responses relays share the same status rule. A successful disconnect no longer stores context canceled on the request log.

Test plan

  • go test ./internal/gateway/ ./internal/api/ -count=1
  • After release, confirm new completed-then-closed streams show as ok instead of canceled on sgp3

A client that closes after the terminal frame was logged as canceled.
Keep mid-stream disconnects canceled and real upstream failures as errors.
@caigee-cmd
caigee-cmd merged commit 15624e4 into main Sep 29, 2026
6 checks passed
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