feat(qwen): add Token Plan (Team Edition) provider#94419
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 9, 2026, 3:58 PM ET / 19:58 UTC. Summary PR surface: Source +925, Tests +1101, Docs +81, Other +57. Total +2164 across 22 files. Reproducibility: not applicable. as a strict bug reproduction: current main lacks Token Plan support, and the PR evidence proves the new live onboarding and gateway path rather than reproducing a broken existing contract. Review metrics: 1 noteworthy metric.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Accept the bundled Token Plan and Bailian compatibility contract explicitly, then refresh if needed and land; otherwise narrow the PR to the provider surface maintainers want to own. Do we have a high-confidence way to reproduce the issue? Not applicable as a strict bug reproduction: current main lacks Token Plan support, and the PR evidence proves the new live onboarding and gateway path rather than reproducing a broken existing contract. Is this the best way to solve the issue? Yes, if maintainers accept the product boundary: the qwen plugin is the right owner for Alibaba/Qwen Token Plan behavior, existing custom provider configuration is a workaround with poorer onboarding, and no current built-in provider already covers this path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ee9d9ea6dbb7. Label changesLabel justifications:
Evidence reviewedPR surface: Source +925, Tests +1101, Docs +81, Other +57. Total +2164 across 22 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (4 earlier review cycles)
|
PR #94419 ReviewVerdict: Request changes — at least one blocker + one config-surface smell + several smaller concerns. This is a real, useful feature with clean structure, but it ships with a runtime bug, a config-surface addition for an unverified compat case, and a few design choices I want to talk through before this lands. TL;DR
1. Blocker: missing
|
…pper The bailian-token-plan compatibility alias was not in isQwenProviderId, so alias-configured Token Plan models hit wrapQwenProviderStream, failed the gate, and skipped the thinking payload handling that qwen-token-plan gets. Add the alias to the gate plus a regression test covering the alias path. Addresses the Codex/ClawSweeper review finding on PR openclaw#94419. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Thanks for the catch, this was a real gap. Fixed in 35e1259. The Validation: The bundled-provider-surface acceptance question is still yours to decide; happy to route this to a third-party plugin instead if you would prefer not to add another bundled Alibaba provider. |
…sion routing The qwen-token-plan base URLs were not in providerEndpoints, so they resolved to endpointClass "custom" and the media-understanding layer (which gates vision routing on "modelstudio-native") would not advertise image support for the 5 vision-capable token-plan models. Add both region URLs to the modelstudio-native class, matching the transport they already reuse. Addresses review feedback on PR openclaw#94419. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…urface) The bailian-token-plan alias had no shipped contract in the repo (unlike the qwen-portal / qwen-cli aliases, which have real doctor-migration code). Per AGENTS.md (compatibility is opt-in, config-surface bar is high) and review feedback on PR openclaw#94419, remove the alias from the providers list, providerAuthAliases, modelCatalog.aliases, providerRequest, the registration aliases, the qwen stream gate, the docs note, and the tests. Canonical qwen-token-plan is unaffected. The alias can be re-added later with a real user-supplied Alibaba config as evidence. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Thanks for the thorough review, genuinely useful. Both blockers are addressed. 1. providerEndpoints / vision routing, fixed in d185805. Added both token-plan base URLs to the 2. bailian-token-plan alias, dropped in 39226d3. Agreed, this was premature config surface with no shipped contract (unlike On the should-fixes:
Follow-ups (agree these are out of scope here): Ready for re-review when you have a moment. |
2209b07 to
af066eb
Compare
…pper The bailian-token-plan compatibility alias was not in isQwenProviderId, so alias-configured Token Plan models hit wrapQwenProviderStream, failed the gate, and skipped the thinking payload handling that qwen-token-plan gets. Add the alias to the gate plus a regression test covering the alias path. Addresses the Codex/ClawSweeper review finding on PR openclaw#94419. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…sion routing The qwen-token-plan base URLs were not in providerEndpoints, so they resolved to endpointClass "custom" and the media-understanding layer (which gates vision routing on "modelstudio-native") would not advertise image support for the 5 vision-capable token-plan models. Add both region URLs to the modelstudio-native class, matching the transport they already reuse. Addresses review feedback on PR openclaw#94419. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…urface) The bailian-token-plan alias had no shipped contract in the repo (unlike the qwen-portal / qwen-cli aliases, which have real doctor-migration code). Per AGENTS.md (compatibility is opt-in, config-surface bar is high) and review feedback on PR openclaw#94419, remove the alias from the providers list, providerAuthAliases, modelCatalog.aliases, providerRequest, the registration aliases, the qwen stream gate, the docs note, and the tests. Canonical qwen-token-plan is unaffected. The alias can be re-added later with a real user-supplied Alibaba config as evidence. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Refreshed for the 14-model head, addressing the ClawSweeper proof ask.
On validation: @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Addressed the remaining region-proof gap. The PR body now includes direct live proof for the Global/Intl auth choice too, not just CN:
So both published auth choices (CN/Beijing and Global/Singapore) now have current-head live evidence. Key redacted, throwaway config deleted. The remaining item is the maintainer product-acceptance call on owning a bundled Alibaba Token Plan provider, which is yours to make. @clawsweeper re-review |
Co-authored-by: Oliver Mee <[email protected]>
|
Land-ready proof for
Proceeding through the required Testbox-backed prepare and merge wrappers. |
|
Merged via squash.
|
What Problem This Solves
OpenClaw supports Qwen Standard, Coding Plan, and OAuth, but not Alibaba Cloud Token Plan (Team Edition) as a first-class provider. Token Plan users currently need a large manual provider definition, and Alibaba's documented
bailian-token-planexample must remain an exact custom-provider contract rather than becoming a canonical catalog alias.Closes #94418.
Why This Change Was Made
This adds canonical
qwen-token-plansupport with:QWEN_TOKEN_PLAN_API_KEYhandling.bailian-token-plancustom-provider ID.bailian-token-planintentionally has runtime hooks only—no built-in auth, discovery catalog, static catalog, or environment variables—so existing custom transport, credentials, model rows, and explicit thinking formats remain authoritative.Config-risk metric: +2 provider IDs, +2 auth choices, +1 environment variable, +2 native endpoints, and +14 catalog rows. All additions are additive; no existing provider ID or config shape changes.
User Impact
Users can onboard with
qwen-token-planorqwen-token-plan-cn, authenticate with a region-matched Token Plan key, and select models such asqwen-token-plan/qwen3.7-plus. Existingbailian-token-plan/*configurations continue using their explicitly configured transport and catalog.Token Plan is documented for interactive coding and agent use. The provider docs warn against cron, unattended batch, and application-backend use that can violate the subscription terms.
Evidence
tbx_01kx3r67gg3788ydbktswk1x2d— Actions run 29029979874: extension production/test types passed; 62 stream behavior tests passed.tbx_01kx3rrnapm9etmm41yw1sq5ds— Actions run 29030650617: 93 Qwen plugin tests passed after rebasing onto currentmain.tbx_01kx3s68spj9h41yfeqwxpxnw2d— Actions run 29031140942: the complete docs gate passed after regeneratingdocs/docs_map.md, including markdown lint, MDX validation, 0 broken links, and the generated-map check.41d3aba1660bedfddd64cddad931c99503d9dd55: 70 successful checks, 27 skipped, 1 neutral, no failures.git diff --checkpassed.cbx_cac8973735b8used a fresh public-network lease with no Tailscale or instance role. Every untrusted run fetched PR feat(qwen): add Token Plan (Team Edition) provider #94419, verified exact head41d3aba1660bedfddd64cddad931c99503d9dd55, and injected onlyQWEN_TOKEN_PLAN_API_KEYwithout printing it.run_42ddb175423c, corrected catalog projectionrun_6e37435ce5bb): built and integrity-checked the OpenClaw tarball, installed it into an empty prefix, installed packed@openclaw/qwen-providerthroughnpm-pack:, onboarded Global Token Plan with an environment-backed ref, and loaded the plugin as a trusted official install. Gateway start/restart health passed inrun_3de82699f9b6.qwen-image-2.0andwan2.7-image, matching Alibaba's current exact allowlist after excluding its four dedicated image-generation rows.qwen3.7-plustext (run_d4adc29225fa), one-call read tool (run_6fe6dad65c19), and generated color-marker vision (run_ac2e7ab2bd37); thinking-offkimi-k2.7-code(run_7f9917a79372) andMiniMax-M2.5(run_aba73f8599bf);deepseek-v4-promax/tool then off/replay in one session (run_be02dfa638e0,run_d7ad1299c6e6);glm-5.2max/tool (run_6a881cdac00a); and advertiseddeepseek-v3.2availability (run_703b790ca40c).bailian-token-planretained its one-row custom catalog andanthropic-messagestransport, then completed a real HTTP 200/v1/messagesturn (run_68519df9b5d0).run_ec81d94f1c3c). A China live turn was intentionally not attempted because no separately scoped China key was available; the Global key was not reused cross-region.run_9da2493884b2).The implementation preserves contributor credit with
Co-authored-by: Oliver Mee <[email protected]>.