|
| 1 | +# Qwen Code — External Agent Research |
| 2 | + |
| 3 | +## Verdict: Compatible |
| 4 | + |
| 5 | +Qwen Code exposes command hooks in `.qwen/settings.json` and stores project-scoped JSONL sessions under the Qwen runtime directory. The first integration uses Qwen hooks as the lifecycle source of truth and writes an Entire-owned sidecar transcript under a repo-scoped OS temp directory so Entire can read stable session data even if Qwen's native transcript evolves. |
| 6 | + |
| 7 | +## Static Checks |
| 8 | + |
| 9 | +| Check | Result | Notes | |
| 10 | +|-------|--------|-------| |
| 11 | +| Binary present | Optional | `qwen` on `PATH`; protocol commands still run without it | |
| 12 | +| Help available | PASS | Qwen Code documents `qwen -p`, `--continue`, and `--resume` | |
| 13 | +| Hooks available | PASS | `SessionStart`, `UserPromptSubmit`, `Stop`, `StopFailure`, `SessionEnd`, `PreCompact`, `PostToolUse`, `PostToolUseFailure` | |
| 14 | +| Config directory | PASS | Workspace `.qwen/settings.json` | |
| 15 | +| Session storage | PASS | Native JSONL under Qwen runtime; Entire sidecar in `/tmp/entire-qwen/<repo-hash>/` plus `.entire/tmp/<session_id>.json` marker | |
| 16 | + |
| 17 | +## Protocol Mapping |
| 18 | + |
| 19 | +| Protocol | Qwen Concept | Implementation | |
| 20 | +|----------|--------------|----------------| |
| 21 | +| `info` | Static metadata | Name `qwen`, type `Qwen Code`, preview | |
| 22 | +| `detect` | CLI availability | Checks `qwen` on `PATH` | |
| 23 | +| `get-session-id` | Hook `session_id` | Returns input session ID or stub | |
| 24 | +| `get-session-dir` | Entire sidecar dir | Repo-scoped OS temp directory outside `.entire/tmp` | |
| 25 | +| `resolve-session-file` | Entire sidecar file | `<session_id>.jsonl` | |
| 26 | +| `read-session` | Sidecar JSONL | Returns native bytes and computed modified files | |
| 27 | +| `write-session` | Sidecar JSONL | Writes `native_data` to `session_ref` | |
| 28 | +| `read-transcript` | Sidecar JSONL | Reads bytes directly | |
| 29 | +| `chunk-transcript` | Raw bytes | Fixed-size byte chunks | |
| 30 | +| `reassemble-transcript` | Raw bytes | Concatenates chunks | |
| 31 | +| `format-resume-command` | Qwen resume | `qwen --resume <session_id>` | |
| 32 | +| `parse-hook` | Qwen hooks | Maps lifecycle hooks to Entire event objects | |
| 33 | +| `install-hooks` | `.qwen/settings.json` | Read-modify-write command hooks | |
| 34 | +| `are-hooks-installed` | `.qwen/settings.json` | Requires all Entire Qwen hooks | |
| 35 | +| `uninstall-hooks` | `.qwen/settings.json` | Removes only Entire hook entries | |
| 36 | +| `extract-modified-files` | Tool inputs | Reads path fields and simple shell write patterns | |
| 37 | +| `extract-prompts` | `UserPromptSubmit` | Reads sidecar prompt records | |
| 38 | +| `extract-summary` | `Stop`/failure | Reads final assistant/error message | |
| 39 | +| `compact-transcript` | Sidecar JSONL | Emits base64 Entire Transcript Format JSONL | |
| 40 | + |
| 41 | +## Lifecycle Mapping |
| 42 | + |
| 43 | +| Qwen Hook | Entire Hook Verb | Entire Event | |
| 44 | +|-----------|------------------|--------------| |
| 45 | +| `SessionStart` | `session-start` | `SessionStart` | |
| 46 | +| `UserPromptSubmit` | `user-prompt-submit` | `TurnStart` | |
| 47 | +| `Stop` | `stop` | `TurnEnd` | |
| 48 | +| `StopFailure` | `stop-failure` | `TurnEnd` with error metadata | |
| 49 | +| `SessionEnd` | `session-end` | `SessionEnd` | |
| 50 | +| `PreCompact` | `pre-compact` | `Compaction` | |
| 51 | +| `PostToolUse` | `post-tool-use` | sidecar metadata only | |
| 52 | +| `PostToolUseFailure` | `post-tool-use-failure` | sidecar metadata only | |
| 53 | + |
| 54 | +## Test Notes |
| 55 | + |
| 56 | +Default CI does not require Qwen credentials. Real lifecycle testing is gated with `QWEN_E2E=1 E2E_AGENT=qwen`. |
0 commit comments