refactor: decouple claude max cache simulation from RecordUsage

Extract setupClaudeMaxStreamingHook and applyClaudeMaxNonStreamingRewrite
facade functions to helpers file. RecordUsage now uses detect-only (no
mutation), client response rewriting handled at Forward layer.
This commit is contained in:
erio
2026-02-27 19:59:36 +08:00
parent 505494b378
commit 741eae59bb
8 changed files with 114 additions and 115 deletions

View File

@@ -545,6 +545,7 @@ func (h *GatewayHandler) Messages(c *gin.Context) {
accountReleaseFunc = wrapReleaseOnDone(c.Request.Context(), accountReleaseFunc)
// 转发请求 - 根据账号平台分流
c.Set("parsed_request", parsedReq)
var result *service.ForwardResult
requestCtx := c.Request.Context()
if fs.SwitchCount > 0 {