Skip to content

feat(providers): add Baidu Qianfan Coding Plan for Claude Code#2322

Merged
farion1231 merged 3 commits intofarion1231:mainfrom
jimmyzhuu:feat/baidu-qianfan-coding-plan
May 1, 2026
Merged

feat(providers): add Baidu Qianfan Coding Plan for Claude Code#2322
farion1231 merged 3 commits intofarion1231:mainfrom
jimmyzhuu:feat/baidu-qianfan-coding-plan

Conversation

@jimmyzhuu
Copy link
Copy Markdown
Contributor

@jimmyzhuu jimmyzhuu commented Apr 25, 2026

What changed

  • Added a Baidu Qianfan Coding Plan preset for Claude Code.
  • Configured the preset to use the Anthropic-compatible Coding Plan endpoint:
    • https://qianfan.baidubce.com/anthropic/coding
  • Set qianfan-code-latest as the default Claude Code model fields.
  • Added stream-check classification for Qianfan Coding Plan quota-limit errors:
    • coding_plan_hour_quota_exceeded
    • coding_plan_week_quota_exceeded
    • coding_plan_month_quota_exceeded
  • Added localized quota-exceeded health-check messaging.

Why this change is needed

Baidu Qianfan Coding Plan was not available as a Claude Code provider preset, so users had to manually enter the endpoint, token field, and model configuration.

This PR adds a focused Claude Code preset path for Qianfan Coding Plan while keeping OpenCode and OpenClaw support out of scope for now.

User impact

  • Users can configure Baidu Qianfan Coding Plan for Claude Code from provider presets.
  • qianfan-code-latest keeps the local model config stable while users manage the underlying Coding Plan model from the Qianfan console.
  • Qianfan Coding Plan quota-limit responses now show a clearer quota-related health-check warning instead of falling through to a generic failure path.

Follow-up

OpenCode and OpenClaw support is tracked separately because those providers need full URL mode support for non-standard OpenAI-compatible endpoints:

Tests

  • pnpm typecheck
  • pnpm format:check
  • cd src-tauri && cargo test test_detect_qianfan_coding_plan_quota_errors
  • cd src-tauri && cargo fmt --check

@jimmyzhuu jimmyzhuu marked this pull request as ready for review April 25, 2026 06:58
Copy link
Copy Markdown
Owner

@farion1231 farion1231 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this preset be aligned with the existing file format? Its current structure differs quite a bit from the others.

@jimmyzhuu
Copy link
Copy Markdown
Contributor Author

Hi Jason, aligned the Qianfan presets with the existing preset file style by inlining the config in each preset file and removing the shared preset metadata/tests. Also added the base URL template fields for OpenCode/OpenClaw to match nearby presets.

Copy link
Copy Markdown
Owner

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 591d6feeb3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/config/openclawProviderPresets.ts Outdated
Comment thread src/config/opencodeProviderPresets.ts Outdated
@jimmyzhuu
Copy link
Copy Markdown
Contributor Author

Hi Jason, I narrowed this PR to Claude Code support only and removed the Qianfan Coding Plan presets from OpenClaw and OpenCode for now.

Follow-up issue: #2358

@jimmyzhuu jimmyzhuu changed the title feat(providers): add Baidu Qianfan Coding Plan presets feat(providers): add Baidu Qianfan Coding Plan for Claude Code Apr 26, 2026
@jimmyzhuu
Copy link
Copy Markdown
Contributor Author

@farion1231 Hi Jason, just following up on this PR as it’s been almost a week. Could you please help review and merge it when you get a chance?😃

Copy link
Copy Markdown
Owner

@farion1231 farion1231 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution!

@farion1231 farion1231 merged commit db66348 into farion1231:main May 1, 2026
2 checks passed
dashitongzhi pushed a commit to dashitongzhi/cc-switch that referenced this pull request May 1, 2026
…n1231#2322)

* feat(providers): add baidu qianfan coding plan presets

* refactor(providers): align qianfan presets with existing format

* chore(providers): narrow qianfan coding plan scope
ZeroTian pushed a commit to ZeroTian/cc-switch that referenced this pull request May 3, 2026
…n1231#2322)

* feat(providers): add baidu qianfan coding plan presets

* refactor(providers): align qianfan presets with existing format

* chore(providers): narrow qianfan coding plan scope
satan9394 pushed a commit to satan9394/cc-switch-Agent-scheduling that referenced this pull request May 6, 2026
…n1231#2322)

* feat(providers): add baidu qianfan coding plan presets

* refactor(providers): align qianfan presets with existing format

* chore(providers): narrow qianfan coding plan scope
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.

2 participants