Repository navigation
Add Qwen CLI driver - #114
simone-stacks wants to merge 20 commits into
Conversation
983e53d to
9235c22
Compare
9235c22 to
24b3ae8
Compare
radubahmata
left a comment
There was a problem hiding this comment.
Great work and thanks for the PR! Left some comments.
| if [ -n "${DASHSCOPE_API_KEY:-}" ]; then | ||
| _qwen_write_settings "$model" | ||
| args+=(-m "${model##*/}") | ||
| else |
There was a problem hiding this comment.
Keeping _qwen_write_settings behind the DASHSCOPE_API_KEY check appears intentional. API-key mode has no mounted Qwen configuration, so the driver must synthesize the provider, endpoint, authentication, and model settings. OAuth mode already has host configuration, and running the full writer there would overwrite its provider and login selection.
The effort override should not share that gate. agent_docker_env exports the swarmfile's effort as QWEN_REASONING_EFFORT for every authentication mode, but Qwen Code CLI does not consume that environment variable. Its supported model.reasoningEffort setting applies across all providers. Qwen also treats QWEN_OAUTH as a DashScope provider and preserves the global effort through initial authentication.
For auth: "oauth", agent_settings copies the host settings unchanged, so an agent configured with an effort such as high silently continues using the host or CLI default even though the dashboard shows high. Do not run the API-key settings writer for OAuth. Instead, when the swarmfile sets effort, merge only model.reasoningEffort into the writable OAuth settings copy while preserving every host provider and login field.
Can you please add an OAuth-path regression test that starts with host settings, applies the requested effort, and asserts the existing configuration is unchanged?
| - Qwen Code CLI: `low`, `medium`, `high`, `xhigh`, `max` (written to | ||
| `model.reasoningEffort`; on DashScope-backed qwen models any set tier | ||
| currently collapses to `enable_thinking: true`). |
There was a problem hiding this comment.
Here, it says every effort tier on DashScope-backed Qwen models collapses to enable_thinking: true. Qwen Code CLI explicitly special-cases qwen3.8-max, the driver's default model, and passes all five tiers through as reasoning_effort. Other Qwen models may use the boolean enable_thinking mapping.
Document the qwen3.8-max pass-through behavior separately from the fallback behavior used by other Qwen models. Update the matching comment at https://github.com/simone-stacks/claude-swarm/blob/24b3ae8ad55c59ebd39e50e0693d478dc42f0ee1/lib/drivers/qwen-cli.sh#L318-L323 at the same time.
Builds on top of #113 (kimi driver); the diff shrinks to the qwen commits once that merges.
Summary
qwen-clidriver so swarms can run Qwen Code CLI alongside the existing drivers.qwen_cli_versionpin.wire.jsonl, so the swarmfilepricingmap produces real costs for kimi (small fix riding on this branch).Changes
lib/drivers/qwen-cli.sh: new driver implementing the swarm interface.Dockerfile+launch.sh: install Qwen Code CLI and exposeqwen_cli_version; forwardQWEN_CONTEXT_WINDOWinto agent containers.dashboard.sh,USAGE.md,README.md,CHANGELOG.md: surface the new driver.lib/drivers/kimi-cli.sh: read token usage from the sessionwire.jsonl(stream-json carries no usage object).tests/: driver/config/dashboard/harness/launch coverage and qwen fixture swarmfiles.Self-review checklist
shellcheck -s bashpasses on all modified.shfiles.Test plan
shellcheck -s bash lib/drivers/qwen-cli.sh lib/drivers/kimi-cli.sh dashboard.sh launch.sh tests/test_config.sh tests/test_dashboard.sh tests/test_drivers.sh tests/test_harness.sh tests/test_launch.shtests/test_drivers.sh(557 passed)tests/test_config.sh(375 passed)./tests/test.sh --unit(note:test_harvest.shhas pre-existing failures on this machine — signing env, green in CI)qwen3.8-max): real token counts in the dashboard, quota backoff triggered instead of agent death, one triaged finding produced.