Skip to content

Add Coding Plan Authentication#57

Open
BingqingLyu wants to merge 20 commits into
mainfrom
fork-pr-2490-feat-2134-auth-parity
Open

Add Coding Plan Authentication#57
BingqingLyu wants to merge 20 commits into
mainfrom
fork-pr-2490-feat-2134-auth-parity

Conversation

@BingqingLyu

@BingqingLyu BingqingLyu commented Apr 27, 2026

Copy link
Copy Markdown
Owner

Overview

This PR introduces comprehensive authentication enhancements including Alibaba Cloud Coding Plan support and a multi-language internationalization system for the WebUI onboarding experience.

Changes

Core Features

  1. Coding Plan Authentication
    • Added support for Alibaba Cloud Coding Plan authentication method in both CLI and VSCode extension
    • Supports two regions:
      • 阿里云百炼 (aliyun.com) - China region
      • Alibaba Cloud (alibabacloud.com) - Global region
    • New codingPlanLogic.ts utility for handling Coding Plan authentication flow

2 Enhanced Onboarding Experience

  • Updated WebUI Onboarding component with:
    • Authentication method selection interface
    • Coding Plan API key and region input form
    • Custom configuration guidance for OpenAI-compatible APIs
    • Error message display for login failures
  • VSCode WebView integration with auth state management
  • Improved authentication flow with methodId and _meta parameter passing

Modified Files

CLI Package:

  • packages/cli/src/acp-integration/acpAgent.ts - Added Coding Plan auth handling
  • packages/cli/src/acp-integration/authMethods.ts - Updated auth method list with i18n
  • packages/cli/src/utils/codingPlanLogic.ts - New utility for Coding Plan auth

Core Package:

  • packages/core/src/core/contentGenerator.ts - Minor updates
  • packages/core/src/models/constants.ts - Added Coding Plan constants

VSCode Extension:

  • packages/vscode-ide-companion/src/services/acpConnection.ts
  • packages/vscode-ide-companion/src/services/qwenAgentManager.ts
  • packages/vscode-ide-companion/src/services/qwenConnectionHandler.ts
  • packages/vscode-ide-companion/src/types/acpTypes.ts
  • packages/vscode-ide-companion/src/utils/authErrors.ts
  • packages/vscode-ide-companion/src/webview/App.tsx
  • packages/vscode-ide-companion/src/webview/components/layout/Onboarding.tsx
  • packages/vscode-ide-companion/src/webview/handlers/AuthMessageHandler.ts
  • packages/vscode-ide-companion/src/webview/handlers/MessageRouter.ts
  • packages/vscode-ide-companion/src/webview/handlers/SessionMessageHandler.ts
  • packages/vscode-ide-companion/src/webview/hooks/useWebViewMessages.ts
  • packages/vscode-ide-companion/src/webview/providers/MessageHandler.ts
  • packages/vscode-ide-companion/src/webview/providers/WebViewProvider.ts

WebUI:

  • packages/webui/src/components/layout/Onboarding.tsx - Complete UI overhaul
  • packages/webui/src/utils/i18n.ts - New i18n module

Technical Details

Authentication Flow

  1. User selects authentication method from onboarding screen
  2. For Coding Plan:
    • User enters API key and selects region
    • Credentials passed via _meta parameter to authenticate handler
    • API key stored in settings with proper persistence scope
  3. For OAuth: Standard OAuth flow continues
  4. For OpenAI-compatible: Guidance to settings.json configuration

Type Safety Notes

Some any types were introduced to handle dynamic authentication metadata passing between components. These should be refined in future iterations with proper interface definitions.

Testing

  • Manual testing of OAuth flow (unchanged)
  • Manual testing of Coding Plan authentication with both regions
  • UI testing of onboarding flow in WebUI
  • VSCode extension WebView message handling

Related Issues

Screenshots

image image image image

Video

vscc1.mp4

xwj02155382 and others added 20 commits March 19, 2026 16:11
… ensure ui hasContent evaluates to false to allow Onboarding panel render
…on is loaded to prevent old session data from stalling the UI rendering
… i18n overlay

This commit achieves the following:

- Redesigns the `Onboarding.tsx` screen to match Claude Code's minimalist structure with better spacing, robust dash borders, and solid styling on primary and secondary buttons.

- Disconnects UI languages from IDE language injection (`vscode.env.language`) in `acpConnection.ts`.

- Strips branch-specific multi-language wrapping (`t()` and `import { t }`) across components like `AskUserQuestionDialog.tsx` and `authMethods.ts`.

- Configures auth method identifiers properly stringified (`coding-plan`) instead of mutating global Enums.
- Fix connection error showing in chat instead of onboarding page
- Fix OAuth race condition: keep onboarding visible during re-auth
- Align auth method labels with CLI (Select Authentication Method,
  Free · Up to 1,000 requests/day, API Key / Bring your own API key)
- Redesign Coding Plan flow: Region select → API Key (two-step)
- Add API key validation (empty check + sk-sp- prefix for China)
- Region options: 阿里云百炼 (aliyun.com) / Alibaba Cloud (alibabacloud.com)
- Add 'Coding Plan API key here' link per CLI parity
- Use Qwen brand purple (#6366f1) for primary buttons
- Add outlined secondary buttons and ghost back buttons for better
  visual hierarchy and button affordance
- Center-align all onboarding content

Closes QwenLM#2134
@BingqingLyu BingqingLyu added conflicting-group-1 conflicting-group-1 Conflicting PR group 1 — review as a batch conflicting-pr Shares at least one cross-PR dependency with other PRs and removed conflicting-group-1 labels May 7, 2026
@BingqingLyu

BingqingLyu commented May 7, 2026

Copy link
Copy Markdown
Owner Author

Conflict Group 1

This PR shares modified functions with 2 other PR(s): #114, #96.

These PRs should be reviewed as a batch — merging one may affect the others.

Function File Also modified by
isInsightCommand WebViewProvider.ts #114, #96
graph LR
    PR57["PR #57"]
    FisInsightCommand_8827["isInsightCommand<br>WebViewProvider.ts"]
    PR57 -->|modifies| FisInsightCommand_8827
    PR114["PR #114"]
    PR114 -->|modifies| FisInsightCommand_8827
    PR96["PR #96"]
    PR96 -->|modifies| FisInsightCommand_8827
Loading

Posted by codegraph-ai conflict detection.

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

Labels

conflicting-group-1 Conflicting PR group 1 — review as a batch conflicting-pr Shares at least one cross-PR dependency with other PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant