Skip to content

feat: Add Qwen model recognition tests and documentation (follow-up to #1050)#1094

Closed
LoneWolf36 wants to merge 6 commits intocoleam00:devfrom
LoneWolf36:feat/qwen-clean-docs
Closed

feat: Add Qwen model recognition tests and documentation (follow-up to #1050)#1094
LoneWolf36 wants to merge 6 commits intocoleam00:devfrom
LoneWolf36:feat/qwen-clean-docs

Conversation

@LoneWolf36
Copy link
Copy Markdown

@LoneWolf36 LoneWolf36 commented Apr 11, 2026

Summary

This PR should be reviewed AFTER #1050 is merged.

Adds comprehensive test coverage and documentation for Qwen provider support:

Stats: 1 commit | 4 files changed | +500 lines

Changes:

  • ✅ Enhanced isQwenModel() to recognize all Qwen variants (qwen-coder, qwen-max, qwq-*, etc.)
  • ✅ 15 new test cases (25 total on model-validation.ts, 100% passing)
  • ✅ 300+ line Qwen setup guide (docs/qwen-setup.md)
  • ✅ README updates highlighting Qwen as first-class assistant

Why this is clean:

  • Single commit - all documentation and test work in one atomic change
  • No duplication - zero overlap with PR feat: add Qwen support to Archon #1050
  • Focused scope - only docs and tests, no core implementation

Merge order:

  1. ✅ Merge PR feat: add Qwen support to Archon #1050 (core Qwen integration)
  2. ✅ Merge this PR (documentation & tests)

Testing:

bun test packages/workflows/src/model-validation.test.ts
# 25 tests passing, 100% coverage on model-validation.ts

Summary by CodeRabbit

Release Notes

  • New Features

    • Added Qwen as a supported AI assistant alongside Claude and Codex
    • Setup wizard now includes Qwen selection and configuration options
    • Workflows support Qwen as a provider option per workflow or node
    • Configuration supports Qwen-specific settings including model, authentication, and permission modes
  • Documentation

    • Added comprehensive Qwen setup guide covering installation, authentication flows, and configuration
    • Updated architecture documentation and README to reflect Qwen support

LoneWolf36 and others added 6 commits April 10, 2026 15:36
Integrate Qwen as a first-class assistant across config, workflows, CLI setup, API schemas, and the web UI. Add a Qwen smoke test and tighten the docs so the remaining provider-specific limits are explicit.

This keeps Archon aligned with the new Qwen path while documenting where behavior still differs from Claude and Codex.

Co-Authored-By: Codex GPT-5 <noreply@openai.com>
Preserve existing Qwen settings when assistant config is updated so the web settings flow no longer drops qwen entries from global config.

Stop forcing OpenAI auth in the Qwen client and allow the SDK to follow its native auth resolution unless Archon is configured explicitly. Also pass through OpenAI-compatible env vars and wire the Qwen smoke test into the package test script so the reviewed behavior stays covered.

Co-Authored-By: Codex GPT-5 <noreply@openai.com>
Prevent duplicate tool-call emission when partial Qwen streaming emits a tool start before the final assistant message, and pass native Qwen auth environment variables through the subprocess allowlist.

Co-Authored-By: Codex GPT-5 <noreply@openai.com>
- Config persistence: unconditionally preserve qwen in updateGlobalConfig()
- CLI setup: filter default assistant options by actually configured assistants
- Add mode: read hasQwen and defaultAssistant from existing config instead of hardcoding
- Missing env vars: inject config.envVars into Qwen node options in dag-executor
- Provider misrouting: return undefined instead of 'codex' for unknown models
- Streaming dedup: track sawPartialText separately from tool_use partials
- Security: scope Qwen credentials to QwenClient only, remove from shared allowlist
- UI robustness: add optional chaining for config.assistants.qwen?.model in SettingsPage

Co-Authored-By: Codex GPT-5 <noreply@openai.com>

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
…ator warnings

- Schema: make qwen optional+nullable in safeConfigSchema for unset state
- Docstring: fix authType docstring to reflect SDK-resolved default (not 'openai')
- Validator: add Qwen warnings for MCP, skills, hooks, and tool restrictions
  (previously only warned for Codex; now warns for both non-Claude providers)

Co-Authored-By: Codex GPT-5 <noreply@openai.com>

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Improve model recognition for Qwen variants (qwen-coder, qwen-max, qwen-turbo, qwen-plus, qwq-*, qvq-*)
- Add comprehensive test coverage for Qwen model validation and provider inference
- Create detailed Qwen setup guide in docs/qwen-setup.md
- Update README.md to highlight Qwen as first-class AI assistant
- Add configuration examples and migration guide for binary v0.3.5 users
- Ensure all Qwen model patterns are properly recognized in isQwenModel()
- Add tests for provider inference with various Qwen model names
- Document Qwen-specific workflow configuration patterns

Closes: Qwen support gap between source code and binary v0.3.5

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
@LoneWolf36
Copy link
Copy Markdown
Author

Closing - will document proper merge strategy in PR #1050 instead.

@LoneWolf36 LoneWolf36 closed this Apr 11, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 11, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 74e32714-a591-44f3-97bb-7c0d9d43cf3a

📥 Commits

Reviewing files that changed from the base of the PR and between 536584d and 3b5f371.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (43)
  • CLAUDE.md
  • README.md
  • docs/qwen-setup.md
  • packages/cli/src/commands/setup.test.ts
  • packages/cli/src/commands/setup.ts
  • packages/core/package.json
  • packages/core/src/clients/factory.test.ts
  • packages/core/src/clients/factory.ts
  • packages/core/src/clients/index.ts
  • packages/core/src/clients/qwen.test.ts
  • packages/core/src/clients/qwen.ts
  • packages/core/src/config/config-loader.test.ts
  • packages/core/src/config/config-loader.ts
  • packages/core/src/config/config-types.ts
  • packages/core/src/db/conversations.ts
  • packages/core/src/handlers/clone.test.ts
  • packages/core/src/handlers/clone.ts
  • packages/core/src/index.ts
  • packages/core/src/orchestrator/orchestrator.test.ts
  • packages/core/src/services/title-generator.ts
  • packages/core/src/utils/env-allowlist.test.ts
  • packages/core/src/utils/env-allowlist.ts
  • packages/server/src/routes/api.ts
  • packages/server/src/routes/schemas/config.schemas.ts
  • packages/web/src/components/workflows/BuilderToolbar.tsx
  • packages/web/src/components/workflows/NodeInspector.tsx
  • packages/web/src/components/workflows/WorkflowBuilder.tsx
  • packages/web/src/lib/api.generated.d.ts
  • packages/web/src/routes/SettingsPage.tsx
  • packages/workflows/src/dag-executor.test.ts
  • packages/workflows/src/dag-executor.ts
  • packages/workflows/src/deps.ts
  • packages/workflows/src/executor-preamble.test.ts
  • packages/workflows/src/executor.test.ts
  • packages/workflows/src/executor.ts
  • packages/workflows/src/loader.ts
  • packages/workflows/src/model-validation.test.ts
  • packages/workflows/src/model-validation.ts
  • packages/workflows/src/schemas/dag-node.ts
  • packages/workflows/src/schemas/workflow.ts
  • packages/workflows/src/script-node-deps.test.ts
  • packages/workflows/src/validator.test.ts
  • packages/workflows/src/validator.ts

📝 Walkthrough

Walkthrough

This PR adds comprehensive support for Qwen Code SDK as a third AI assistant alongside Claude and Codex. Changes span configuration, CLI setup, client implementation, workflow execution, API schemas, web UI, and documentation.

Changes

Cohort / File(s) Summary
Documentation
CLAUDE.md, README.md, docs/qwen-setup.md
New setup guide and updated architecture docs to document Qwen support, configuration location, supported models, authentication flows, limitations, and troubleshooting.
CLI Setup Wizard
packages/cli/src/commands/setup.ts, setup.test.ts
Extended setup wizard to include Qwen option, added Qwen detection via env markers, updated interface types, enhanced default-assistant selection logic, and modified config merge behavior for "add" mode.
Configuration Types & Loader
packages/core/src/config/config-types.ts, config-loader.ts, config-loader.test.ts
Introduced AssistantType union type, new QwenAssistantDefaults interface, extended config templates/defaults/merging to include Qwen assistant settings, and environment override handling for DEFAULT_AI_ASSISTANT.
Qwen Client Implementation
packages/core/src/clients/qwen.ts, qwen.test.ts, factory.ts, factory.test.ts, index.ts, packages/core/src/index.ts
New QwenClient class with SDK integration, query streaming, error classification/retry logic, and resume support; factory updated to recognize and instantiate Qwen clients.
Core Infrastructure
packages/core/package.json, packages/core/src/utils/env-allowlist.ts, env-allowlist.test.ts, packages/core/src/orchestrator/orchestrator.test.ts, packages/core/src/services/title-generator.ts
Added @qwen-code/sdk dependency, extended environment allowlist for OpenAI/Qwen credentials, updated test mocks and service JSDoc.
Repository & Conversation Layer
packages/core/src/db/conversations.ts, packages/core/src/handlers/clone.ts, clone.test.ts
Added Qwen to assistant-type validation, implemented .qwen marker detection for auto-selecting Qwen as default assistant.
Server API & Schemas
packages/server/src/routes/api.ts, schemas/config.schemas.ts
Extended config update handler and Zod schemas to accept/persist Qwen assistant configuration with model selection.
Web UI - Workflow Builder
packages/web/src/components/workflows/BuilderToolbar.tsx, NodeInspector.tsx, WorkflowBuilder.tsx
Added Qwen to provider dropdowns and state types in workflow builder components.
Web UI - Settings & Generated Types
packages/web/src/routes/SettingsPage.tsx, packages/web/src/lib/api.generated.d.ts
Added Qwen model input field to settings page, updated generated TypeScript schemas to include Qwen provider type and configuration objects.
Workflow Model Validation
packages/workflows/src/model-validation.ts, model-validation.test.ts
Introduced AssistantProvider type, added isQwenModel() and inferProviderFromModel() functions to recognize Qwen model patterns, updated isModelCompatible() to validate Qwen compatibility.
Workflow Execution Engine
packages/workflows/src/dag-executor.ts, dag-executor.test.ts, executor.ts, executor.test.ts, loader.ts, executor-preamble.test.ts
Generalized provider typing to AssistantProvider, replaced hardcoded Claude checks with inferProviderFromModel(), added Qwen-specific options construction including MCP config loading and tool handling, updated test fixtures.
Workflow Schemas & Validation
packages/workflows/src/schemas/dag-node.ts, workflow.ts, validator.ts, validator.test.ts, deps.ts, script-node-deps.test.ts
Centralized provider enum via ASSISTANT_PROVIDER_VALUES, added Qwen support to DAG node and workflow schemas, extended validator to emit Qwen-specific warnings for unsupported fields (MCP, skills), updated workflow config interface.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Poem

🐰 A new assistant hops into the fold,
Qwen joins Claude and Codex, bold and bright,
Configuration, workflows, and UI take hold,
Model inference dances left and right,
One system, three minds—a powerful sight!

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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