Skip to content

install: Qwen Code hooks + MCP connector - #25

Open
davidcrowe wants to merge 2 commits into
mainfrom
qwen-code
Open

install: Qwen Code hooks + MCP connector#25
davidcrowe wants to merge 2 commits into
mainfrom
qwen-code

Conversation

@davidcrowe

Copy link
Copy Markdown
Contributor

Adds Qwen Code (QwenLM/qwen-code, ~27.6k stars, ~85k npm downloads/week) as a hooked client.

  • Detects ~/.qwen or qwen on PATH.
  • Merges PreToolUse / PostToolUse entries into ~/.qwen/settings.json calling the shared govern.mjs with ACP_CLIENT=qwen-code. Qwen's hook contract is Claude Code's (same stdin fields, hookSpecificOutput.permissionDecision, exit 2 blocks); two deltas handled: timeout is milliseconds (5000), matcher * = every tool.
  • Registers the ACP MCP connector under mcpServers in the same file; warns if disableAllHooks is set.
  • Target list, client slug, nothing-detected gate, restart hint, README.

Verified 2026-09-03 with the same settings shape inside a fresh Linux container (Harbor, Qwen Code 0.23.0): hook fired on the first tool call, session recorded under client qwen-code in the runs API. Pages: agenticcontrolplane.com PR #133.

@davidcrowe

Copy link
Copy Markdown
Contributor Author

⚠️ Do not merge this as-is — it would regress the Codex one-line install.

This branch is cut from a pre-09-03 base, so beyond the Qwen additions its diff against current main also:

  • deletes the codex-acp launcher and the [model_providers.acp] block
  • deletes the shared acp-session-summary and moves the PATH block back inside the Claude Code branch
  • reverts POSIX > /dev/null 2>&1 to the bashism &> /dev/null in 16 places

The red install.sh sync check is therefore correct twice over: canonical lives in the marketing repo, and this copy is behind it.

The six genuinely-Qwen hunks have been re-applied on top of current canonical in davidcrowe/agenticcontrolplane.com#145 (+75/−1, dash -n clean, merge logic tested for idempotency and for preserving a user's existing hooks and MCP servers).

Suggested order: merge and deploy #145 → resync this mirror from canonical → close this PR rather than merging it, since its content is by then either landed or a regression.

@davidcrowe

Copy link
Copy Markdown
Contributor Author

Correction to the comment above. It said merging this PR would revert the codex-acp work. That was wrong — it was read off git diff origin/main <pr-head>, which compares two heads on different bases, not what a merge produces. A trial 3-way merge (git merge-tree --write-tree origin/main <pr-head>) is clean and keeps codex-acp, [model_providers.acp] and acp-session-summary intact.

What is actually true about this PR:

  • The red install.sh sync check is correct: canonical install.sh lives in the marketing repo and does not carry the Qwen block yet. The mirror has to follow canonical, not lead it.
  • The new Qwen detection line uses &> /dev/null, a bashism the POSIX pass on main already purged everywhere else — it would be the one &> left in the file.

The Qwen hunks are re-applied on current canonical in davidcrowe/agenticcontrolplane.com#145 (POSIX-clean). Suggested order is unchanged: merge + deploy #145 → resync this mirror from canonical → close this PR, since by then its content is landed.

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.

1 participant