Commit 836ba14b authored by yangjianbo's avatar yangjianbo
Browse files

fix: 修复函数签名变更后的调用参数不匹配



- handleUpstreamError 补齐新增的三个参数 (0, "", false)
- handleStreamingResponse 移除已删除的 nil 参数
Co-Authored-By: default avatarClaude Opus 4.6 <noreply@anthropic.com>
parent a14dfb76
...@@ -1650,7 +1650,7 @@ func (s *AntigravityGatewayService) ForwardUpstream(ctx context.Context, c *gin. ...@@ -1650,7 +1650,7 @@ func (s *AntigravityGatewayService) ForwardUpstream(ctx context.Context, c *gin.
// 429 错误时标记账号限流 // 429 错误时标记账号限流
if resp.StatusCode == http.StatusTooManyRequests { if resp.StatusCode == http.StatusTooManyRequests {
s.handleUpstreamError(ctx, prefix, account, resp.StatusCode, resp.Header, respBody, AntigravityQuotaScopeClaude) s.handleUpstreamError(ctx, prefix, account, resp.StatusCode, resp.Header, respBody, AntigravityQuotaScopeClaude, 0, "", false)
} }
// 透传上游错误 // 透传上游错误
......
...@@ -42,7 +42,7 @@ func TestGatewayService_StreamingReusesScannerBufferAndStillParsesUsage(t *testi ...@@ -42,7 +42,7 @@ func TestGatewayService_StreamingReusesScannerBufferAndStillParsesUsage(t *testi
_, _ = pw.Write([]byte("data: [DONE]\n\n")) _, _ = pw.Write([]byte("data: [DONE]\n\n"))
}() }()
result, err := svc.handleStreamingResponse(context.Background(), resp, c, &Account{ID: 1}, time.Now(), "model", "model", nil, false) result, err := svc.handleStreamingResponse(context.Background(), resp, c, &Account{ID: 1}, time.Now(), "model", "model", false)
_ = pr.Close() _ = pr.Close()
require.NoError(t, err) require.NoError(t, err)
require.NotNil(t, result) require.NotNil(t, result)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment