From 8bc6df329f20edbe51dfe99ae9373dd4ff89e0b0 Mon Sep 17 00:00:00 2001 From: hkfires <10558748+hkfires@users.noreply.github.com> Date: Thu, 15 Jan 2026 12:34:05 +0800 Subject: [PATCH] fix(auth): apply API key model mapping to request model --- sdk/cliproxy/auth/conductor.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sdk/cliproxy/auth/conductor.go b/sdk/cliproxy/auth/conductor.go index 709f640a..f7605d87 100644 --- a/sdk/cliproxy/auth/conductor.go +++ b/sdk/cliproxy/auth/conductor.go @@ -593,6 +593,7 @@ func (m *Manager) executeMixedOnce(ctx context.Context, providers []string, req execReq := req execReq.Model = rewriteModelForAuth(routeModel, auth) execReq.Model = m.applyOAuthModelMapping(auth, execReq.Model) + execReq.Model = m.applyAPIKeyModelMapping(auth, execReq.Model) resp, errExec := executor.Execute(execCtx, auth, execReq, opts) result := Result{AuthID: auth.ID, Provider: provider, Model: routeModel, Success: errExec == nil} if errExec != nil { @@ -641,6 +642,7 @@ func (m *Manager) executeCountMixedOnce(ctx context.Context, providers []string, execReq := req execReq.Model = rewriteModelForAuth(routeModel, auth) execReq.Model = m.applyOAuthModelMapping(auth, execReq.Model) + execReq.Model = m.applyAPIKeyModelMapping(auth, execReq.Model) resp, errExec := executor.CountTokens(execCtx, auth, execReq, opts) result := Result{AuthID: auth.ID, Provider: provider, Model: routeModel, Success: errExec == nil} if errExec != nil { @@ -689,6 +691,7 @@ func (m *Manager) executeStreamMixedOnce(ctx context.Context, providers []string execReq := req execReq.Model = rewriteModelForAuth(routeModel, auth) execReq.Model = m.applyOAuthModelMapping(auth, execReq.Model) + execReq.Model = m.applyAPIKeyModelMapping(auth, execReq.Model) chunks, errStream := executor.ExecuteStream(execCtx, auth, execReq, opts) if errStream != nil { rerr := &Error{Message: errStream.Error()}