mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-10-14 03:52:26 +08:00
Issue #5009 added a failover guard for OpenAI Responses streams that terminate with an empty response.completed (no output, no usage, no error), but the guard is gated on PlatformOpenAI. Grok platform accounts reach the same handler (forwardGrokResponses -> handleStreamingResponseWithReasoning) and exhibit the same upstream silent-refusal shape, so their empty completions are relayed to the client as successful empty turns: Responses SDK clients map the empty completed to finishReason stop and accept the turn with no retry. Extend the guard to PlatformGrok, matching the unconditional guard on the passthrough path (openai_gateway_passthrough.go). Fixes #7774