Skip to content

feat(vscode): replace OAuth with Coding Plan / API Key provider setup #3397

@yiliang114

Description

@yiliang114

What would you like to be added?

Replace the discontinued Qwen OAuth login flow in the VSCode extension with an interactive provider setup that supports:

  1. Alibaba Cloud Coding Plan — select region (China/Global), enter API key, auto-inject all available models
  2. Alibaba Cloud ModelStudio Standard API Key — select region (Beijing/Singapore/Virginia/Hong Kong), enter API key, specify model IDs
  3. Custom API Key — enter base URL, API key, and model name for OpenAI-compatible / Anthropic / Gemini endpoints

The interactive flow uses VSCode native QuickPick + InputBox dialogs (mirroring the CLI's /auth experience), triggered:

  • Automatically on first launch when no valid configuration exists
  • Manually via the /auth slash command in the chat input

Additionally:

  • Move Coding Plan constants (model templates, regions, env keys) from packages/cli to packages/core so both CLI and VSCode extension share a single source of truth
  • Provide bidirectional sync between ~/.qwen/settings.json and VSCode Settings UI
  • Rename all login terminology to auth throughout the extension codebase
  • Add VSCode Settings configuration entries (qwen-code.provider, qwen-code.apiKey, qwen-code.codingPlanRegion, qwen-code.modelProviders, qwen-code.model)

Why is this needed?

Qwen OAuth free tier was discontinued on 2026-04-15 (see #3203). The VSCode extension's onboarding page was hardcoded to use qwen-oauth as the authentication method, leaving new users unable to configure the extension at all. Users who configured via CLI (qwen auth coding-plan) could still use the extension, but there was no way to set up authentication from within VSCode itself.

This change brings the VSCode extension's auth experience to parity with the CLI, ensuring users can configure Coding Plan, Alibaba Standard API Key, or custom providers entirely within VSCode.

Additional context

Related: #3203 (Qwen OAuth Free Tier Policy Adjustment)

Key implementation details:

  • Auth flow uses vscode.window.showQuickPick and vscode.window.showInputBox for native look and feel
  • Configuration is written to ~/.qwen/settings.json (shared with CLI) then CLI subprocess is restarted
  • VSCode Settings entries use object + additionalProperties: string for modelProviders to render as an editable key-value table in the Settings UI
  • Coding Plan model templates are now in packages/core/src/constants/codingPlan.ts — any future model additions automatically apply to both CLI and VSCode

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions