fix(auth): scope affinity by provider

Keep sticky auth affinity limited to matching providers and stop persisting execution-session IDs as long-lived affinity keys so provider switching and normal streaming traffic do not create incorrect pins or stale affinity state.
This commit is contained in:
VooDisss
2026-03-27 18:52:58 +02:00
parent 4c4cbd44da
commit 6962e09dd9
3 changed files with 50 additions and 16 deletions
-1
View File
@@ -210,7 +210,6 @@ func requestExecutionMetadata(ctx context.Context) map[string]any {
}
if executionSessionID := executionSessionIDFromContext(ctx); executionSessionID != "" {
meta[coreexecutor.ExecutionSessionMetadataKey] = executionSessionID
meta[authAffinityMetadataKey] = executionSessionID
} else if ctx != nil {
if ginCtx, ok := ctx.Value("gin").(*gin.Context); ok && ginCtx != nil {
if apiKey, exists := ginCtx.Get("apiKey"); exists && apiKey != nil {