Skip to content

Commit 421728a

Browse files
authored
Merge pull request Wei-Shaw#1193 from xilu0/worktree-fix-thinking-block-log-level
fix: correct log levels for thinking block signature retry flow
2 parents 39a5701 + c64ed46 commit 421728a

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

backend/internal/service/gateway_service.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4197,7 +4197,7 @@ func (s *GatewayService) Forward(ctx context.Context, c *gin.Context, account *A
41974197
resp.Body = io.NopCloser(bytes.NewReader(respBody))
41984198
break
41994199
}
4200-
logger.LegacyPrintf("service.gateway", "Account %d: detected thinking block signature error, retrying with filtered thinking blocks", account.ID)
4200+
logger.LegacyPrintf("service.gateway", "[warn] Account %d: thinking blocks have invalid signature, retrying with filtered blocks", account.ID)
42014201

42024202
// Conservative two-stage fallback:
42034203
// 1) Disable thinking + thinking->text (preserve content)
@@ -4212,7 +4212,7 @@ func (s *GatewayService) Forward(ctx context.Context, c *gin.Context, account *A
42124212
retryResp, retryErr := s.httpUpstream.DoWithTLS(retryReq, proxyURL, account.ID, account.Concurrency, account.IsTLSFingerprintEnabled())
42134213
if retryErr == nil {
42144214
if retryResp.StatusCode < 400 {
4215-
logger.LegacyPrintf("service.gateway", "Account %d: signature error retry succeeded (thinking downgraded)", account.ID)
4215+
logger.LegacyPrintf("service.gateway", "Account %d: thinking block retry succeeded (blocks downgraded)", account.ID)
42164216
resp = retryResp
42174217
break
42184218
}
@@ -6102,13 +6102,9 @@ func (s *GatewayService) isThinkingBlockSignatureError(respBody []byte) bool {
61026102
return false
61036103
}
61046104

6105-
// Log for debugging
6106-
logger.LegacyPrintf("service.gateway", "[SignatureCheck] Checking error message: %s", msg)
6107-
61086105
// 检测signature相关的错误(更宽松的匹配)
61096106
// 例如: "Invalid `signature` in `thinking` block", "***.signature" 等
61106107
if strings.Contains(msg, "signature") {
6111-
logger.LegacyPrintf("service.gateway", "[SignatureCheck] Detected signature error")
61126108
return true
61136109
}
61146110

0 commit comments

Comments
 (0)