SIGN IN SIGN UP

fix(responses): emit response.incomplete for truncated streams (#412)

A truncated /v1/responses stream ended with the event name response.completed
while the payload it carried said "status": "incomplete". The two contradicted
each other, and response.incomplete was emitted nowhere in the codebase --
`grep -rn "response.incomplete" Sources/` returned nothing.

Both terminal paths computed the right status and then ignored it when naming
the event. An SSE client switching on the event name, which is the normal way to
consume this stream, therefore recorded a truncated answer as a complete one.

Verified live:
  max_output_tokens=16 on a 500-word prompt -> terminal event response.incomplete,
    and response.completed appears nowhere in the stream
  a normal completion                        -> terminal event response.completed

Diff taken from candidate PR #424.

Closes #412

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011ccLBbEaVVd4sJyUd5wyhA
A
Arthur Ficial committed
2e069834e39defcce243943fa8650bc610537ee5
Parent: 530af98