feat: add concurrent runner for batch CLI execution

Add a Python-based concurrent runner that executes multiple Qwen CLI tasks
across different models in parallel using isolated git worktrees.

Features:
- Execute N tasks × M models concurrently with configurable concurrency
- Create isolated git worktrees for each run under ~/.qwen/worktrees
- Real-time progress display with Rich library
- Capture stdout, stderr, and OpenAI API logs per run
- Atomic JSON tracking of all runs with status and metadata
- Automatic cleanup of worktrees after each run

Structure:
- runner.py: Main implementation with asyncio
- requirements.txt: Python dependencies
- README.md: Documentation and usage
- config.example.json: Configuration template
- examples/: Toy example with sample config and project

Usage:
  python runner.py config.json

Each run creates an isolated output directory:
  outputs/{run_id}/
    ├── stdout.txt
    ├── stderr.txt
    └── logs/openai-*.json

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
tanzhenxin 2026-01-28 12:08:56 +08:00
parent dd97337914
commit 4ac3df1b63
6 changed files with 902 additions and 0 deletions

View file

@ -0,0 +1,26 @@
{
"concurrency": 2,
"yolo": true,
"source_repo": "/Users/andy/workspace/projects/qwen-code/integration-tests/concurrent-runner/examples/toy-project",
"worktree_base": "~/.qwen/worktrees",
"outputs_dir": "./examples/outputs",
"results_file": "./examples/results.json",
"tasks": [
{
"id": "task-1",
"name": "Rabbit Counting",
"prompts": [
"Suppose we have 3 rabbits and 4 carrots. How many animals are there?"
]
},
{
"id": "task-2",
"name": "AGI Prediction",
"prompts": [
"Use shell tool to get current date",
"Predict how many dates left until we have AGI (artificial general intelligence)"
]
}
],
"models": ["qwen3-coder-plus", "kimi-k2.5"]
}