mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-10-13 00:01:35 +08:00
fix: add OpenAI passthrough check in account selection and refresh
Add IsOpenAIPassthroughEnabled() bypass in two places: - SelectAccountWithLoadAwareness Layer 2 candidate filtering (line 1285) - resolveFreshSchedulableOpenAIAccount model check (line 1446) Without these checks, passthrough accounts are filtered out for models like gpt-5.4 that aren't in the account's model_mapping, causing 503. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1282,7 +1282,7 @@ func (s *OpenAIGatewayService) SelectAccountWithLoadAwareness(ctx context.Contex
|
||||
if !acc.IsSchedulable() {
|
||||
continue
|
||||
}
|
||||
if requestedModel != "" && !acc.IsModelSupported(requestedModel) {
|
||||
if requestedModel != "" && !acc.IsOpenAIPassthroughEnabled() && !acc.IsModelSupported(requestedModel) {
|
||||
continue
|
||||
}
|
||||
candidates = append(candidates, acc)
|
||||
@@ -1443,7 +1443,7 @@ func (s *OpenAIGatewayService) resolveFreshSchedulableOpenAIAccount(ctx context.
|
||||
if !fresh.IsSchedulable() || !fresh.IsOpenAI() {
|
||||
return nil
|
||||
}
|
||||
if requestedModel != "" && !fresh.IsModelSupported(requestedModel) {
|
||||
if requestedModel != "" && !fresh.IsOpenAIPassthroughEnabled() && !fresh.IsModelSupported(requestedModel) {
|
||||
return nil
|
||||
}
|
||||
return fresh
|
||||
|
||||
Reference in New Issue
Block a user