Repository navigation
fix: point dashscope host at real alibaba catalog provider, drop comfly dead-end (#1434) - #1438
Conversation
📦 Built Package ArtifactBranch: Option A — Install from npm PR tag (recommended)npm install -g billion-context@pr-1438Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf billion-context-pr1438.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 PR #1438 reviewed — mergeable. Direction verified against #1434, full regression inventory, code, test teeth, CI. ① 原 issue 与方向 — Root cause correctly identified: the static
② 回归清点 (existing behaviors on the touched paths):
③ 代码 — Two-line data change plus two explanatory comments citing #1434/#736; zero logic edits. Right layer: fixes the producer (bad map data), not a symptom mask. ④ 测试有效性 — Teeth present: exact mapping assertions (any revert to ⑤ Diff 整洁度 — +24/−2 over CI — all 12 checks green on head Overlap with #1285 (open, same Auto-merge gate: all conditions met (single-module pure 中文摘要:审查了 HOST_TO_PROVIDER 映射修复(dashscope→alibaba、删除 comfly 走 relay 扫描)——方向打中根因(静态映射数据错误,而非查找逻辑),目录事实已独立复核(bili 实际消费的是 models.json 而非 api.json,其中确实只有裸 alibaba),回归清点未发现意外行为漂移(含 #853 输出上限的同向受益),测试有牙、CI 全绿、diff 干净,可以合并。 |
What
HOST_TO_PROVIDER(src/registry.ts) mapped two hosts to provider ids that do not exist in the models.dev catalog:coding.dashscope.aliyuncs.com→"dashscope"— nodashscope/prefix in the catalog (verified against both the bundled snapshot AND the live models.dev fetch on 2026-09-26: 428 keys / 44 providers). All Qwen/DashScope listings live under plainalibaba/(51 models).ai.comfly.org→"comfly"— nocomfly/prefix either; comfly has no catalog counterpart at all.Because
providerFromHost()returned a defined id for both, lookups took the known-provider path (exact candidates only, cross-provider suffix scan skipped by design per #736), both candidates missed, and resolution fell through to the built-in table/floor — losing the model's declared window, and (once #1285 lands) its actual price stamp.Fix (option a + option b from the issue)
coding.dashscope.aliyuncs.com→"alibaba": first-party endpoint whose models are all listed underalibaba/. Exact provider scoping is safer than a relay max-scan (a cross-provider max could overestimate if another provider listed the same bare name) and yields exact price stamps once feat: expose compress.priceProfile {w,r,q} for cache-economics reports #1285 merges.ai.comfly.orgentry dropped: relay semantics are strictly better than a known-provider dead end — absent hosts take the cross-provider suffix scan (窗口溢出报错 #736) with max-window / first-listing-price + conflict warning.Note on the issue's suggested id: the live catalog has NO
alibaba-cn/alibaba-coding-plan(-cn)providers — only plainalibabaexists today, so that is the correct target.Behavior change (flagged per policy)
coding.dashscope.aliyuncs.com: registry hit rate goes from "always miss" → exact hit for every Qwen model listed underalibaba/(declared window instead of built-in table/floor; real price profile after feat: expose compress.priceProfile {w,r,q} for cache-economics reports #1285). Models genuinely unlisted underalibaba/still miss, as before.ai.comfly.org: resolution goes from known-provider dead end → relay suffix scan (max declared window across providers; one-time conflict warning when several providers list the same name differently). Strictly more registry hits than before.No other host's mapping changed; boundary-safe matching semantics untouched (covered by new test).
Overlap note (hot file)
#1285 (
2026-09-24_compress-price-profile) edits the sameHOST_TO_PROVIDERregion ofsrc/registry.tsand adds the price lookup that consumesproviderFromHost(). This fix is compatible with it as-is (the host map is the single choke point for both lookups); whichever PR merges second needs a trivial textual rebase of this hunk. Merging this first also means #1285's price stamps work correctly for these hosts from day one.Regression tests
tests/registry.test.ts:providerFromHost("coding.dashscope.aliyuncs.com") === "alibaba"(+ boundary caseevil-coding.…stays undefined);providerFromHost("ai.comfly.org") === undefined(relay path);bundledSnapshotLookup("qwen3-coder-plus", …)returns 1_048_576 for BOTH hosts — before this fix both returnedundefined(the dead end).Minor finding (reported, not bundled)
The bundled snapshot is stale relative to the live catalog (fetchedAt 2026-09-16, 400 models vs 428 live). Refreshing would churn a ~1MB generated file in this diff — intentionally left out; can be a routine
npm run registry:snapshotrefresh separately.Pre-flight
npm run typecheck✓npm test✓ (2842 pass / 0 fail / 12 skipped gated-e2e)npm run build✓Fixes #1434