You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
合成 id 过不了模型白名单 — src/api/models.py:692-708 列表用 _served_entries 按扁平名放行,而执行侧 src/api/endpoints.py:54 的 ensure_model_allowed 把 model 原串交给 model_allowed(src/auth/access.py:190:base = name.split("@",1)[0]),anthropic/trae/glm-5.3 没有 @ → base 仍是整串,白名单 glm-5.3 不命中。复现(_Stub("trae", [("glm-5.3", ...)]) + Key allowed_models="glm-5.3"):GET /anthropic/v1/models → ["anthropic/trae/glm-5.3"],同 id POST /v1/messages → 400 model anthropic/trae/glm-5.3 is not allowed for this api key。修法:src/auth/access.py:190 之前先剥合成前缀(复用 model_resolver.strip_anthropic_prefix,或最小化地在 name/base 计算前去掉前导 anthropic/<provider>/);tests/api/test_anthropic_models.py:182 的 test_synthetic_id_routes_back_to_channel_model 用的是无白名单 Key,需补「白名单非空 + 合成 id 回传 200」用例(model_matched/黑名单口径同源,一并考虑)。
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
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.
改动:新增
GET /anthropic/v1/models(Anthropic 形状,逐 (渠道, 模型) 展开为anthropic/<渠道>/<模型>,只列有可用凭证且过 Key 白名单的渠道,按字典序稳定,limit默认全量上限 1000,has_more恒 false,/v1/models结构不变);engine.model_resolver新增strip_anthropic_prefix并在resolve里剥前导anthropic/→模型@渠道,剥完对不上渠道则回落原有扁平名逻辑;README.md / README.en.md Claude Code 段落与 TECHNICAL.md 端点清单同步。验证:
uv run ruff check src tests scripts+uv run pytest -q --cov=src --cov-report=term --cov-fail-under=100(6863 passed,100%)