Skip to content

feat(provider): add Alibaba Coding Plan and regional Qwen endpoints#1748

Merged
yinwm merged 3 commits intosipeed:mainfrom
adisusilayasa:feat/alibaba-coding-plan
Mar 19, 2026
Merged

feat(provider): add Alibaba Coding Plan and regional Qwen endpoints#1748
yinwm merged 3 commits intosipeed:mainfrom
adisusilayasa:feat/alibaba-coding-plan

Conversation

@adisusilayasa
Copy link
Copy Markdown
Contributor

Summary

  • Add Alibaba Coding Plan provider support with OpenAI-compatible endpoint (https://coding-intl.dashscope.aliyuncs.com/v1)
  • Add Coding Plan Anthropic-compatible endpoint (https://coding-intl.dashscope.aliyuncs.com/apps/anthropic)
  • Add regional Qwen endpoints for international (qwen-intl) and US (qwen-us) regions
  • Add provider aliases: coding-plan, alibaba-coding, qwen-coding
  • Normalize provider names for coding-plan variants

Changes

Protocol Endpoint
coding-plan, alibaba-coding, qwen-coding https://coding-intl.dashscope.aliyuncs.com/v1
coding-plan-anthropic, alibaba-coding-anthropic https://coding-intl.dashscope.aliyuncs.com/apps/anthropic
qwen-intl, dashscope-intl https://dashscope-intl.aliyuncs.com/compatible-mode/v1
qwen-us, dashscope-us https://dashscope-us.aliyuncs.com/compatible-mode/v1

Test Plan

  • go fmt ./... - passed
  • go vet ./... - passed (unrelated pre-existing warning)
  • go test ./pkg/providers/... - all tests passed

AI Disclosure

This PR was created with AI assistance (Claude Code) for code generation. The changes were reviewed and validated by the contributor.

🤖 Generated with Claude Code

- Add Alibaba Coding Plan provider with OpenAI-compatible endpoint
  (https://coding-intl.dashscope.aliyuncs.com/v1)
- Add Coding Plan Anthropic-compatible endpoint
  (https://coding-intl.dashscope.aliyuncs.com/apps/anthropic)
- Add regional Qwen endpoints (qwen-intl, qwen-us)
- Add provider aliases: coding-plan, alibaba-coding, qwen-coding
- Normalize provider names for coding-plan variants

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@yinwm
Copy link
Copy Markdown
Collaborator

yinwm commented Mar 18, 2026

Pre-Landing Review

Thanks for adding Alibaba Coding Plan support! I found a few issues that need attention:


🔴 Critical Issues

1. Missing protocol aliases in CreateProviderFromConfig switch case

Location: pkg/providers/factory_provider.go:246-253

In getDefaultAPIBase(), you added these aliases:

  • qwen-international, dashscope-intl → returns qwen-intl endpoint
  • dashscope-us → returns qwen-us endpoint
  • coding-plan-anthropic, alibaba-coding-anthropic → returns Anthropic endpoint

However, these aliases are not listed in the CreateProviderFromConfig switch case!

Impact: Users using qwen-international/model-name will hit the default branch and get "unknown protocol" error.

Fix: Add missing aliases to the case statement:

case "litellm", "openrouter", ..., "qwen-intl", "qwen-international", "dashscope-intl", 
     "qwen-us", "dashscope-us", "coding-plan", "alibaba-coding", "qwen-coding":

2. coding-plan-anthropic protocol not implemented

Location: pkg/providers/factory_provider.go:252-253

The PR description states that coding-plan-anthropic should use the Anthropic-compatible endpoint, but the code only defines the URL in getDefaultAPIBase()no corresponding case exists in CreateProviderFromConfig.

Fix: Add a new case branch:

case "coding-plan-anthropic", "alibaba-coding-anthropic":
    apiBase := cfg.APIBase
    if apiBase == "" {
        apiBase = getDefaultAPIBase(protocol)
    }
    if cfg.APIKey == "" {
        return nil, "", fmt.Errorf("api_key is required for %q protocol", protocol)
    }
    return anthropicmessages.NewProviderWithTimeout(
        cfg.APIKey,
        apiBase,
        cfg.RequestTimeout,
    ), modelID, nil

🟡 Informational

3. Missing normalization mappings in NormalizeProvider

Location: pkg/providers/model_ref.go:56-57

You added alibaba-coding, qwen-codingcoding-plan, but these are missing:

  • qwen-international, dashscope-intlqwen-intl
  • dashscope-usqwen-us

Recommendation: Add these for consistency, or remove the aliases from getDefaultAPIBase() if they're not intended as user-facing protocol names.


Summary

Issues #1 and #2 are blocking — the current code will throw "unknown protocol" for the alias protocols. #3 is a consistency issue worth addressing.

🤖 Generated with Claude Code

adisusilayasa and others added 2 commits March 19, 2026 03:35
- Add qwen-international, dashscope-intl, dashscope-us aliases to switch case
- Add coding-plan-anthropic case with anthropicmessages.NewProviderWithTimeout
- Add alibaba-coding-anthropic -> coding-plan-anthropic normalization
- Add qwen-international -> qwen-intl and dashscope-us -> qwen-us normalization

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
- Add tests for qwen-international, dashscope-intl, dashscope-us aliases
- Add tests for coding-plan-anthropic and alibaba-coding-anthropic
- Add getDefaultAPIBase tests for all new aliases
- Add normalization tests for new provider aliases

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@adisusilayasa
Copy link
Copy Markdown
Contributor Author

✅ Review Feedback Addressed

All issues from the pre-landing review have been fixed:

🔴 Critical Issue #1: Fixed missing protocol aliases

File: pkg/providers/factory_provider.go:116-120

Added missing aliases to the CreateProviderFromConfig switch case:

  • qwen-international, dashscope-intl → now work with OpenAI-compatible provider
  • dashscope-us → now works with OpenAI-compatible provider

🔴 Critical Issue #2: Implemented coding-plan-anthropic protocol

File: pkg/providers/factory_provider.go:177-190

Added a new case for coding-plan-anthropic and alibaba-coding-anthropic that uses the Anthropic Messages provider:

case "coding-plan-anthropic", "alibaba-coding-anthropic":
    apiBase := cfg.APIBase
    if apiBase == "" {
        apiBase = getDefaultAPIBase(protocol)
    }
    if cfg.APIKey == "" {
        return nil, "", fmt.Errorf("api_key is required for %q protocol (model: %s)", protocol, cfg.Model)
    }
    return anthropicmessages.NewProviderWithTimeout(
        cfg.APIKey,
        apiBase,
        cfg.RequestTimeout,
    ), modelID, nil

🟡 Informational Issue #3: Added normalization mappings

File: pkg/providers/model_ref.go:60-63

Added normalization mappings:

  • qwen-international, dashscope-intlqwen-intl
  • dashscope-usqwen-us

✅ Tests Added

  • Tests for all new protocol aliases in factory_provider_test.go
  • Tests for getDefaultAPIBase with new aliases
  • Updated normalization tests in model_ref_test.go

All tests pass:

=== RUN   TestCreateProviderFromConfig_QwenInternationalAlias
--- PASS: TestCreateProviderFromConfig_QwenInternationalAlias
=== RUN   TestCreateProviderFromConfig_QwenUSAlias
--- PASS: TestCreateProviderFromConfig_QwenUSAlias
=== RUN   TestCreateProviderFromConfig_CodingPlanAnthropic
--- PASS: TestCreateProviderFromConfig_CodingPlanAnthropic
=== RUN   TestGetDefaultAPIBase_CodingPlanAnthropic
--- PASS: TestGetDefaultAPIBase_CodingPlanAnthropic
=== RUN   TestGetDefaultAPIBase_QwenIntlAliases
--- PASS: TestGetDefaultAPIBase_QwenIntlAliases
=== RUN   TestGetDefaultAPIBase_QwenUSAliases
--- PASS: TestGetDefaultAPIBase_QwenUSAliases
=== RUN   TestNormalizeProvider
--- PASS: TestNormalizeProvider

🤖 Generated with Claude Code

@adisusilayasa
Copy link
Copy Markdown
Contributor Author

Thank you for the thorough review! All three issues have already been addressed in the latest commits:

✅ Issue #1: Missing protocol aliases in CreateProviderFromConfig

Fixed in commit b71bece - All aliases (qwen-intl, qwen-international, dashscope-intl, qwen-us, dashscope-us, coding-plan, alibaba-coding, qwen-coding) are now present in the switch case at pkg/providers/factory_provider.go:116-120.

✅ Issue #2: coding-plan-anthropic protocol not implemented

Fixed in commit b71bece - A dedicated case branch exists at pkg/providers/factory_provider.go:177-190 that properly creates an Anthropic-compatible provider using anthropicmessages.NewProviderWithTimeout().

✅ Issue #3: Missing normalization mappings in NormalizeProvider

Fixed in commit b71bece - All mappings are present at pkg/providers/model_ref.go:60-63:

  • qwen-international, dashscope-intlqwen-intl
  • dashscope-usqwen-us

Tests added in commit 5eece48 verify all aliases work correctly:

  • TestCreateProviderFromConfig_QwenInternationalAlias
  • TestCreateProviderFromConfig_QwenUSAlias
  • TestCreateProviderFromConfig_CodingPlanAnthropic
  • TestGetDefaultAPIBase_CodingPlanAnthropic
  • TestGetDefaultAPIBase_QwenIntlAliases
  • TestGetDefaultAPIBase_QwenUSAliases

All tests pass ✅

@sipeed-bot sipeed-bot bot added type: enhancement New feature or request domain: provider labels Mar 19, 2026
Copy link
Copy Markdown
Collaborator

@yinwm yinwm left a comment

Choose a reason for hiding this comment

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

LGTM! Code implementation is clean and consistent with existing patterns. Tests cover all new providers and aliases.

One minor note: Documentation in docs/providers.md (and language variants) doesn't include the new providers yet. Recommend running /document-release post-merge to sync docs.

🚀 Ready to merge!

@yinwm yinwm merged commit 9a3ca8e into sipeed:main Mar 19, 2026
4 checks passed
tong3jie pushed a commit to tong3jie/picoclaw that referenced this pull request Mar 20, 2026
…ipeed#1748)

* feat(provider): add Alibaba Coding Plan and regional Qwen endpoints

- Add Alibaba Coding Plan provider with OpenAI-compatible endpoint
  (https://coding-intl.dashscope.aliyuncs.com/v1)
- Add Coding Plan Anthropic-compatible endpoint
  (https://coding-intl.dashscope.aliyuncs.com/apps/anthropic)
- Add regional Qwen endpoints (qwen-intl, qwen-us)
- Add provider aliases: coding-plan, alibaba-coding, qwen-coding
- Normalize provider names for coding-plan variants

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* fix(provider): add reviewer-requested fixes for Alibaba Coding Plan

- Add qwen-international, dashscope-intl, dashscope-us aliases to switch case
- Add coding-plan-anthropic case with anthropicmessages.NewProviderWithTimeout
- Add alibaba-coding-anthropic -> coding-plan-anthropic normalization
- Add qwen-international -> qwen-intl and dashscope-us -> qwen-us normalization

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* test(provider): add tests for Alibaba Coding Plan protocol aliases

- Add tests for qwen-international, dashscope-intl, dashscope-us aliases
- Add tests for coding-plan-anthropic and alibaba-coding-anthropic
- Add getDefaultAPIBase tests for all new aliases
- Add normalization tests for new provider aliases

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

---------

Co-authored-by: Claude <[email protected]>
@Orgmar
Copy link
Copy Markdown
Contributor

Orgmar commented Mar 20, 2026

@adisusilayasa Great addition with the Alibaba Coding Plan and regional Qwen endpoints. Covering both OpenAI and Anthropic compatible protocols plus the regional variants gives users solid flexibility. Tests passing clean is a nice bonus.

By the way, we have a PicoClaw Dev Group on Discord where contributors chat and collaborate. Want to join? Send an email to [email protected] with subject [Join PicoClaw Dev Group] adisusilayasa and we'll send you the invite!

j0904 pushed a commit to j0904/picoclaw that referenced this pull request Mar 22, 2026
…ipeed#1748)

* feat(provider): add Alibaba Coding Plan and regional Qwen endpoints

- Add Alibaba Coding Plan provider with OpenAI-compatible endpoint
  (https://coding-intl.dashscope.aliyuncs.com/v1)
- Add Coding Plan Anthropic-compatible endpoint
  (https://coding-intl.dashscope.aliyuncs.com/apps/anthropic)
- Add regional Qwen endpoints (qwen-intl, qwen-us)
- Add provider aliases: coding-plan, alibaba-coding, qwen-coding
- Normalize provider names for coding-plan variants

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* fix(provider): add reviewer-requested fixes for Alibaba Coding Plan

- Add qwen-international, dashscope-intl, dashscope-us aliases to switch case
- Add coding-plan-anthropic case with anthropicmessages.NewProviderWithTimeout
- Add alibaba-coding-anthropic -> coding-plan-anthropic normalization
- Add qwen-international -> qwen-intl and dashscope-us -> qwen-us normalization

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* test(provider): add tests for Alibaba Coding Plan protocol aliases

- Add tests for qwen-international, dashscope-intl, dashscope-us aliases
- Add tests for coding-plan-anthropic and alibaba-coding-anthropic
- Add getDefaultAPIBase tests for all new aliases
- Add normalization tests for new provider aliases

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

---------

Co-authored-by: Claude <[email protected]>
@Hareis
Copy link
Copy Markdown

Hareis commented Mar 24, 2026

@adisusilayasa latest version contains this pull request ?

renato0307 pushed a commit to renato0307/picoclaw that referenced this pull request Mar 26, 2026
…ipeed#1748)

* feat(provider): add Alibaba Coding Plan and regional Qwen endpoints

- Add Alibaba Coding Plan provider with OpenAI-compatible endpoint
  (https://coding-intl.dashscope.aliyuncs.com/v1)
- Add Coding Plan Anthropic-compatible endpoint
  (https://coding-intl.dashscope.aliyuncs.com/apps/anthropic)
- Add regional Qwen endpoints (qwen-intl, qwen-us)
- Add provider aliases: coding-plan, alibaba-coding, qwen-coding
- Normalize provider names for coding-plan variants

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* fix(provider): add reviewer-requested fixes for Alibaba Coding Plan

- Add qwen-international, dashscope-intl, dashscope-us aliases to switch case
- Add coding-plan-anthropic case with anthropicmessages.NewProviderWithTimeout
- Add alibaba-coding-anthropic -> coding-plan-anthropic normalization
- Add qwen-international -> qwen-intl and dashscope-us -> qwen-us normalization

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* test(provider): add tests for Alibaba Coding Plan protocol aliases

- Add tests for qwen-international, dashscope-intl, dashscope-us aliases
- Add tests for coding-plan-anthropic and alibaba-coding-anthropic
- Add getDefaultAPIBase tests for all new aliases
- Add normalization tests for new provider aliases

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

---------

Co-authored-by: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants