Repository navigation
Conversation
052df84 的入口闸门按目录 identity_list 判「订阅专享 + 本地区全是 Free → 403」, 但 identity_list 描述的是「直调该模型名」那条路。gpt-6-sol / gpt-6-luna 在 Free 号上 走的是租户槽位 custom_model_gpt-5(槽位里挂 openai/gpt-5.6-sol|luna),实测能出正文; 闸门在 setSlotInBody 之前判,把它们一起 403 挡掉了。 实测(同一台机、同一批 intl 号,只换二进制): 升级前(ff67785):intl:gpt-6-sol → 200 / 2.9s 升级后(db9e30a):intl:gpt-6-sol → 403 model_requires_subscription 日志:拒绝订阅专享模型 gpt-6-sol:intl 地区没有订阅档账号(Free 号调它必 1005,不罚号) 即:新版把国际版唯一能出正文的两个模型砍掉了。 放行条件收紧到「命中 IntlSlotRoute 且 realm=intl」,其余订阅专享模型照旧 403、照旧 不烧请求不罚号。补 TestPaidOnlySlotRoutedIntlModelNotGated 守住这条: 在纯 db9e30a 上该测试 FAIL(403),加上本补丁后 PASS(走上游 1 次)。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
现象
升级到
db9e30a之后,国际版唯一能出正文的两个模型(gpt-6-sol/gpt-6-luna,走租户槽位旁路)被052df84的订阅专享闸门一起挡成 403。同一台机、同一批 Free 国际号,只换二进制:
intl:gpt-6-solff67785(052df84之前)db9e30amodel_requires_subscription对应日志:
intl:gpt-6-luna表现相同。等于新版把国际版唯一能用的两个模型砍掉了。根因
internal/server/handler.go的闸门按目录判:paidOnlyByModel来自上游目录的identity_list,而identity_list描述的是「直调该模型名」这条路的身份。gpt-6-sol/gpt-6-luna在 Free 号上并不直调,走的是intlSlotRoutes→ 租户槽位custom_model_gpt-5里的openai/gpt-5.6-sol|luna(见internal/upstream/constants.go里那段实测记录)。闸门在setSlotInBody之前判,于是把槽位那条路一起挡掉了。计划是按模型给的,槽位旁路又是一条实测可用的 Free 通道,这两件事目录里的
identity_list都表达不了。修法
放行条件收紧到「命中
IntlSlotRoute且realm == intl」:其余订阅专享模型(
cn:kimi-k3.1-pro-max、intl:gpt-6.1-sol等)照旧 403,仍是一次上游都不打、不罚号、不冷却整号。验证
新增
TestPaidOnlySlotRoutedIntlModelNotGated:db9e30a上 FAIL:intl:gpt-6-sol code=403 ... 槽位旁路模型不该被 403 挡go vet ./...+go test ./...全绿线上实测(4 个 Free intl 号 + 2 个 cn 号):
intl:gpt-6-sol→ 200 / 4.7s;intl:gpt-6-luna→ 200 / 3.4scn:kimi-k3.1-pro-max→ 仍 403,state.json里 6 个号until全为0001-01-01(无冷却)cn:glm-5.3-flash→ 200,号池未受影响备选方案
如果更希望闸门只认「直调」,也可以在
fetchDynamicModels里把命中intlSlotRoutes的模型排除出paidOnlyByModel。我选在请求入口加例外,是为了不影响目录缓存的语义:paid_only仍然如实反映直调身份,/v1/models的输出不变。