mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-10-15 23:22:59 +08:00
fix(composite): keep CN rollout on fully supported paths
- Responses WebSocket composite whitelist stays openai+grok: CN accounts cannot pass the WSv2 ingress transport filter and the WS HTTP bridge has no Responses conversion for them, so admitting CN targets only turns a clear policy rejection into a misleading no-available-account - widen the responses/input_tokens and messages/count_tokens composite gates to the shared openai-compatible text whitelist so CN targets get the same local-estimate token counting as generation - restore the Claude default-model fallback for standalone CN groups (admin candidates and custom models list) while keeping composite listings limited to CN account mapping keys - refresh the scheduler bulk-rebuild comment and bucket capacity hints for the 8-platform canonical set
This commit is contained in:
@@ -1150,7 +1150,9 @@ func (h *GatewayHandler) compositeAvailableModels(ctx context.Context, groupID *
|
||||
for _, platform := range []string{service.PlatformAnthropic, service.PlatformGemini, service.PlatformOpenAI, service.PlatformAntigravity, service.PlatformGrok, service.PlatformKimi, service.PlatformZhipu, service.PlatformDeepseek} {
|
||||
platformModels := h.gatewayService.GetAvailableModels(ctx, groupID, platform)
|
||||
if len(platformModels) == 0 {
|
||||
if _, ok := schedulablePlatforms[platform]; ok {
|
||||
// CN 供应商没有静态默认模型列表(defaultModelIDsForPlatform 的
|
||||
// default 分支是 Claude 列表),composite 下只暴露账号映射键。
|
||||
if _, ok := schedulablePlatforms[platform]; ok && !service.IsCNProvider(platform) {
|
||||
platformModels = defaultModelIDsForPlatform(platform)
|
||||
}
|
||||
}
|
||||
@@ -1369,8 +1371,6 @@ func defaultModelIDsForPlatform(platform string) []string {
|
||||
return mergeModelIDs(ids, nil)
|
||||
case service.PlatformGrok:
|
||||
return xai.DefaultModelIDs()
|
||||
case service.PlatformKimi, service.PlatformZhipu, service.PlatformDeepseek:
|
||||
return nil
|
||||
case service.PlatformComposite:
|
||||
ids := make([]string, 0)
|
||||
seen := make(map[string]struct{})
|
||||
|
||||
Reference in New Issue
Block a user