feat: publish v1.0.0-rc.36-custom.2

Fixed-group tokens with a backup group now take precedence over the session affinity skip-retry-on-failure rule, so retryable upstream errors (503) fall through to the backup group instead of stopping on the primary channel. Non-retryable errors, explicit channel pins, and auto groups are unchanged.

Adds controller regression tests for the affinity override and a build-time Go test gate.
This commit is contained in:
Codex committed 2026-09-11 16:06:20 +08:00
1 parent 3a7e8f3b54
commit aa6c3f50f4
6 files changed
+108 -4

No files matched your search

+12
View File
@@ -11,6 +11,7 @@ import (
"time"
"github.com/QuantumNous/new-api/common"
"github.com/QuantumNous/new-api/constant"
"github.com/QuantumNous/new-api/model"
"github.com/QuantumNous/new-api/pkg/cachex"
"github.com/QuantumNous/new-api/relaykit/dto"
@@ -627,6 +628,17 @@ func ShouldSkipRetryAfterChannelAffinityFailure(c *gin.Context) bool {
if c == nil {
return false
}
// Explicit fixed-token fallback takes precedence over cache affinity.
primary := common.GetContextKeyString(c, constant.ContextKeyTokenGroup)
if primary != "" && primary != "auto" && common.GetContextKeyBool(c, constant.ContextKeyTokenCrossGroupRetry) {
if groups, ok := common.GetContextKeyType[[]string](c, constant.ContextKeyTokenAutoGroups); ok {
for _, group := range FilterUserTokenAutoGroups(common.GetContextKeyString(c, constant.ContextKeyUserGroup), groups) {
if group != primary {
return false
}
}
}
}
v, ok := c.Get(ginKeyChannelAffinitySkipRetry)
if ok {
b, ok := v.(bool)