Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
陈曦
sub2api
Commits
421728a9
Unverified
Commit
421728a9
authored
Mar 21, 2026
by
Wesley Liddick
Committed by
GitHub
Mar 21, 2026
Browse files
Merge pull request #1193 from xilu0/worktree-fix-thinking-block-log-level
fix: correct log levels for thinking block signature retry flow
parents
39a57011
c64ed46d
Changes
1
Hide whitespace changes
Inline
Side-by-side
backend/internal/service/gateway_service.go
View file @
421728a9
...
@@ -4197,7 +4197,7 @@ func (s *GatewayService) Forward(ctx context.Context, c *gin.Context, account *A
...
@@ -4197,7 +4197,7 @@ func (s *GatewayService) Forward(ctx context.Context, c *gin.Context, account *A
resp.Body = io.NopCloser(bytes.NewReader(respBody))
resp.Body = io.NopCloser(bytes.NewReader(respBody))
break
break
}
}
logger.LegacyPrintf("service.gateway", "Account %d:
detected
thinking block signature
error
, retrying with filtered
thinking
blocks", account.ID)
logger.LegacyPrintf("service.gateway", "
[warn]
Account %d: thinking block
s have invalid
signature, retrying with filtered blocks", account.ID)
// Conservative two-stage fallback:
// Conservative two-stage fallback:
// 1) Disable thinking + thinking->text (preserve content)
// 1) Disable thinking + thinking->text (preserve content)
...
@@ -4212,7 +4212,7 @@ func (s *GatewayService) Forward(ctx context.Context, c *gin.Context, account *A
...
@@ -4212,7 +4212,7 @@ func (s *GatewayService) Forward(ctx context.Context, c *gin.Context, account *A
retryResp, retryErr := s.httpUpstream.DoWithTLS(retryReq, proxyURL, account.ID, account.Concurrency, account.IsTLSFingerprintEnabled())
retryResp, retryErr := s.httpUpstream.DoWithTLS(retryReq, proxyURL, account.ID, account.Concurrency, account.IsTLSFingerprintEnabled())
if retryErr == nil {
if retryErr == nil {
if retryResp.StatusCode < 400 {
if retryResp.StatusCode < 400 {
logger.LegacyPrintf("service.gateway", "Account %d:
signature error
retry succeeded (
thinking
downgraded)", account.ID)
logger.LegacyPrintf("service.gateway", "Account %d:
thinking block
retry succeeded (
blocks
downgraded)", account.ID)
resp = retryResp
resp = retryResp
break
break
}
}
...
@@ -6102,13 +6102,9 @@ func (s *GatewayService) isThinkingBlockSignatureError(respBody []byte) bool {
...
@@ -6102,13 +6102,9 @@ func (s *GatewayService) isThinkingBlockSignatureError(respBody []byte) bool {
return false
return false
}
}
// Log for debugging
logger.LegacyPrintf("service.gateway", "[SignatureCheck] Checking error message: %s", msg)
// 检测signature相关的错误(更宽松的匹配)
// 检测signature相关的错误(更宽松的匹配)
// 例如: "Invalid `signature` in `thinking` block", "***.signature" 等
// 例如: "Invalid `signature` in `thinking` block", "***.signature" 等
if strings.Contains(msg, "signature") {
if strings.Contains(msg, "signature") {
logger.LegacyPrintf("service.gateway", "[SignatureCheck] Detected signature error")
return true
return true
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment