Skip to content

Add Qwen CLI driver - #114

Open
simone-stacks wants to merge 20 commits into
protocol-security:masterfrom
simone-stacks:feat/qwen-cli-driver
Open

Add Qwen CLI driver#114
simone-stacks wants to merge 20 commits into
protocol-security:masterfrom
simone-stacks:feat/qwen-cli-driver

Conversation

@simone-stacks

Copy link
Copy Markdown
Contributor

Builds on top of #113 (kimi driver); the diff shrinks to the qwen commits once that merges.

Summary

  • Add a qwen-cli driver so swarms can run Qwen Code CLI alongside the existing drivers.
  • Install Qwen Code CLI in the agent image from the official standalone archive, with a qwen_cli_version pin.
  • Wire the driver through launch, dashboard, docs, and tests.
  • Detect token-plan quota exhaustion even when the CLI exits 0, so agents back off and resume instead of dying mid-run.
  • Sum kimi token usage from the session wire.jsonl, so the swarmfile pricing map 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 expose qwen_cli_version; forward QWEN_CONTEXT_WINDOW into agent containers.
  • dashboard.sh, USAGE.md, README.md, CHANGELOG.md: surface the new driver.
  • lib/drivers/kimi-cli.sh: read token usage from the session wire.jsonl (stream-json carries no usage object).
  • tests/: driver/config/dashboard/harness/launch coverage and qwen fixture swarmfiles.

Self-review checklist

  • This PR addresses a single concern (why?). If it covers multiple independent changes, I've split them into separate PRs.
  • The new driver is covered by unit tests.
  • The quota detection and wire-usage paths are covered by unit tests.
  • shellcheck -s bash passes on all modified .sh files.
  • New lines match the surrounding style (these files already have pre-existing >79-col lines).

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.sh
  • tests/test_drivers.sh (557 passed)
  • tests/test_config.sh (375 passed)
  • ./tests/test.sh --unit (note: test_harvest.sh has pre-existing failures on this machine — signing env, green in CI)
  • Live runs on stacks-swarm (9-agent validation + 4-agent engagement on qwen3.8-max): real token counts in the dashboard, quota backoff triggered instead of agent death, one triaged finding produced.

@simone-stacks
simone-stacks force-pushed the feat/qwen-cli-driver branch 2 times, most recently from 983e53d to 9235c22 Compare August 18, 2026 16:31
@simone-stacks
simone-stacks marked this pull request as draft August 24, 2026 10:48
@simone-stacks
simone-stacks marked this pull request as ready for review September 1, 2026 16:14
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.

2 participants