feat(providers): support Qwen3.8 Max on Token Plan - #3157
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan includes up to 3 reviews per rolling hour; 0 remain after this review. 📝 WalkthroughSummaryThis PR adds Alibaba’s formal It extends the existing provider registry and model metadata. It does not create a parallel provider path. The The model supports a 1M context window, a 131072 output limit, vision, reasoning, structured output, function calling, and Tests cover model metadata, default model selection, reasoning variants, alias reconciliation, runtime reasoning mappings, and The solution is a small, coherent extension of the existing sources of truth. The alias table is necessary to migrate persisted preview selections without adding a separate provider implementation. No code or tests can be removed without weakening migration, provider-specific behavior, or regression coverage. Review-relevant risksThe change affects user-visible model availability, persisted model selection migration, model metadata, and provider model-selection contracts. Material changes in these areas require independent human review under repository policy. No security, licensing, release, or governance effect was identified in the current diff. The person performing the merge must review the final diff. A maintainer makes the final determination. WalkthroughThe change registers ChangesQwen3.8 Alibaba Token Plan support
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to This change adds the Qwen3.8 Max Token Plan model and updates its documented reasoning controls; no actionable merge-blocking risk remains based on the supplied evidence. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
Adds first-class selection + verification coverage for Alibaba Token Plan’s documented flagship model ID qwen3.8-max-preview, ensuring it is the primary fallback for both China and global Token Plan providers while remaining distinct from qwen3.8-max.
Changes:
- Adds
qwen3.8-max-previewas the first curated fallback model ID for Alibaba Token Plan (CN + global) in the provider registry. - Pins/validates the preview model’s catalog projection (display name, 1M context, 131072 max output, modalities, and capability flags) and reasoning effort contract (
low/medium/xhigh, nooff). - Adds runtime contract tests asserting Token Plan continues using the OpenAI Chat wire for the preview model until Responses support is implemented, and that reasoning effort options are passed through without inventing an
offwire.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/runtime/src/tests/responses-wire-contract.test.ts | Asserts Token Plan keeps qwen3.8-max-preview on openai-chat wire (not Responses) for now. |
| packages/runtime/src/tests/model-factory-thinking.test.ts | Verifies Token Plan reasoning effort options for qwen3.8-max-preview and that unsupported off yields no provider options. |
| packages/core/src/provider-registry.ts | Adds qwen3.8-max-preview to the curated Token Plan fallback model allowlist (top priority). |
| packages/core/src/tests/model-thinking.test.ts | Ensures preview model exposes low/medium/xhigh only and rejects off at the thinking-level resolver layer. |
| packages/core/src/tests/model-catalog.test.ts | Validates catalog entry properties/capabilities for preview model and that it’s the default fallback for both Token Plan providers. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
b36d47e to
2f152d2
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.
Suppressed comments (1)
packages/core/src/provider-registry.ts:505
- PR title/description state that
qwen3.8-max-previewis added as the first Alibaba Token Plan fallback and kept distinct fromqwen3.8-max, but the code change here does the opposite: it adds the formal billed idqwen3.8-maxto the curated fallback list and treats the preview id as a retired compatibility alias elsewhere. Please update the PR title/description (and any release notes/changelog text) to match the implemented behavior so readers don’t walk away thinking the preview id is being offered for new selections.
// qwen3.8-max-preview is a retired compatibility alias which the service
// routes to this formal id. New selections must use the billed model id.
'qwen3.8-max',
'qwen3.7-max',
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/core/src/__tests__/llm-connections.test.ts (1)
4-4: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winRemove the object-identity assertion and its import.
assert.equal(modelIdAliasesForProvider(providerType), ALIBABA_TOKEN_PLAN_MODEL_ID_ALIASES)tests that the function returns the exact object reference. It does not test the provider behavior. The reconciliation assertion below already verifies the alias result for both providers.Delete the import on Line 4 and the identity assertion on Lines 177-181.
As per path instructions: flag tests that assert implementation details or duplicate existing coverage.
Also applies to: 176-195
Source: Path instructions
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 69987180-c30f-474d-b9c2-5c64ed7d4a1c
📒 Files selected for processing (7)
packages/core/src/__tests__/llm-connections.test.tspackages/core/src/__tests__/model-catalog.test.tspackages/core/src/__tests__/model-thinking.test.tspackages/core/src/model-metadata.tspackages/core/src/provider-registry.tspackages/runtime/src/__tests__/model-factory-thinking.test.tspackages/runtime/src/__tests__/responses-wire-contract.test.ts
🚧 Files skipped from review as they are similar to previous changes (4)
- packages/core/src/tests/model-thinking.test.ts
- packages/runtime/src/tests/responses-wire-contract.test.ts
- packages/runtime/src/tests/model-factory-thinking.test.ts
- packages/core/src/tests/model-catalog.test.ts
Included review availability: Your plan includes up to 3 reviews per rolling hour; 1 remains after this review.
|
Additional complex live E2E completed on
No reasoning replay, tool identity, or recovery error occurred. The only warning was the already-tracked dashed provider-options deprecation in #1430. |
2f152d2 to
734f003
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.
Suppressed comments (1)
packages/runtime/src/tests/model-factory-thinking.test.ts:245
- This test hard-codes the providerOptions namespace to the dashed providerType string. The runtime’s openai-compatible path documents that dashed keys are deprecated and emit a warning on every generation result, and #1430 tracks moving these namespaces to camelCase. To avoid cementing the deprecated shape (and reduce churn when the namespace is migrated), assert the reasoningEffort values without depending on the exact namespace key (or allow either dashed or camelCase).
test('Alibaba Token Plan sends the formal Qwen3.8 effort and disable wires', () => {
for (const providerType of ['alibaba-token-plan-cn', 'alibaba-token-plan'] as const) {
assert.deepEqual(
buildProviderOptions(conn(providerType), 'qwen3.8-max', 'xhigh'),
{ [providerType]: { reasoningEffort: 'xhigh' } },
734f003 to
ad4c45d
Compare
Ready for human reviewThe PR description now reflects the final formal-ID contract and the complete validation evidence:
This changes user-visible provider selection, so an independent human approval is requested under the repository review policy. |
|
@Astro-Han Could you please review and approve this provider change once the latest CI run completes? The final diff uses the formal |
Generated-by: OpenAI Codex
ad4c45d to
4c771df
Compare
|
Addressed the latest Copilot review suggestion: the Qwen3.8 reasoning-options test now verifies the single emitted |
|
Thanks for the addition — the problem is real (Token Plan has no Conclusion: PASS — no blocking findings (no P0/P1/P2). P3 (optional): the same AI-assisted review disclosure: this review was produced with AI assistance (pi review subagent on 中文摘要(AI 辅助审查)结论:PASS,无阻塞项。问题真实(Token Plan 无 /models 发现契约,可用性靠 alibabaTokenPlanModelIds 白名单 pin,此前止于 qwen3.7-max,而 qwen3.8-max 已在生成元数据中),修复最小(白名单首位加 1 个 id → 自动成为 fallbackModels[0]、静态 thinking 元数据覆盖、复用现有 alias/superseded 机制做 preview→formal 迁移)。无并行实现、无复制状态。本地实跑受影响 core 测试 20/20 通过;与 #2659 无重叠(不同 provider 命名空间)。P3(可选):thinkingOptions 对象 cn/global 内联两次可提共享 const;静态覆盖把 models.dev 生成的 efforts 扩为含 'none'(off 档正确性依赖作者实测背书,建议注释注明依据);退役 preview id 仍在生成目录(已声明为有意服务端兼容别名)。 |
Summary
Add
qwen3.8-maxas the primary Alibaba Token Plan model for China and global connections. Existingqwen3.8-max-previewselections reconcile to the formal ID, and reasoning controls now expose the documentedoff,low,medium, andxhighvalues.The existing OpenAI Chat wire remains unchanged. Responses, native Harness tools, and PDF materialization are tracked in #3162, #3163, and #3164.
Fixes #3156
Verification
npm --workspace @maka/core test— 551 passednpm --workspace @maka/runtime run buildxhigh: 6 model steps, 9 tool calls, operation-conflict recovery, revision reload, full candidate re-evaluation, and evidence-backed commit — passedAI use
Select exactly one:
Tool(s) and scope: OpenAI Codex assisted with repository analysis, implementation, tests, live E2E design, and issue/PR drafting. The human contributor reviewed the changes and remains responsible for the contribution.
Checklist
Does this PR entail a change in behavior?