style(openai): apply De Morgan's law to satisfy staticcheck QF1001

This commit is contained in:
cxx-cod
2026-09-02 03:30:14 +00:00
parent 277aa1411d
commit 6f9fde093f
2 changed files with 3 additions and 3 deletions
@@ -2191,7 +2191,7 @@ func (s *OpenAIGatewayService) handleStreamingResponsePassthrough(
// 空等期间只能靠 keepalive 维持,白白拉长尾延迟。usage 已在 terminal 事件中解析。
// Codex bare error 序列(error 后可能跟 response.failed 或翻盘的 completed)
// 必须继续读取,不适用提前结束。
if (sawDone || sawTerminalEvent) && line == "" && !(codexFailureTerminal && sawBareError) {
if (sawDone || sawTerminalEvent) && line == "" && (!codexFailureTerminal || !sawBareError) {
break
}
}
@@ -801,7 +801,7 @@ func (s *OpenAIGatewayService) handleStreamingResponseWithReasoning(ctx context.
// Terminal 事件完整写出后直接结束,不等上游 EOF(见下方异步循环同款说明)。
// Codex bare error 序列(error 后可能跟 response.failed 或翻盘的 completed)
// 必须继续读取,不适用提前结束。
if sawTerminalEvent && !eventInProgress && !(codexFailureTerminal && sawBareError) {
if sawTerminalEvent && !eventInProgress && (!codexFailureTerminal || !sawBareError) {
return finalizeStream()
}
}
@@ -888,7 +888,7 @@ func (s *OpenAIGatewayService) handleStreamingResponseWithReasoning(ctx context.
// 靠 keepalive 维持,白白拉长尾延迟。usage 已在 terminal 事件中解析。
// Codex bare error 序列(error 后可能跟 response.failed 或翻盘的 completed)
// 必须继续读取,不适用提前结束。
if sawTerminalEvent && !eventInProgress && !(codexFailureTerminal && sawBareError) {
if sawTerminalEvent && !eventInProgress && (!codexFailureTerminal || !sawBareError) {
_ = resp.Body.Close()
return finalizeStream()
}