Skip to content

feat: Qwen Code runner support#396

Open
lukeinglis wants to merge 2 commits into
mainfrom
qwen-runner-support
Open

feat: Qwen Code runner support#396
lukeinglis wants to merge 2 commits into
mainfrom
qwen-runner-support

Conversation

@lukeinglis
Copy link
Copy Markdown
Collaborator

Summary

Closes #394

  • Add factory/runners/qwen.py implementing the Runner protocol
  • Uses --append-system-prompt + -p pattern (same as ClaudeRunner)
  • Auth via DASHSCOPE_API_KEY or QWEN_API_KEY (warns if missing)
  • Dry-run mode via FACTORY_QWEN_DRY_RUN=1
  • Register "qwen" in RunnerName and _RUNNERS registry
  • Update CLAUDE.md with Qwen runner docs and config profile example
  • 22 tests in tests/test_qwen_runner.py

Usage

factory ceo /path --runner qwen
factory agent researcher --task "..." --runner qwen
FACTORY_RUNNER=qwen factory ceo /path

Config profile:

[credentials.qwen]
FACTORY_RUNNER = "qwen"
DASHSCOPE_API_KEY = "sk-..."

Test plan

  • uv run pytest tests/test_qwen_runner.py -v passes (22 tests)
  • factory ceo /path --runner qwen resolves to QwenRunner
  • Dry-run mode returns stub without spending tokens
  • Auth warning fires once when keys are missing

🤖 Generated with Claude Code

Add QwenRunner as a fourth CLI backend alongside Claude Code, Bob Shell,
and Codex. Qwen Code's CLI flags mirror Claude Code (--append-system-prompt,
-p, --model), making it the simplest runner addition.

Key details:
- Auth: warns if DASHSCOPE_API_KEY/QWEN_API_KEY missing (non-blocking)
- Headless: uses --yolo and --output-format text
- Dry-run: FACTORY_QWEN_DRY_RUN=1 returns stub responses
- Env: strips VIRTUAL_ENV from subprocess environment
- 22 tests covering command construction, auth, dry-run, env, and errors

Signed-off-by: Luke Inglis <lukeinglis21@yahoo.com>
Signed-off-by: Luke Inglis <lukeinglis21@yahoo.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 27, 2026

Codecov Report

❌ Patch coverage is 93.42105% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.35%. Comparing base (8097461) to head (54e7300).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
factory/runners/qwen.py 93.24% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #396      +/-   ##
==========================================
+ Coverage   87.31%   87.35%   +0.04%     
==========================================
  Files          61       62       +1     
  Lines        9339     9414      +75     
==========================================
+ Hits         8154     8224      +70     
- Misses       1185     1190       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

feat: Qwen Code runner support

1 participant