fix(网关): 区分 Claude Code OAuth 适配

This commit is contained in:
cyhhao
2026-01-15 19:17:07 +08:00
parent 46e5ac9672
commit c579439c1e
3 changed files with 90 additions and 27 deletions

View File

@@ -707,6 +707,9 @@ func (h *GatewayHandler) CountTokens(c *gin.Context) {
return
}
// 检查是否为 Claude Code 客户端,设置到 context 中
SetClaudeCodeClientContext(c, body)
setOpsRequestContext(c, "", false, body)
parsedReq, err := service.ParseGatewayRequest(body)