Skip to content

feat: add alibaba coding plan as provider#1050

Open
joshuachong wants to merge 1 commit intoRightNow-AI:mainfrom
joshuachong:feat/alibaba-coding-plan
Open

feat: add alibaba coding plan as provider#1050
joshuachong wants to merge 1 commit intoRightNow-AI:mainfrom
joshuachong:feat/alibaba-coding-plan

Conversation

@joshuachong
Copy link
Copy Markdown

Summary

Notes:

  • API Key format: sk-sp-xxxxx (plan-specific, different from pay-as-you-go sk-xxxxx)
  • Base URL: https://coding-intl.dashscope.aliyuncs.com/v1
  • Subscription: $50/month Pro plan with quota limits (90K requests/month, 45K/week, 6K per 5 hours)

Note: Additional linting errors are coming from drivers/copilot.rs changes. Not changing untouched files for now.

Model Specifications

Model ID Display Name Tier Context Max Output Vision Tools Cost
alibaba-coding-plan/qwen3.6-plus Qwen 3.6 Plus Smart 1,000,000 65,536 $0
alibaba-coding-plan/qwen3.5-plus Qwen 3.5 Plus Smart 1,000,000 65,536 $0
alibaba-coding-plan/qwen3-max-2026-01-23 Qwen 3 Max Frontier 262,144 65,536 $0
alibaba-coding-plan/qwen3-coder-plus Qwen 3 Coder Plus Smart 1,000,000 65,536 $0
alibaba-coding-plan/qwen3-coder-next Qwen 3 Coder Next Frontier 262,144 65,536 $0
alibaba-coding-plan/glm-5 GLM-5 (Zhipu) Frontier 202,752 32,768 $0
alibaba-coding-plan/glm-4.7 GLM-4.7 (Zhipu) Smart 202,752 32,768 $0
alibaba-coding-plan/kimi-k2.5 Kimi K2.5 (Moonshot) Smart 262,144 32,768 $0
alibaba-coding-plan/MiniMax-M2.5 MiniMax M2.5 Smart 204,800 32,768 $0

Changes

  • Added Alibaba Coding Plan as constants and model_catalog
  • 9 model entries added as part of Alibaba Coding Plan support
  • Added pattern matching for Alibaba Coding Plan on metering since this is a subscription-based model and not pay-per-token
  • Updated documentation for new provider

Testing

  • cargo clippy --workspace --all-targets -- -D warnings passes
  • cargo test --workspace passes
  • Live integration tested (if applicable)

Security

  • No new unsafe code
  • No secrets or API keys in diff
  • User input validated at boundaries

@joshuachong
Copy link
Copy Markdown
Author

Note linting errors from crates/openfang-runtime/src/drivers/copilot.rs that are not part of this change:

warning: constant `DEVICE_FLOW_POLL_INTERVAL` is never used
  --> crates/openfang-runtime/src/drivers/copilot.rs:58:7
   |
58 | const DEVICE_FLOW_POLL_INTERVAL: Duration = Duration::from_secs(5);
   |       ^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default

warning: field `fetched_at` is never read
   --> crates/openfang-runtime/src/drivers/copilot.rs:141:5
    |
139 | struct CachedModels {
    |        ------------ field in this struct
140 |     models: Vec<String>,
141 |     fetched_at: Instant,
    |     ^^^^^^^^^^
    |
    = note: `CachedModels` has a derived impl for the trait `Clone`, but this is intentionally ignored during dead code analysis

warning: field `refresh_token_expires_in` is never read
   --> crates/openfang-runtime/src/drivers/copilot.rs:172:5
    |
164 | struct OAuthTokenResponse {
    |        ------------------ field in this struct
...
172 |     refresh_token_expires_in: Option<i64>,
    |     ^^^^^^^^^^^^^^^^^^^^^^^^

warning: function `prompt_line` is never used
   --> crates/openfang-runtime/src/drivers/copilot.rs:785:4
    |
785 | fn prompt_line(prompt: &str) -> Result<String, String> {
    |    ^^^^^^^^^^^

@jaberjaber23
Copy link
Copy Markdown
Member

Thanks @joshuachong — Alibaba Dashscope as a provider is a welcome addition. Verified the base URL (https://coding-intl.dashscope.aliyuncs.com/v1) is the official Dashscope-international endpoint, Bearer auth via ALIBABA_CODING_PLAN_API_KEY matches their docs.

Before merge:

  1. Clippy/lint fallout — your PR notes mention lint warnings in copilot.rs that are not from your changes. Rebase on current main (post-fix(deps): upgrade wasmtime 41->43 and rumqttc 0.24->0.25 to resolve active CVEs #1041 which also touched drivers) and run cargo clippy --workspace -- -D warnings locally. If the noise persists, flag it and I'll look.
  2. Parallel-test flakiness — your driver tests use std::env::set_var / remove_var which race across cargo test threads. Either wrap with a serial_test attribute or use a Mutex<()> guard for the API-key env tests.
  3. Doc/code model count syncdocs/providers.md lists ~62 models for Alibaba; please confirm builtin_models() returns exactly that number so the numbers don't drift.

Once those are in and CI is green, this is ready to merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Integrate Alibaba Coding Plan Models

2 participants