feat: add Qwen Code support via OpenRouter authentication#742
feat: add Qwen Code support via OpenRouter authentication#742Joseph19820124 wants to merge 1 commit intoopenabdev:mainfrom
Conversation
15e9718 to
3fdb6ec
Compare
✅ E2E Test Results — EKS ClusterTested on Test Environment
Results
ACP Initialize Response (verified){
"agentInfo": {"name": "qwen-code", "title": "Qwen Code", "version": "0.15.6"},
"agentCapabilities": {
"loadSession": true,
"promptCapabilities": {"image": true, "audio": true, "embeddedContext": true},
"mcpCapabilities": {"sse": true, "http": true}
}
}NoteThe |
This comment has been minimized.
This comment has been minimized.
3fdb6ec to
3cbd550
Compare
🟡 NIT fixes appliedAddressed the review feedback:
|
This comment has been minimized.
This comment has been minimized.
OpenAB PR ScreeningThis is auto-generated by the OpenAB project-screening flow for context collection and reviewer handoff.
Screening report## IntentPR #742 is trying to add Qwen Code as a supported OpenAB agent backend by running The user-visible problem is that OpenAB users currently cannot choose Qwen Code as an ACP-compatible backend in the same way they can use existing agents. The operator-visible problem is that previous Qwen integration paths became unattractive or stale because Qwen OAuth was discontinued, Alibaba Cloud subscription pricing changed, and older PRs predated the FeatThis is a feature PR. It adds Qwen Code backend support through:
Behaviorally, OpenAB operators should be able to configure a Qwen Code agent container, provide Who It ServesPrimary beneficiaries:
Rewritten PromptImplement Qwen Code backend support for OpenAB using OpenRouter authentication. Add a pinned Update example config, Helm values, Helm notes, README backend tables, and dedicated docs so operators can enable a Qwen agent with Keep the implementation consistent with existing OpenAB multi-agent patterns. Validate with Helm linting, Helm rendering, existing Helm unit tests, and a documented manual smoke-test path for launching Qwen via ACP. Merge PitchThis is worth advancing because it adds a plausible low-friction Qwen path after the older OAuth/subscription approaches stopped being practical. OpenRouter keeps the integration accessible without requiring Alibaba Cloud account setup, and the PR appears scoped mostly to packaging, configuration, and documentation. Risk profile is moderate-low if the implementation follows existing backend patterns. The main reviewer concern should be whether Qwen Code actually works reliably as an ACP backend in OpenAB, not just whether the Helm and Docker assets render. The missing E2E validation with a real OpenRouter key is the largest gap. Best-Practice ComparisonOpenClaw comparison: Relevant principles:
Less relevant principles:
Hermes Agent comparison: Relevant principles:
Less relevant principles:
Overall, the PR aligns most closely with the “isolated execution plus explicit provider configuration” side of these references. It should not be reviewed as a scheduler or durable job system change. Implementation OptionsOption 1: Conservative packaging-only merge Accept the Dockerfile, docs, README, example config, and Helm comments, but keep Qwen disabled by default. Require clear manual smoke-test instructions and mark E2E cluster validation as follow-up. Option 2: Balanced backend support with validation Merge the packaging/config/docs changes, add or require a lightweight ACP smoke test script or documented local command, and verify that the Qwen container starts, reads Option 3: Ambitious first-class backend integration Add Qwen as a fully tested first-class backend with CI coverage for Docker build, Helm rendering, config validation, generated Comparison Table
RecommendationRecommend the balanced path. Advance PR #742 if it stays consistent with existing backend patterns and adds one concrete validation layer beyond Helm rendering, ideally a local ACP/container smoke-test path that proves Qwen Code starts correctly with OpenRouter settings. The current scope is useful and mergeable, but the missing E2E test means reviewers should ask for either real runtime evidence or a clearly documented follow-up before treating Qwen as fully supported. Suggested sequencing: merge packaging/config/docs after smoke validation, then split deeper CI or EKS validation into a follow-up issue. |
This comment has been minimized.
This comment has been minimized.
3cbd550 to
900df86
Compare
Addressed reviewer NITAdded - { dockerfile: Dockerfile.qwen, suffix: "-qwen", agent: "qwen", agent_args: "--acp" }This ensures CI parity with all other agent Dockerfiles — the smoke test will:
|
This comment has been minimized.
This comment has been minimized.
chaodu-agent
left a comment
There was a problem hiding this comment.
LGTM. I verified the PR against main and the current Helm templates: the Qwen Dockerfile/docs/config follow the existing agent pattern, CI is green including the added Dockerfile.qwen smoke-test matrix entry, and secretEnv is supported by the chart via deployment.yaml plus configmap.yaml inherit_env wiring. No blocking findings from my pass.
This comment has been minimized.
This comment has been minimized.
900df86 to
f580b37
Compare
Addressed review NITs (v3)Thanks for the thorough review 🙏 NIT 1 — NIT 2 — NOTES.txt inline JSON readability ✅ Fixed. NIT 3 — README backends table ordering ✅ Fixed. |
v4 — Addressed self-review nitsThanks to 超渡法師's thorough reviews and the screening report. After re-reading the full diff as a fresh user, I found four more nits that weren't covered in previous rounds: 1.
|
chaodu-agent
left a comment
There was a problem hiding this comment.
LGTM. I independently re-checked this against main and the current Qwen Code/OpenRouter docs/source.
Verified:
Dockerfile.qwenmirrors the existingDockerfile.geminiruntime pattern, with only Qwen-specific package install and.qwendirectory setup added.- Qwen Code v0.15.6 defines the
qwenbin and supports--acp;--yolois the correct headless auto-approval flag, and the previous invalid--trust-all-toolsissue is fixed. - The OpenRouter auth shape is consistent with Qwen Code model provider config:
modelProviders.openai,baseUrl=https://openrouter.ai/api/v1, andenvKey=OPENROUTER_API_KEY. - Helm
secretEnvis supported by the chart in both Deployment env injection and ConfigMapinherit_envwiring. - The initContainer + writable
.qwenvolume pattern is correct because a direct read-only ConfigMap mount would not work well for runtime state. - CI is green, including the added
Dockerfile.qwensmoke-test matrix entry and Helm unit tests.
Non-blocking nits only:
mkdir -p /home/node/.qwen && chownis unnecessary for the Helm path, but harmless and useful for local Docker usage.extra_volumes_test.yamlis a generic chart extensibility test rather than strictly Qwen-specific; acceptable as general Helm coverage.
No blocking findings from my pass.
|
PR has been APPROVED by @chaodu-agent (review The two non-blocking nits from the approval review:
No outstanding changes requested. The Ready for merge. 🙏 |
v6 — docs: add secret rotation / rollout restart noteAdded one missing operational note to
This is a common K8s operational gotcha — env vars from Secrets are not hot-reloaded. Users who rotate their OpenRouter API key would otherwise be confused why the old key is still being used until they figure out a pod restart is needed. |
ad876ce to
055b9b0
Compare
|
Addressed the two non-blocking nits from the approval review:
All 89 Helm unit tests still pass. |
Why Qwen Code CLI when OpenCode already supports OpenRouter?Good question from @pahud. Here is the differentiation: Qwen Code CLI has Qwen-specific optimizations that OpenCode lacks
The same argument applies to Gemini CLIBy the same logic, we could remove Gemini CLI support since OpenCode can also call Gemini models via OpenRouter. But we keep Qwen Code CLI is the same pattern — it is the official Qwen agent runtime with model-specific optimizations, not just a generic API wrapper. Maintenance cost is minimal
SummaryOpenCode + OR gives you "Qwen model via generic client." Qwen Code CLI gives you "Qwen-optimized agent with SubAgents, Skills, Memory, Hooks, and Channels." Same model, different agent capabilities — just like Gemini CLI vs OpenCode+Gemini. |
🟢 Four-Monk Collaborative Review — LGTMVerdict: Approve-ready. Clean addition of Qwen Code as an ACP backend via OpenRouter. All previous blocking findings resolved. Four-Question Framework1. What problem does this solve?Adds Qwen Code (Qwen3) as a supported ACP-compatible agent backend using OpenRouter for authentication. Previous attempts (#56, #149) failed due to Qwen OAuth discontinuation and the repo rename. OpenRouter provides pay-per-token access without subscription lock-in. 2. How does it solve it?Follows the established multi-agent pattern exactly:
Auth flow: 3. What was considered?
4. Is this the best approach?Yes. The PR:
Traffic Light🟢 INFO — Dockerfile follows Gemini pattern precisely, with the addition of 🟢 INFO — Helm unit tests added ( 🟢 INFO — All 11 CI checks pass including the new 🟡 NIT — The 🟡 NIT — The pod_extensibility_test.yaml uses Baseline CheckVerified on
Previous review cycle: 🔴 Four-monk consensus: 🟢 4/4 LGTM |
chaodu-agent
left a comment
There was a problem hiding this comment.
LGTM ✅ — Clean addition following established patterns. All CI green, previous findings addressed.
Simplify: use PVC instead of emptyDir + init containerGood catch. The chart already mounts a PVC at The entire Proposed simplificationOption A (recommended): Same pattern as Gemini/Claude/Codex — kubectl exec -it deployment/openab-qwen -- sh -c 'cat > ~/.qwen/settings.json << EOF
{
"modelProviders": {
"openai": [{
"id": "qwen/qwen3-coder",
"name": "Qwen3 Coder (OpenRouter)",
"baseUrl": "https://openrouter.ai/api/v1",
"envKey": "OPENROUTER_API_KEY"
}]
},
"security": {"auth": {"selectedType": "openai"}},
"model": {"name": "qwen/qwen3-coder"}
}
EOF'PVC persists it across pod restarts. Done. Option B: init container + ConfigMap (declarative, guarantees settings.json on every pod recreate). Keep as an "advanced" alternative for GitOps workflows. This matches existing agent patterns exactly
Should I update |
Add Qwen Code (Qwen3) as a supported ACP-compatible agent backend, using OpenRouter as the authentication provider instead of the discontinued Qwen OAuth free tier or the expensive Coding Plan subscription. - Add Dockerfile.qwen with @qwen-code/qwen-code@0.15.6 (pinned) - Add qwen agent config block to config.toml.example - Add docs/qwen.md with OpenRouter setup guide - Update README.md: backends table, description, features - Add Qwen auth instructions to Helm NOTES.txt - Add commented-out qwen agent example to values.yaml - Add Dockerfile.qwen to CI smoke-test matrix - Add Helm unit tests for extraInitContainers/extraVolumes/extraVolumeMounts Closes openabdev#55
055b9b0 to
b3acd4c
Compare
Simplified: PVC +
|
🟢 LGTM — Approve-readyClean, well-structured addition of Qwen Code as the 8th supported ACP backend. Follows the established multi-agent pattern exactly. Four-Question Review1. What problem does it solve?Adds Qwen Code (Qwen3) as a supported ACP-compatible agent backend using OpenRouter for authentication. Previous attempts (#56, #149) failed because Qwen OAuth free tier was discontinued and the Coding Plan subscription price increased. OpenRouter provides pay-per-token access without subscription lock-in. 2. How does it solve it?
3. What was considered?
4. Is this the best approach?Yes. The PR:
Traffic Light🟢 INFO — Dockerfile mirrors 🟢 INFO — Documentation is thorough: covers Docker, Helm, manual config, GitOps, security considerations, and alternative models 🟢 INFO — Pod extensibility tests ( 🟢 INFO — E2E tested on EKS cluster per contributor comment VerdictApprove. This PR has been through extensive review iterations (v1–v6), all blocking findings resolved, single squashed commit. No remaining concerns. |
chaodu-agent
left a comment
There was a problem hiding this comment.
LGTM. Clean addition of Qwen Code backend following established patterns. All previous blocking findings resolved, E2E tested on EKS, single squashed commit.
|
Per discussion, on hold for now. We need more upvotes to justify the requirement. |
✅ Four-Monk Review — All ClearAll four monks reviewed this PR independently. Unanimous LGTM. Verdict🟢 APPROVE — Clean addition of Qwen Code backend following the established multi-agent pattern. All previous nits addressed, CI green, E2E validated on EKS. Summary
Key Findings
Previous nits — all resolved
|
chaodu-agent
left a comment
There was a problem hiding this comment.
All four monks reviewed independently — unanimous LGTM. CI green, E2E validated, all previous nits addressed. Ready for maintainer merge.
What problem does this solve?
Adds Qwen Code (Qwen3) as a supported ACP-compatible agent backend, using OpenRouter as the authentication provider.
Closes #55
Why OpenRouter? The previous PRs (#56, #149) were closed because:
agent-broker→openabrenameOpenRouter provides pay-per-token access to Qwen models (including free tiers like
qwen/qwen3.6-plus:free) without requiring a subscription — making it accessible to all users.Discord Discussion URL: https://discord.com/channels/1491295327620169908/1491365158868619404
At a Glance
Prior Art & Industry Research
OpenClaw:
OpenClaw supports Qwen models via OpenRouter using the same OpenAI-compatible API pattern. See: https://lushbinary.com/blog/openclaw-qwen-3-6-setup-guide/
Hermes Agent:
Not applicable — Hermes Agent does not currently support Qwen Code as a backend.
Other references:
Proposed Solution
Follow the established multi-agent pattern on current
main:Dockerfile.qwen— Multi-stage build (Rust builder + Node.js runtime) with@qwen-code/qwen-code@0.15.6pinned, includes tini, procps, ripgrep, gh CLI, USER node, HEALTHCHECKconfig.toml.example— Commented-out Qwen agent block with OpenRouter env vardocs/qwen.md— Full guide: Docker, Helm, manual config, OpenRouter settings.json template, alternative modelsREADME.md— Qwen Code added to description, features, backends tableAuthentication flow: Qwen Code reads
~/.qwen/settings.jsonwhich points to OpenRouter's OpenAI-compatible endpoint. TheOPENROUTER_API_KEYenv var is injected via K8s Secret (secretEnv) or Helm values.Why this approach?
~/.qwen/settings.jsonfor provider config (baseUrl, model ID); env var alone is insufficient@qwen-code/qwen-code@0.15.6for reproducible buildsAlternatives Considered
Validation
helm lint charts/openabpasseshelm templaterenders correctly with--set agents.qwen.*confighelm unittest charts/openab/)