Skip to content

feat(qwencloud): add QwenCloud provider via the official CLI - #134

Merged
bernardopg merged 2 commits into
bernardopg:mainfrom
gtheys:feat/qwencloud-provider
Nov 22, 2026
Merged

bernardopg merged 2 commits into
bernardopg:mainfrom
gtheys:feat/qwencloud-provider

Conversation

@gtheys

@gtheys gtheys commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Problem

QwenCloud is Alibaba's international Qwen storefront — a separate account from DashScope Model Studio, which the existing qwen card targets. It has its own console, its own API keys (sk-… pay-as-you-go, sk-sp-… Token Plan) and its own billing (Token Plan Credits, Coding Plan, free-tier quotas), so a QwenCloud account shows nothing but an auth check under qwen.

Root cause

QwenCloud exposes no public read-only usage HTTP API. It does, however, ship an official CLI (@qwencloud/qwencloud-cli) with an OAuth device-flow login carrying a read-only usage:read scope, which exposes the full account picture as JSON.

What the card shows

  • Primary: Token Plan monthly Credits bar with reset date, from qwencloud subscription status. This command is the authoritative plan source: usage summary reports the plan as unsubscribed for sk-sp- key traffic (noted in the adapter).
  • Secondary: PAYG this month spend from usage summary (plain reading, hasLimit: false).
  • Tertiary: Free tier — how many per-model free quotas are still valid vs listed.
  • Without a Token Plan the free tier or the PAYG spend leads the card; a broken CLI response degrades to the remaining data instead of failing the card.
  • Missing CLI / expired login produce actionable errors (npm i -g @qwencloud/qwencloud-cli, qwencloud auth login).

Alias: qwen-cloud. Logo reuses qwen.svg (same Qwen brand, noted in SOURCES.md).

Verified end-to-end against a live QwenCloud account on a Token Plan Pro subscription.

Test plan

  • tests/test-qwencloud.sh (new): fake qwencloud CLI fixtures — Token Plan individual/team primary, PAYG/free-tier slot order, degraded responses, signed-out and missing-CLI errors, health readiness, qwen-cloud alias, stub entrypoint
  • scripts/check-metadata, scripts/check-changelog, scripts/check-dco
  • bash -n + shellcheck -S warning on providers/ and the new test
  • Full tests/test-*.sh suite green
  • qmllint exit 0

Signed-off-by: Geert Theys [email protected]

@gtheys
gtheys requested a review from bernardopg as a code owner November 22, 2026 03:25
@github-actions github-actions Bot added documentation Improvements or additions to documentation area:providers Provider adapters (providers/) area:i18n Translations (i18n/) area:assets Logos and static assets (assets/) area:qml QML UI code area:ci CI, workflows, tooling labels Nov 22, 2026
QwenCloud (home.qwencloud.com) is Alibaba's international Qwen
storefront, separate from DashScope Model Studio: its own console,
its own API keys (sk- pay-as-you-go, sk-sp- Token Plan) and its own
billing, so the existing qwen card cannot read it. There is no
public read-only usage HTTP API, but the official QwenCloud CLI
(OAuth device flow, usage:read scope) exposes subscription status
and usage summary as JSON.

The card shows the Token Plan monthly Credits bar with its reset
date from `qwencloud subscription status` — the authoritative plan
source, since `usage summary` reports the plan as unsubscribed for
sk-sp- key traffic — plus the month's pay-as-you-go spend and the
count of still-valid free-tier model quotas. Without a Token Plan
the free tier or the PAYG spend leads the card. Alias: qwen-cloud.

Signed-off-by: Geert Theys <[email protected]>
@gtheys
gtheys force-pushed the feat/qwencloud-provider branch from 4e6e430 to cb04234 Compare November 22, 2026 03:35
PR bernardopg#134 added QwenCloud to the Portuguese README and provider docs, but the English README quota table still omitted it.

Signed-off-by: Bernardo Pinto Gomes <[email protected]>
@bernardopg

bernardopg commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

Thanks for the contribution, @gtheys! The QwenCloud implementation fits the project patterns well: thin stub, native adapter in providers/native/qwencloud.bash, dispatch/health/aliases, logo with SOURCES.md, i18n across all 5 locales, a dedicated test registered in CI, docs, and changelog.

Technical review

Points I checked:

  • Read-only CLI flow (auth status, subscription status, usage summary) with defensive degradation when subscription/summary fail.
  • CLI discovery outside the widget’s lean PATH, kept in sync between adapter and health check.
  • Actionable errors for missing CLI and expired/missing login.
  • UI/config wiring: aliases, dashboard URL, color, label, settings, provider logo, and provider notes.
  • Tests covering happy path, alias, PATH fallback, team plan, no subscription, no free tier, broken response, signed-out, missing CLI, health, and the stub entrypoint.

Small fix I pushed

I pushed a small docs fix to the PR branch (8e66997): added QwenCloud to the English README.md coverage table, which had been missed (the docs/README.pt-BR.md was already updated).

Local validation

In addition to the green checks already on the PR, I ran locally on the current PR state:

  • bash tests/test-qwencloud.sh
  • bash -n providers/native/qwencloud.bash providers/get-provider-health providers/get-provider-usage providers/get-qwencloud-usage tests/test-qwencloud.sh
  • scripts/check-metadata

If you get a chance, please take a look at the docs tweak and let me know if it looks good to you. If you want me to make any other refinement on the PR to speed up merge, I can handle it here. Thanks again!

@bernardopg
bernardopg merged commit 79a85ec into bernardopg:main Nov 22, 2026
16 checks passed
@bernardopg bernardopg mentioned this pull request Nov 22, 2026
4 of 7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:assets Logos and static assets (assets/) area:ci CI, workflows, tooling area:i18n Translations (i18n/) area:providers Provider adapters (providers/) area:qml QML UI code documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants