# Qwen Code 0.26.1 ACP receipt (#843 AC5)

Date: 2026-10-26. Refs #843. Installed npm release `@qwen-code/qwen-code` 0.26.1. This repeats the Qwen legs of [the 0.26.0 receipt](2026-10-22-kimi-qwen-compat.md) — native ACP identity, mode ids, permission callbacks, all without a model — on 0.26.1, and says whether the two ACP fixes in the 0.26.1 release notes change the hub contract. Every leg passed, so 0.26.1 is added to the `qwen` entry's `verified` in `src/adapters/compat.ts` in the same change.

## Installed artifact

Package root `~/.local/share/fnm/node-versions/v24.18.1/installation/lib/node_modules/@qwen-code/qwen-code`. npm `dist.integrity` `sha512-4kpIzrlrgmawivim0yCZjr1AP5cfHTanyL7eL1g2R8WYU6QDBq7j9fiAye7REXL4EEXkRIq45D7+ngTw5n3GqQ==`, `gitHead` `b475278c4a300acebe6cfc990a9e1b1d18819bfc`. SHA-256 of `cli-entry.js` `113efe4104a9fc66f507d34bfd6abbd896ceb77de47f4b468a0825a327fdc6a5`; SHA-256 of `chunks/acpAgent-6HTF6TM6.js` (the chunk holding the ACP agent and the permission emitters) `1171efba62467d7578a332a0c1bb1a313c336c69efd400d0b860252734a1cf14`.

## Isolation

- Every process ran under an isolated `HOME` and cwd (fresh directories under `/tmp/ahub-509-qwen-evidence`), with `--auth-type openai --model fixture-model --openai-base-url http://127.0.0.1:9/v1 --telemetry=false`, so nothing could reach a real account or provider. The real `~/.qwen` was never the home.
- A preload guard blocked every outbound connection attempt and counted them: the native run made 6 attempts (telemetry/update-check paths), all refused, 0 connected; the permission fixture made none.
- After each run the process group was verified gone (`groupGone` true after SIGTERM, `leaderExit` -15). No session transcript was written into the real home.

## Leg 1: native ACP identity and mode ids (idle, no model)

Spawned `qwen --acp` (the production adapter argv is `["qwen","--acp"]`; the probe added `--bare --advisor off` and the fixture auth args) with 0 prompts sent:

- `initialize`: `protocolVersion` 1, `agentInfo` `{ name: "qwen-code", title: "Qwen Code", version: "0.26.1" }` — the identity `qwenNativeIdentity` checks. `authMethods` offers the `openai` terminal method only. `capabilities`: `loadSession`, image and audio and embedded-context prompt content, session list and resume, MCP `sse` and `http`.
- `session/new` returned session `9c73767d-a12c-4a84-a330-8f49b94c3fd9`, `modes` advertising `default`, `plan`, `auto-edit`, `auto`, `yolo` with `currentModeId` `default`, and `configOptions` for mode and model (the fixture model only). The hub's `QWEN_MODE_IDS` (ask → `default`, ask-when-needed → `auto-edit`, never-ask → `yolo`; `auto` and `plan` stay unmapped) is a subset of what 0.26.1 advertises, unchanged from 0.26.0.
- The cycle `default` → `auto-edit` → `yolo` → `default` through `session/set_mode` succeeded (ids 3–6 each `result: {}`). Each switch now also arrives as an extra `qwen/notify/session/mode-update` notification (`{ v: 1, sessionId, currentModeId }`, 4 in all, one per switch). The hub ignores unknown notifications, so this changes nothing in the contract; the 0.26.0 receipt recorded the same accompaniment.

## Leg 2: permission callbacks (real installed code, no model)

The native permission path was exercised against the real installed chunk, not a reimplementation: a scratch copy of `chunks/acpAgent-6HTF6TM6.js` that only added exports (`SubAgentTracker`, `toPermissionOptions`, `resolvePermissionOutcome`, `ToolCallEmitter`) was written beside the chunk inside the package's `chunks/` directory (relative `./chunk-*.js` imports resolve only there), the real `SubAgentTracker.createApprovalHandler` was driven with synthetic client/tool/event ports, and the scratch copy was removed from the shared package afterwards (verified: none left).

- An MCP tool-call request produced a native `session/request_permission` with exactly the option set the hub's `answerPermission` selects from: `proceed_always_project` and `proceed_always_user` (`allow_always`), `proceed_once` named "Allow" (`allow_once`), `cancel` named "Reject" (`reject_once`).
- The Allow turn responded `proceed_once`; the cancellation turn responded `cancel`; both got the empty result the handler expects. An unoffered option was refused with `Permission response selected unoffered option: not-offered`. That error text changed from 0.26.0's `invalid option` wording; the hub only ever selects an option the request announced, so this is not a contract change.
- While a request was pending, the parent tool call received `tool_call_update` progress with "Waiting for permission: hub_task_show (agent-hub MCP Server)" — the same turn-pinned progress the hub surfaces.

## The two 0.26.1 ACP fixes

The 0.26.1 release notes list exactly two APR-tagged ACP fixes (checked against the GitHub release and the installed chunk):

- **#15279 — stop blanking replay App html that cannot reclaim bytes.** This is the MCP App replay HTML path (`blankReplayedMcpAppHtml`). The hub's Qwen adapter never uses replay App html, so this changes nothing for the hub contract.
- **#15346 — refuse an edit whose arguments were cut off or arrived incomplete.** The native `runTool` now refuses Edit-kind calls whose arguments hit `MAX_TOKENS` or arrived incomplete, before PreToolUse and before the permission request, with codes `output_truncated` / `invalid_tool_params` and `executionStatus: "not_started"` (both code strings verified present in the installed chunk). The hub already refuses to let a cut payload buy a session-wide grant (`answerPermission` marks any raw input over 600 chars `[cut, N chars]` and withholds the allow_always options on it; an explicit allow_once is still answered), so this strengthens the same protection from the native side, arriving to the hub as an ordinary tool failure. It does not change the contract.

Verdict: neither fix changes the hub contract, and no leg failed, so the bump is allowed.

## Not verified

- A permission turn reached by a real model call, a real login or account, and a real provider — as in every earlier Qwen receipt. Leg 2 drives the real handler through synthetic ports, which proves the callback shapes, not a model's behavior.
- Linux and Intel macOS builds. The 0.26.0→0.26.1 diff review was the release notes plus the two fix code paths in the installed chunk, not a full source diff.

## Decision

All legs passed, so `0.26.1` joins `verified` for `qwen`; the `qwen-dual` entry (a different contract, receipted at [2026-10-25-qwen-dual-output-t0.md](2026-10-25-qwen-dual-output-t0.md)) is unchanged. A failed leg would have meant no bump, as the task requires.

Host validation: gate `scripts/check.sh --changed` on the PR head — see the PR.

Evidence fingerprints (producers and result JSONs, SHA-256):

| Item | SHA-256 |
| --- | --- |
| `qwen-acp-probe.py` | `b6e98f172dad31d3d7dedbcbeaf52788f28326073d16c0bb34caa297b095f7eb` |
| `native-result.json` | `b361b27acda4b85636271491d37e1dcb83ddc363581f129298622c57e4431d06` |
| `permission-fixture.mjs` | `63566432a965172dfad46fd5453dd554eda24fbafc8bcfea2419ab7890cd65ff` |
| `permission-result.json` | `97c639a4fb887681e0554a613f4dd8c131ff242d9c3b77e25d28d9e558178493` |
| `build-scratch-copy.py` | `1c2e7221a734c63183a065e39dd5d9c01f0ba5c95b82a5be03a1e09af2c7e375` |
| scratch copy `ahub509-native-permission-exports.mjs` | `85102aec216e363c645295225bddcd881424c4b59b5639366abe083c3b577d9a` |
