From a52da26b5dfe20ca6354b28aba445e894d7dbc8f Mon Sep 17 00:00:00 2001 From: chujian <765781379@qq.com> Date: Sat, 7 Mar 2026 18:30:33 +0800 Subject: [PATCH] fix(auth): stop draining stream pool goroutines after context cancellation --- sdk/cliproxy/auth/conductor.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sdk/cliproxy/auth/conductor.go b/sdk/cliproxy/auth/conductor.go index 39721ca7..e31f3300 100644 --- a/sdk/cliproxy/auth/conductor.go +++ b/sdk/cliproxy/auth/conductor.go @@ -471,7 +471,10 @@ func (m *Manager) wrapStreamResult(ctx context.Context, auth *Auth, provider, ro } } for chunk := range remaining { - _ = emit(chunk) + if ok := emit(chunk); !ok { + discardStreamChunks(remaining) + return + } } if !failed { m.MarkResult(ctx, Result{AuthID: auth.ID, Provider: provider, Model: routeModel, Success: true})