diff --git a/backend/internal/service/openai_gateway_response_handling.go b/backend/internal/service/openai_gateway_response_handling.go index 95e5db3193..d4c8f723b6 100644 --- a/backend/internal/service/openai_gateway_response_handling.go +++ b/backend/internal/service/openai_gateway_response_handling.go @@ -687,8 +687,12 @@ func (s *OpenAIGatewayService) handleStreamingResponseWithReasoning(ctx context. // OpenAI Responses streams that terminate with an empty // response.completed (no output, no usage, no error, nothing sent // to the client) are silent upstream refusals: fail over instead of - // recording a successful 0/0 usage turn (issue #5009). - if account != nil && account.Platform == PlatformOpenAI && + // recording a successful 0/0 usage turn (issue #5009). Grok + // subscriptions behind vendor gateways show the same silent-refusal + // shape on /v1/responses (forwardGrokResponses reaches this same + // handler), so cover PlatformGrok too — the passthrough-path guard + // is already unconditional. + if account != nil && (account.Platform == PlatformOpenAI || account.Platform == PlatformGrok) && (eventType == "response.completed" || eventType == "response.done") && !sawFailedEvent && !responsesSemanticOutputSeen && !clientOutputStarted && openAIResponsesCompletedEventIsEmpty(dataBytes, usage) {