Skip to content

Add DeepSeek and Qwen support with enhanced AI mistake analysis - #21

Open
xhuandy666 wants to merge 2 commits into
yc1838:mainfrom
xhuandy666:agent/add-multi-provider-ai-analysis
Open

Add DeepSeek and Qwen support with enhanced AI mistake analysis#21
xhuandy666 wants to merge 2 commits into
yc1838:mainfrom
xhuandy666:agent/add-multi-provider-ai-analysis

Conversation

@xhuandy666

Copy link
Copy Markdown

Overview

This PR upgrades LeetCode EasyRepeat from v1.0.6 to v1.0.9 with first-class support for major Chinese LLM providers and a more reliable, useful AI-assisted mistake-analysis workflow.

Key changes

Chinese and multi-provider model support

  • Add official DeepSeek Cloud support, including API-key validation, dynamic model discovery, exact model selection, the extension-side gateway, and the Python Auto-Fix backend.
  • Add Qwen support through Alibaba Cloud DashScope's OpenAI-compatible API. When a gateway does not expose /models, the UI falls back to recommended Qwen models.
  • Add a generic OpenAI-compatible provider with a configurable Base URL and custom model ID.
  • Preserve the existing Gemini, OpenAI, Anthropic, Ollama, and local deepseek-r1 integrations.
  • Honor the provider and model selected by the user without automatic cross-provider failover.

Higher-quality mistake analysis

  • Match the analysis language to the extension UI language: Chinese UI produces Chinese analysis, and English UI produces English analysis.
  • Include the programming language, failing input, actual output, and expected output in the analysis prompt.
  • Ask the model to explain why the submission is wrong, provide the correct approach and corrected code, identify what is still missing compared with a correct solution, and recommend the next step.
  • Give constructive starting guidance for empty or severely incomplete submissions without inventing a specific bug.

More reliable submission handling

  • Snapshot the editor code at submit time so later editor changes cannot alter the analyzed submission.
  • Distinguish code-capture failure from a genuinely empty submission, surface the failure explicitly, and skip the model request when no trustworthy code was captured.
  • Avoid writing empty or severely incomplete attempts into Safe Observer or the similar-error store.
  • Allow an explicitly configured custom model ID when an OpenAI-compatible gateway does not implement model discovery.

Permissions and backend integration

  • Add predefined host access for DeepSeek and DashScope.
  • Request Chrome host permission at runtime for user-configured compatible endpoints.
  • Extend the Python provider factory and model endpoint for DeepSeek, Qwen, and custom OpenAI-compatible providers.
  • Add the missing Anthropic backend dependency and align provider/model endpoint tests with the expanded provider set.

Validation

  • Frontend targeted tests: 44/44 passed.
  • Python backend tests: 60/60 passed.
  • Production Vite build: passed.
  • The full Jest run has the same 11 pre-existing failing suites as upstream main; this branch introduces no new full-suite failures.

Testing note

No real paid-provider request was made because no personal API key was used. Provider requests, model discovery, prompt construction, capture states, and backend routing are covered by automated tests.

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