Skip to content

fix(providers): correct Qwen OpenAI-compatible base URL path to /compatible-mode/v1#125

Closed
andrei-hasna wants to merge 2 commits into
mainfrom
openloops/open-codewith/eb7606a1-597e-4588-9a00-cda6c188f696-50ac9450
Closed

fix(providers): correct Qwen OpenAI-compatible base URL path to /compatible-mode/v1#125
andrei-hasna wants to merge 2 commits into
mainfrom
openloops/open-codewith/eb7606a1-597e-4588-9a00-cda6c188f696-50ac9450

Conversation

@andrei-hasna

Copy link
Copy Markdown
Contributor

Summary

The Qwen (Alibaba Model Studio) OpenAI-compatible base URL used the DashScope Application/RAG API prefix (/api/v2/apps/protocols/) instead of the Chat Completions compatible-mode path.

Per official Alibaba docs (Call Qwen models via OpenAI API, checked 2026-07-05), the OpenAI-compatible base path is /compatible-mode/v1. The correct region-agnostic international endpoint is:

https://dashscope-intl.aliyuncs.com/compatible-mode/v1

Decision

Kept the legacy dashscope-intl domain as the zero-config default. Alibaba recommends (does not require) migrating to workspace-specific domains (https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1), but those need a per-user {WorkspaceId} placeholder and therefore cannot be a default; the legacy domain remains fully functional. Advanced users can still override via config.toml model_providers.

Changes

  • codex-rs/model-provider-info/src/lib.rs: QWEN_BASE_URLhttps://dashscope-intl.aliyuncs.com/compatible-mode/v1
  • codex-rs/known-provider-models/src/lib.rs: QWEN_BASE_URL → same value (kept byte-identical)

Validation

  • cargo test -p codex-model-provider-info -p codex-known-provider-models -p codex-model-provider — 66 + 16 + 64 passed, 0 failed
  • cargo clippy -p codex-model-provider-info -p codex-known-provider-models --all-targets — clean
  • grep -rn 'api/v2/apps/protocols' — no remaining occurrences

Task: eb7606a1-597e-4588-9a00-cda6c188f696

🤖 Generated with Claude Code

andrei-hasna and others added 2 commits July 5, 2026 21:02
…atible-mode/v1

The Qwen (Alibaba Model Studio) OpenAI-compatible base URL used the
DashScope Application/RAG API prefix (/api/v2/apps/protocols/) instead
of the Chat Completions compatible-mode path. Per official Alibaba docs
(compatibility-of-openai-with-dashscope, checked 2026-07-05) the correct
region-agnostic international endpoint is
https://dashscope-intl.aliyuncs.com/compatible-mode/v1.

Kept the legacy dashscope-intl domain as the zero-config default;
workspace-specific domains require a per-user {WorkspaceId} placeholder
and cannot be a default. Updated both QWEN_BASE_URL constants
(model-provider-info, known-provider-models) to stay byte-identical.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@andrei-hasna

Copy link
Copy Markdown
Contributor Author

[codewith] Merge review update for task 956c88bf:

  • Refreshed the PR branch with current main; new head is 4494e21.
  • PR diff against main remains scoped to the two Qwen provider constants: codex-rs/model-provider-info/src/lib.rs and codex-rs/known-provider-models/src/lib.rs.
  • Focused local validation passed on the refreshed head:
    • cd codex-rs && just test-fast -p codex-model-provider-info: 66 passed
    • cd codex-rs && just test-fast -p codex-known-provider-models: 16 passed
  • Independent adversarial review found the Qwen /compatible-mode/v1 path defensible and constants synchronized.
  • Not merged yet: refreshed CI is red due current-main blockers unrelated to this PR diff:
    • ci / build-test: verify_tui_core_boundary flags codex-rs/tui/src/chatwidget/settings_popups.rs:201 for codex_core text
    • Codespell: codex-rs/tui/src/chatwidget/settings_popups.rs:202 pre-selected => preselected
    • Bazel Linux / rust-ci format failures are still settling but match the existing current-main CI blocker task d8a3e575 and repair task 7ef5ed37.

Final merge should use squash/reword so the original commit's Co-Authored-By trailer is not carried into main.

@andrei-hasna

Copy link
Copy Markdown
Contributor Author

Closing as superseded by #207. Replacement #207 carries the current provider/docs cleanup slice and explicitly lists this PR in its carried scope. Please continue review on #207.

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.

1 participant