run_qwen
Execute tasks with Qwen CLI via OpenAI-compatible endpoint, including document writing and image analysis. Supports auto file edits, session resumption, and automatic retries on rate limits.
Instructions
Async call Qwen CLI (qwen --auth-type openai, Qwen Code) to run a task. For writing/iterating docs & PPT (complements opencode) and image analysis (complements vision_analyze). Uses the qwen 端点 OpenAI-compatible endpoint via QWEN_ENV. --approval-mode auto-edit lets write_file land to disk (auto). Non-blocking. Auto-tracks task. Pass session_id to resume a prior Qwen session (preserves context — qwen has real resume via --resume, unlike opencode); the new session id is captured from JSON output and returned for later resumption. Retries automatically on 429/rate-limit/timeout with exponential backoff (default 2 retries, 3 total attempts); set max_retries=0 to disable.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| auto | No | qwen honors auto via --approval-mode auto-edit (write_file lands to disk). Default true. | |
| model | No | ||
| prompt | Yes | ||
| task_id | No | ||
| workdir | No | ||
| plan_mode | No | Plan 模式:只读调研,强制关 auto,产出方案不落盘 | |
| session_id | No | ||
| max_retries | No | ||
| timeout_sec | No | ||
| fork_on_fail | No | A 失败自动 fork:真失败时父 superseded + 生成备选子任务给此 agent 承接(仅工作流任务,≤3 上限)。不传不自动 fork。 | |
| retry_max_ms | No | ||
| capture_trace | No | 捕获完整推理 step 流存 task.trace,默认 false | |
| retry_base_ms | No |