Deep source analysis: Qwen Code, Goose, OpenCode documentation expansion#1
Conversation
wenshao
left a comment
There was a problem hiding this comment.
Code Review: Deep source analysis PR
总体评价
这是一个高质量的源码分析 PR,为 Qwen Code(4 篇新文档)、Goose(4 篇新文档)和 OpenCode(EVIDENCE.md 扩充)提供了深度的源码级文档。+1580/-53 行,14 个文件,工作量大且来源标注清晰。
✅ 值得肯定的
- Goose 文档非常出色:4 篇覆盖概述/命令/架构/扩展,crate 结构图、7 种传输类型、安全检查器管道、PermissionJudge 等细节此前文档库未覆盖
- Qwen Code 文档系统化:41 命令逐一列出含子命令、4 种 ContentGenerator 区分清晰、Arena 模式源码路径完整
- 源码路径标注:每个数据点都标注了源码文件路径,可审计
- features.md 更新:命令数、/review Skill、/vim 支持等交叉引用同步
⚠️ 需要讨论的问题
1. OpenCode 语言描述冲突(最关键)
PR 将 OpenCode 从 "Go + TypeScript" 改为 "TypeScript(Bun monorepo,SolidJS TUI)"。
但本仓库此前已通过 二进制分析 确认 OpenCode v1.2.15 是 Go + TypeScript 混合:
.opencode二进制为 152MB ELF x86-64(Go 编译产物)- 数据库层使用
go-sqlite3 + sqlc + goose(Go 库) internal/db/目录为 Go 源码- 03-architecture.md 第 215 行记录了 "Go→TypeScript 渐进重写"
建议:保持 "Go + TypeScript(混合 Monorepo)" 描述,或注明版本差异(可能 PR 作者分析的是更新版本?)。
2. Qwen Code 命令数:41 vs 40
我们此前验证为 40 命令(39 斜杠 + 1 Skill /review)。PR 中是 41。差异可能来自:
- 计数方式不同(是否包含 /review Skill)
- 或 v0.13.0 新增了一个命令
建议:明确列出 41 条命令的完整列表(PR 中的 02-commands.md 应已包含),便于交叉验证。
3. Goose EVIDENCE.md 未更新
PR 新增了 4 篇 Goose 文档(01-04),但原有的 docs/tools/goose/EVIDENCE.md 未同步更新。新文档中的源码发现(如 PermissionJudge、7 种传输类型)应补充到 EVIDENCE.md 作为永久证据记录。
4. 部分 deep-dive 文章可能需要同步
新文档中发现的数据(如 Goose 7 种传输类型 vs 我们 MCP deep-dive 中列出的 3 种、Qwen Code 41 命令 vs 功能缺口文档中的 40)可能与现有 deep-dive 文章有冲突。合并后需要做一次跨文件一致性检查。
📝 具体建议
- OpenCode 语言:建议
"Go + TypeScript(混合 Monorepo,Go 后端 + TS TUI)"而非纯 TypeScript - Goose README.md:新增的
docs/tools/goose/README.md应列出 EVIDENCE.md(现有文件) - Qwen Code 03-architecture.md:提到
GEMINI.md0 引用——与我们的二进制验证一致 ✅ - features.md Goose 命令数:
16(斜杠)+ 15(CLI)格式很好,比之前的16更准确
结论
推荐合并,但建议先修复 OpenCode 语言描述(与已有二进制验证冲突),其余问题可合并后修复。
审查基于:本仓库已有的二进制分析数据(Claude Code v2.1.84、Qwen Code v0.13.0 cli.js、OpenCode v1.2.15 ELF、Codex CLI Rust 二进制、Gemini CLI v0.34.0 npm)
Code Review: Deep source analysis PR总体评价高质量的源码分析 PR,为 Qwen Code(4 篇)、Goose(4 篇)和 OpenCode(EVIDENCE.md 扩充)提供深度源码级文档。+1580/-53 行,14 个文件,源码路径标注清晰。 ✅ 值得肯定
|
- Qwen Code: Add 4 new docs (01-overview, 02-commands, 03-architecture, 04-tools) covering 41 slash commands, 16 core tools, Arena mode, extension system, MCP integration, Hook/Skill/Subagent systems, full source file paths - Goose: Add 4 new docs (01-overview, 02-commands, 03-architecture, 04-extensions) covering 16 interactive + 15 CLI commands, MCP native architecture with 7 transport types, 11 Platform Extensions, 4 MCP builtin servers, security inspector pipeline, Recipe system, Electron desktop app - OpenCode: Deepen EVIDENCE.md from ~50 lines to ~280 lines with exact source paths for all 19+ tools, 23 TUI slash commands, 7 agents, 37 LSP servers, 3 auth plugins, models.dev integration, permission system - Update features.md: correct command counts (Qwen Code 41, Goose 16+15, OpenCode 23), add /review skill for Qwen Code, /vim support - Update tools/README.md: reflect new multi-file docs for Qwen Code (6 files) and Goose (5 files) - Update main README.md: navigation links to deep-dive docs Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
a2c47de to
9f2a95e
Compare
Re-review: OpenCode 语言问题已验证 ✅刚刚升级到 OpenCode v1.3.3 并重新分析二进制: 结论:PR 作者是对的。 OpenCode 的 ELF 二进制是 Bun 编译的 TypeScript,不是 Go。之前我们在 v1.2.15 的分析结论有误——误将 Bun ELF 当成了 Go ELF(两者 数据库也是 Drizzle ORM(276 引用),不是之前说的 go-sqlite3 + sqlc。 之前 review 的 3 个问题更新:
建议:直接合并。 OpenCode 语言问题是我们需要修正的,不是 PR 的问题。 |
- Fix license name: "Sisyphus Use License" → "Sustainable Use License" (SUL = Sustainable, not Sisyphus — fact error survived 5 rounds) - Remove "非 OSI 标准" editorial comment from header (keep simple like other docs) - Remove redundant 劣势 #3 (依赖 OpenCode) — already covered by #1 (基座已归档) - Add source annotation to Stars timeline ("基于 GitHub 数据") Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- #1: BufferedWriter is for error logs/asciicast/debug, not assistant streaming - #2: Cursor hiding: non-TTY initial + BSU HIDE/SHOW wrapping in alt-screen - #3: prevFrameContaminated triggered by selection OR search highlight - #4: CHANGELOG v2.1.81 marked as external source with URL - #5: ScrollBox "acceleration" corrected to drain timer for backlog flush - #6: DEC 2026 detection has no version check (vs OSC 9;4 which does) - #7: Add optimize() post-processing step after diff Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Add Claude Code terminal rendering deep-dive (11-terminal-rendering.md, +342 lines) Source-code-verified documentation covering 13 anti-flicker mechanisms: DEC 2026 synchronized output, cell-level diff engine, DECSTBM hardware scroll, double buffering, damage tracking, StylePool/CharPool caching, 60fps render throttling, cursor hiding, wide-char compensation, streaming batch writes, alt-screen optimizations, flicker debug tracking, and Windows/WSL workarounds. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Address qwen3.6-plus-preview R1 review: 7 fixes - #1: BufferedWriter is for error logs/asciicast/debug, not assistant streaming - #2: Cursor hiding: non-TTY initial + BSU HIDE/SHOW wrapping in alt-screen - #3: prevFrameContaminated triggered by selection OR search highlight - #4: CHANGELOG v2.1.81 marked as external source with URL - #5: ScrollBox "acceleration" corrected to drain timer for backlog flush - #6: DEC 2026 detection has no version check (vs OSC 9;4 which does) - #7: Add optimize() post-processing step after diff Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Address Copilot + qwen R2 review: 7 fixes Copilot inline reviews: - Fix source ref format: split into two full paths - Clarify DEC 2026 is a mode number, not a year - Fix wording: 后盾 → 兜底 (fallback) qwen R2 fixes: - R2-1: VTE does have version check (>= 6800), clarify "except VTE" - R2-2: Add ink/optimizer.ts (93 LOC) to source file index - R2-3/R2-4: Low priority, deferred Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Round 1 (forward audit, 6 fixes): - Problem definition table: add "排队 + Mid-Turn Drain" as distinct row - Priority table: next priority also consumed mid-turn (not only between-turn) - Architecture diagram: add dual path (Mid-Turn Drain + Between-Turn) - Practical impact: fix "第2个文件后" → "工具批次完成后" (drain is per-batch) - Agent comparison table: add "Mid-Turn Drain" column - Design insights: add mid-turn drain as #1 recommendation Round 2 (reverse audit): confirmed getAttachmentMessages called once at L1580 Round 3 (markdown): all tables valid, 9 sections sequential Round 4 (terminology): zero 排水 remaining, Mid-Turn consistent Round 5 (final): 649 lines, 20 source refs, clean Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add input queue & interrupt mechanism deep-dive comparison New comparison article (507 lines) analyzing how Claude Code and Qwen Code handle user input during agent execution. Covers priority queue vs FIFO, QueryGuard state machine vs boolean lock, 3-level interrupt mechanism, queue visualization, early input capture, and Speculation pre-execution. Based on decompiled Claude Code v2.1.89 and Qwen Code open source analysis. 16 source code references. Includes 7-agent comparison table. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: audit fixes for input-queue-deep-dive - Fix `drain()` description: prevents new enqueues, doesn't clear queue (abort signal exits loop, items abandoned not cleared) - Add Qwen Code's 3rd cancellation layer: `shutdown()` (graceful) - Fix agent-interactive.ts line count: ~350 → 512 - Clarify Escape in Qwen Code → cancelCurrentRound() (queue preserved) - Fix other-agent table: "阻塞" → "无排队" with note about non-blocking UI frameworks (Ink/prompt_toolkit/Rust TUI) - Fix table column mismatch (escaped pipe in backtick code) - Fix enqueue code snippet: priority is default, not explicit Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: add mid-turn queue drain as core architectural difference CRITICAL correction: the fundamental difference is NOT just about queue priority or visual feedback, but about WHERE user input is injected: - Claude Code: query.ts#L1550-L1643 drains the command queue BETWEEN tool execution steps within a single turn. User input is converted to attachment messages and injected into toolResults, so the model sees new user input at the NEXT STEP of the current turn. - Qwen Code: runReasoningLoop() has NO queue check between tool cycles. queue.dequeue() only happens in the outer runLoop, BETWEEN complete rounds. User input is only processed as a NEW round after the current round fully completes. Added section 5 "核心差异:Turn 内队列排水 vs Turn 间队列排水" with source code evidence, comparison diagram, and practical impact scenarios. Restructured sections 6-9 as supplementary factors. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: replace 排水 with drain/queue drain throughout Replace awkward Chinese translation 排水 (literal: drain water) with English technical terms: Mid-Turn Queue Drain, Between-Round Queue Drain, drain, etc. Keep standard CS Chinese terms (消费/放弃/抢占). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: audit round — align document with mid-turn drain as core thesis Round 1 (forward audit, 6 fixes): - Problem definition table: add "排队 + Mid-Turn Drain" as distinct row - Priority table: next priority also consumed mid-turn (not only between-turn) - Architecture diagram: add dual path (Mid-Turn Drain + Between-Turn) - Practical impact: fix "第2个文件后" → "工具批次完成后" (drain is per-batch) - Agent comparison table: add "Mid-Turn Drain" column - Design insights: add mid-turn drain as #1 recommendation Round 2 (reverse audit): confirmed getAttachmentMessages called once at L1580 Round 3 (markdown): all tables valid, 9 sections sequential Round 4 (terminology): zero 排水 remaining, Mid-Turn consistent Round 5 (final): 649 lines, 20 source refs, clean Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
PR#2886 implements Agent Team experimental feature covering: - p0-p1-engine #14 (Coordinator/Swarm) ✅ - p0-p1-engine #16 (InProcess isolation) ✅ - p0-p1-engine #25 (Task Management) ✅ - p2-stability #14 (Agent permission bubble) ✅ - p2-stability #18 (Agent mailbox) ✅ - p3-hooks #1 (useInboxPoller) ✅ Added PR links to both matrix rows and detail files. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Link PR#3013 to items #1, #2, #7 (SlicingMaxSizedBox, hard cap, char limit) - Add item #54: useStableHeight (PR#3013 Phase 2, not previously covered) - Link PR#2889 (dangerous actions prompt) to item #20 (command blacklist) - Update total from 52 to 53 items across all references Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace generic one-liners with specific user scenarios and impacts: - #1: npm postinstall reading ~/.ssh/ and ~/.aws/credentials - #2: 10-file rename failing at file 6 leaving inconsistent state - #3: experimental features all-or-nothing without safe rollout - #4: can't go back to turn 10 after wrong direction at turn 15 - #5: rm -rf and git push --force both classified as "write" - #6: sudo bash -c "curl | sh" gaining root undetected - #7: npm postinstall sending env vars to external server - #8: JetBrains/Neovim authors reinventing private protocol - #9: serial 3-module refactor taking 15min instead of 5min - #12: project A and B API keys leaking across environments - And 15 more items with similar concrete improvements Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Qwen Code HAS sandbox support (sandbox.ts 984 lines): - macOS Seatbelt (6 profiles: permissive/restrictive × open/closed/proxied) - Docker container isolation - Podman container isolation The actual gaps vs Codex CLI are: 1. Not enabled by default (user must --sandbox or QWEN_SANDBOX=true) 2. No Linux native sandbox (Bubblewrap/Landlock) — only containers 3. Network defaults to open (Seatbelt permissive-open allows network) Fixed in: Codex improvements #1, Codex architecture table, sandbox-security-deep-dive comparison matrix. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
整合 Claude Code 在 3 个源文件中的 9 项 Skill 装载优化,作为统一 追踪单元。 ## 9 项优化(按 Tier) Tier 1 冷启动(P0 子项): 1. 外层 Promise.all 并行 5 路目录来源(5 行代码,~5×) 2. 内层 entries.map(async) 并行单目录(10 行,每 dir N×) 3. 顶层 memoize() 按 cwd 缓存(P3,10 行) Tier 2 运行时 token 节省(P1 子项): 4. sentSkillNames per-agent 去重 — 每轮省 600-1500 token(~50 行) 5. suppressNext on --resume — resume 省一次注入(~20 行) 6. Conditional skills(paths: frontmatter) — 按需激活(~30 行, 可复用 Qwen 已有的 ConditionalRulesRegistry) Tier 3 工程正确性(P2-P3 子项): 7. 300ms reload debounce + 1s file stability — git checkout 不卡顿 8. Bun usePolling 规避 PathWatcherManager 死锁 9. realpath 并行去重 symlink — 解决嵌套/NFS/ExFAT inode 不可靠 ## Qwen Code 现状 - skill-manager.ts:265-285 refreshCache() 4 层串行 for - skill-manager.ts:695/723 provider + skill dir 串行 - 每 turn 注入完整 skill 列表(无 sentSkillNames) - /resume 重复注入 - 未用 ConditionalRulesRegistry 给 skill lazy 激活 ## 实施路线图(~190 行总改动) P0: #1+#2 并行化(15 行)→ 冷启动 ~5× P1: #4 sentSkillNames(50 行)→ 每轮省 token P1: #6 conditional skills(30 行)→ 大 monorepo 救星 P2-P3: 剩余 6 项按需 ## 主矩阵 / p2-perf / README 联动 - 主矩阵:新增 P1 item-28 行 - p2-perf item-2(并行加载 P2)顶部加整合提示 —— 已合并到 item-28 子项 #1+#2+#3,保留作为分解参考 - sub-report 计数:p0-p1-engine 27 → 28 - 总项数:274 → 275 - README 两处数字同步 ## 为什么定位为 P1 而不是 P2 单子项单独看是 P2,但综合收益对重度 skill 用户(Qwen 的明确定位, skills 已反超 OpenCode 6.8×)是 P1 级别: - #4 每轮 600-1500 token × N turn = 日累计省 50K+ token - #6 对 50+ 条件 skill 的大 monorepo 不可或缺 - #1+#2 是用户第一印象的冷启动优化
…04 详情 扫描窗口:2026-04-26 11:40 UTC(上次扫描 1cf3196)→ 2026-04-27 02:30 UTC。 ## 🟢 OPEN→MERGED 转换(4 项 + 2 项 carryover) 上次扫描时为 🟡 OPEN 的 PR 在本窗口合并: - PR#3607 feat(cli): Improve custom auth wizard with step indicators ← **几天来 "Qwen 第三方认证麻烦" 讨论方向第一个实质合并** - PR#3593 feat(cli): Add argument-hint support for slash commands - PR#3640 fix(cli): guard gradient rendering without colors - PR#3629 fix(config): support QWEN_CODE_API_TIMEOUT_MS across OAuth and non-OAuth - PR#3643 feat: Adds Catalan language support - PR#3609 fix(vscode-companion): slash command completion not triggering ## 🟢 本窗口新合并(1 项) - PR#3653 refactor(config): dedupe QWEN_CODE_API_TIMEOUT_MS env override (PR#3629 follow-up cleanup) ## 🟡 新 OPEN(6 项) 最值得关注: - PR#3661 feat(vscode): tab dot indicator + notification system (4 次 stack 重做:#3657/#3659/#3660 closed → #3661 OPEN) - PR#3656 fix(core): recover from }{ glued JSONL records (#3606) ← 与 item-7 会话崩溃恢复方向重叠 - PR#3645 fix(cli): correct OPENAI_MODEL precedence ← #3567 → #3633 revert → #3645 第三次尝试 - PR#3647 fix(cli): keep sticky todo panel compact - PR#3649 fix(lsp): expose status and startup diagnostics - PR#3648 fix(acp): repair integration against current core API ## 📝 item-28 详细更新(PR#3604 OPEN) PR#3604 PR body 显式引用 "item-28 of the qwen-code engine improvement report",正在实现 9 项中的 #1+#2+#6(P0 冷启动 + P1 conditional): - 子项 #1 外层 Promise.all — refreshCache 4 层串行 → 并行 - 子项 #2 内层 Promise.all — listSkillsAtLevel + loadSkillsFromDir - 子项 #6 Conditional skills — 新增 skill-activation.ts (118 行 picomatch registry,project-root scoped) + coreToolScheduler.ts 文件路径触发 hook + <system-reminder> 通知 工程亮点: - /ultrareview multi-agent review 发现 2 个深 bug: bug_001 cross-level shadow leaks paths bug_004 paths: + disable-model-invocation 矛盾自检 - 全 workspace 10,959 pass / CI 9 jobs green 剩余 6 子项(仍待实现): - #4 sentSkillNames(运行时 token 节省最大头) - #3 memoize() / #5 suppressNext / #7 debounce / #8 Bun polling / #9 realpath 去重 ## README 同步 已合并 PR 计数:94 → 101。
继续多轮审计。 ## 第 10 处错误(最严重的事实错误) v1 ~ v4 全都把 PR#3604 列在"✅ 已完成基线"区块,认定 item-28 子项 #1+#2+#6 已实现。 实际 gh pr view 结果: {"mergedAt":null,"state":"OPEN","title":"feat(skills): parallelize loading + add path-conditional activation"} PR#3604 仍 OPEN(截至 2026-04-28),未合并。 ## v5 修正 ### 重构基线分类 旧(v1-v4): ✅ 已完成基线 PR#3581 / PR#3591 / MaxSizedBox / PR#3604 (错误!) 新(v5): ✅ 已完成基线 PR#3581 / PR#3591 / MaxSizedBox(来自 upstream) 🟡 OPEN / 进行中(不算基线) PR#3604 / PR#3636 ❌ CLOSED(设计被否定) PR#3589 / PR#3013 ### item-28 部分覆盖表标注修正 | Item | 已完成 | 仍缺 | | item-28 Skill 装载性能 | **PR#3604 仍 OPEN**(不算已完成)| 子项 #3-9 | ## 速查表更新 - 项 ① 行数:50 → 80-150(v4 修订后更现实) - 项 ⑤ 改述:避免 warmAll → warmAll 短路 + lazy(v3 修订) - 项 ④ 加注:MCP 已并行无需改 - 项 ⑦ 加注:与 PR#3636 不同概念可共存 - 加 * 标注:估算数字需 tracer 实测 ## 审计版本 v1 → v2: 7 处事实错误 v2 → v3: + 1 处(warmAll 过激) v3 → v4: + 1 处(项 ① 实现复杂度低估) v4 → v5: + 1 处(PR#3604 误判为 MERGED) 共 10 处审计修正 ## 教训 PR 状态可能在数小时内变化。审计时不能依赖记忆,必须 gh pr view 现场验证每一个 PR 引用的实际状态。这次错误是因为之前对话提到 PR#3604 时它在 review 但还没合,几天过去仍 OPEN。
对照外部事实(qwen-code 源码 / opencode 源码 / GitHub PR 状态)逐项验证 18 篇文档,
发现并修复以下 9 处不准确:
源码路径错误(4 处):
- §02:16 fileReadCache 路径 utils/ → services/
实测:packages/core/src/utils/fileReadCache.ts 不存在
实际:packages/core/src/services/fileReadCache.ts (188 行)
- §02:17 / §02:154 / §07:114 permissionFlow 路径 permissions/ → core/
实测:packages/core/src/permissions/permissionFlow.ts 不存在
实际:packages/core/src/core/permissionFlow.ts (161 行)
- §10:408 channels/base/AcpBridge.ts → channels/base/src/AcpBridge.ts
实测:缺少 src/ 子目录路径
§02 表格 LOC 校准(8 项):
- ACP session 状态机 ~1000 → ~4400 (17 文件)
* 显著低估,实测 4372 行非测试代码
- Channels SessionRouter ~250 → 234(精确值)
- Channels AcpBridge ~300 → 250(精确值)
- FileReadCache ~250 → 188(精确值)
- permissionFlow 补充 161 行
- SDK Transport.ts 28 → 22(精确值)
- ProcessTransport ~400 → 536(实测 536 行)
- WebUI ACPAdapter 补充 109 行
- VSCode ide-server.ts ~500 → 477(精确值)
- /tasks 命令 ~200 → 271(实测 271 行)
PR 状态校正(1 处):
- PR#3819 实测 CLOSED(不是 merged)
§06:380 + §09:208 都引用了 "PR#3818 / PR#3819"
改为说明 "PR#3818(PR#3819 已 closed)"
Anchor 链接错误(1 处):
- §10:53 链接 [01 §2.2] 但 anchor 指向 §2.1
#21-与-opencode-共识的-4-条原则 → #22-qwen-独有的-3-条特色
* §2.1 是 OpenCode 共识的 4 条原则表
§2.2 是 Qwen 独有的 3 条特色(含"复用 ACP zod schema"那条)
本应链 §2.2
外部验证通过项:
- ACP agent 838 行 ✓ 精确
- OpenCode MCP index.ts 917 行 ✓ 精确
- OpenCode openapi.json 13525 行 ✓ 精确
- mcp-client-manager.ts 路径正确(561 行)
- permission-manager.ts 路径正确(881 行)
- chatRecordingService.ts 路径正确
- gitWorktreeService.ts 路径正确
- channels 5 子包都存在(base/dingtalk/plugin-example/telegram/weixin)
- webui 包存在
- sdk-typescript / sdk-python / sdk-java 都存在
- 主要 PR 状态:3717/3739/3723/3642/3810/3471/3488/3791/3836/3818/3774/3815/3852 均 MERGED
- 文档间链接全部 resolve(25 个 ./XX-name.md 链接 0 断链)
- 锚点链接(#1-... 等)除上述 1 处外全部 resolve
Qwen Code v0.15.9(PR#3971 ✓ 2026-05-08T14:46)发布—— 对应 5 个新合并 PR + 4 个 OPEN PR 影响 subagent / fork / promote。 5 个 MERGED 加进文档: PR#3919 ✓ 2026-05-08 +676/-50 LiveAgentPanel ownership filter - PR#3909 review 标出的两个 follow-up(AUQHn / AUQGc threads) - 修 #1:panel-owned subagent rows 通过 ToolGroupMessage 漏到 live area 的重复渲染(per-tool ownership filter 而非 render gate) - 修 #2:post-delete statusChange emit(subscribers 不再 miss) PR#3892 ✓ 2026-05-08 +394/-48 runForkedAgent YOLO wrapper 第三 Config-wrapper site 闭合(PR#3873 review #3 of 3) - PR#3873 review 标 3 个 wrapper sites,前 2 个由 PR#3873/3887 修 - 第三个:runForkedAgent AgentHeadless path 的 YOLO override 局部 helper 没重建 tool registry → bound EditTool/WriteFileTool 仍走 parent - 三个具体后果:YOLO 静默忽略 / per-fork FileReadCache bypass / memory-extraction 栈级最坏(递归 fork 调 fork) PR#3894 ✓ 2026-05-08 +935/-15 foreground → background promote 集成 - Phase D part (b) of #3634 / #3831 PR-2 of 3 - shell.ts 检测 result.promoted 而非 result.aborted - snapshot 输出到 bg_xxx.output 文件 + 注册 BackgroundShellEntry - ToolResult 指向 /tasks + dialog + task_stop - 设计巧思:result.aborted: false when promoted: true 让 if (aborted) consumer 自动 fall through PR#3956 ✓ 2026-05-08 +179/-53 subagent approval banner 工具细节 - ToolConfirmationMessage compactMode early-return 修复 - subagent 工具 approval 现在显示具体 command / file diff / MCP tool - 而非黑盒"Do you want to proceed?" - MaxSizedBox 5 行 cap PR#3880 ✓ 2026-05-08 +1731/-109 searchable /resume picker - free-text 搜 title / prompt / git branch - useSessionSearchInput hook(query buffer + 编辑键) - 保留 j/k preview / Space-preview / Ctrl+B branch toggle / Esc 4 个 OPEN 加进追踪中: PR#3969 OPEN +200/-12 Ctrl+B promote keybind (#3831 PR-3 of 3) - foreground → background promote UI 终结篇 - Ctrl+B 按键 → AbortController.abort({kind:'background', shellId}) PR#3970 OPEN +821/-243 TaskBase envelope + foreground subagent persistence - task-registry-unification PR-1 of 2 - TaskBase envelope: id/kind/description/status/startTime/endTime/ outputFile/outputOffset/notified/abortController - discriminator: flavor → isBackgrounded PR#3933 OPEN +1758/-66 monitor notifications for subagents - Monitor 通知路由到 owning subagent(含 fg/bg/fork/resumed) - 原本 subagent-owned monitors 用 shared parent notification callback 文档变更: features.md: - 顶部 Qwen v0.15.7 → v0.15.9 + 加 PR#3919/3892/3894/3880/3956 头条 - 命令总数 51 → 52(v0.15.9,含 /branch) - 关键发现 Qwen 命令引用更新 subagent-display-deep-dive.md: - §零 TL;DR 扩展加 4 项变化 - 本周新合并表 7 PR → 11 PR - §零 追踪中加 PR#3969 / PR#3970 / PR#3933 三个 OPEN - §六.9 加 PR#3892 闭合"3 个 wrapper sites" 完整故事 - §六.10 加 PR#3919 ownership filter follow-up - 新增 §六.12 foreground → background promote (PR#3894 + PR#3969) 完整流程图 + 三层防御(PR#3684 sleep interception + PR#3894 + PR#3809 nudge) - 新增 §六.13 subagent approval banner 工具细节(PR#3956)
按"问题 + 决策 + 短理由 + PR 对应"标准压缩 7 个决策章节: - 7 个决策 + §4.5 + §决策矩阵汇总 全部 anchor IDs 保留(其他章节大量 引用 #1-session-是否跨-client-共享 / #2-状态进程模型 / #7-daemon-部署 模式... 等 anchor) - 删除大段 TypeScript 实现代码(§1 settings 配置示例 / §1 Client 怎么发现 session HTTP 示例 / §3 DaemonInstance 类 / §4 重复的"实现要点" / §5 evaluatePermissionFlow 完整实现 / §6 Session 类 + PermissionRequestHandler / §7 Mode A 启动序列 + 用户工作流示例) - 删除 §4 "拒绝跨 session 共享的具体理由" 反方论证表 - 删除 §1 重复的 daemon.sessionScope 表(保留 coordinator.sessionScope) - §7 Mode A/B 拓扑 ASCII 图压缩为"核心特征" bullet - §7 Mode A 工作量增量从表格压缩为 1 行 §4.5 资源共享汇总表 / §决策矩阵汇总 整体保留(已经简洁)。
Round 1(前向审计 6 处): A. Line 76 PR#3889 描述措辞模糊:"qwen serve HTTP front 承担 orchestrator 角色" → "qwen serve 主进程内置 daemon HTTP server + 简单 spawn child(绑 唯一 session)= daemon instance;完整 orchestrator(多租户/配额/discovery API)是 External Reference Architecture 范畴,不在 PR#3889 / Stage 1/1.5/2 scope" B. Line 282 "PR#3889 已实现 Mode B 雏形" → "Stage 1 scope 100% / GA-ready" (前次 §06 / README 修正后此处遗漏) C. Line 30 "空闲 N 分钟" 占位 → "空闲一段时间(具体 idle 阈值由 orchestrator 决定,主线 daemon 不强制)" D. 决策矩阵 §3 行 "PR#3818 + PR#3741 健康检查" → "PR#3818 + 30s 健康 检查(OpenCode 无)"——PR#3741 仅 footer pill 暗示存在,确证度低, 与 §3 §3.1.130 优化表使用 "30s 健康检查" 描述对齐 E. §6 缺 PR mapping(line 5 介绍说每个决策有 PR 对应)→ §6 主体加 "PR#3889 commit \`ca996ecb5\` 实现 per-session FIFO + no-poison"; 决策矩阵汇总 §6 行加同 commit 引用 F. 决策矩阵 §1 "Channels SessionRouter scope 系统" 是 pre-pivot multi- session daemon 概念残留 → "PR#3739 transcript-first fork resume + orchestrator 路由策略(§14)"——与 §1 主体"scope 在 orchestrator 层" 一致 Round 2(cross-chapter anchor 验证): 所有 inbound refs 从 §01/§03/§04/§05/§06/§07 用的 anchor: #1-session-是否跨-client-共享 / #2-状态进程模型 / #3-mcp-server-生命周期 / #6-多-client-并发请求 / #7-daemon-部署模式clihttpserver-vs-headlesshttpserver 全部 resolve 到 §02 实际 header(GFM slugify 脚本验证)。 Round 3/4 polish(1 处): G. Line 45 cross-chapter ref \`[§14]\` → \`[§14 Orchestrator 多租户与配额]\` (其他 cross-chapter ref 都含名称,line 45 单独缺名称不一致) Round 5(最终扫描): - 8 个 external anchor refs 全部 resolve ✓ - 无 placeholder / 空括号 / 错字 / 陈旧措辞(如"雏形"/"prototype") - 7 个决策章节 + §4.5 + 决策矩阵汇总 全部 PR 对应映射齐全
…l-per-workspace 架构不一致 §1 修订(session 共享决策): - "coordinator.sessionScope 在 orchestrator 层" → "sessionScope 由 daemon 自治"(与 §14 重构对齐);明确 Stage 1 default 'single' + Stage 1.5 must-have #1 加 'thread'/'user' override - 小标题 "共享 daemon instance 的具体语义" → "同 daemon 同 workspace 多 client 共享 session 的具体语义"(消除 multi-session daemon 下的歧义) - 安全 / 隔离边界重写: - "跨 workspace 隔离 = 不同 daemon 实例" 错 → "同 daemon 内跨 workspace channel OS 进程级隔离" - 加 "同 channel N session 共 OS 权限" 边界警示(multi-tenant 关键约束) - "多租户 → orchestrator 切 thread scope 路由到独立 daemon" → 与 §14 §一 警示对齐:"workspace 层 1 tenant 1 ws (推荐) 或 daemon process 层 1 tenant 1 daemon" §2 修订: - decision 段 "loadSettings(cwd) 重新加载 settings" → 更精确描述 "this.settings = loadSettings(cwd) 全 channel 共享 settings 字段会被新 ws 覆盖" §3 修订(MCP 生命周期): - 决策依据 1 "每 daemon 1 workspace 1 session" 过时 → "每 qwen --acp child = 1 workspace,同 channel N session 共 MCP children" - 决策依据 2 "不同 daemon 可能用不同 token" → "不同 workspace channel 可能用不同 token" - 重复 spawn 代价完全重写:commit 6a170ef8 后同 workspace N session 共 1 套 MCP children (key win);跨 workspace 同 daemon = M × MCP §4.5 修订: - Permission flow 行 "共享同一 PermissionManager (per-daemon-child cache)" → "每 Session 各自 PermissionManager 实例 (per-session 隔离),但 workspace/global scope decisions 文件 per-workspace 共享 + in-memory mutex" §7 修订: - Mode A 拓扑 TUI 退出说明:明确 "含所有 in-daemon sessions (即使 Stage 1.5 must-have #1 创了额外 sessions 也终止);远程 client 收 session_died + SSE 关闭";声明 Mode A 设计假设 "单用户终端为主" - 决策矩阵 row 7:Mode A "~4d 增量" → "归 Stage 1.5b ~4d 增量"
用户原则 (2026-05-18): "本地运行 TUI 时, 不应该有网络交互, 应该是进程内运行" "不要为你不需要的东西付费, 这个是原则, 本地运行 TUI 是最高优先级的, 设计不应该让这个体验受损" = C++ Stroustrup zero-cost abstraction 原则在 daemon 设计上的应用 文档修改: §04 §一 Mode B 拓扑核心特征: - 删除 "无 in-process TUI client;所有 client 全走 HTTP/SSE" 措辞 - 改为 "daemon 自身 headless, 跨进程 client 走 HTTP/SSE" - 新增⚠️ 设计原则 callout: - qwen 默认 (无 serve flag) = 传统单进程 in-process direct call, 零网络栈 - local default 永久路径 (不是 Stage 1 临时过渡) - 本地单用户 TUI 不参与 daemon convergence - PR#4266 --experimental-daemon-tui 永远 behind flag opt-in advanced §04 §二 TUI 形态 4 种 table: - "传统单进程 (qwen)" → "🌟 #1 优先级, local default 永久路径" - "Mode B + TUI adapter" → "opt-in advanced, behind flag 不进入 default migration" - "Mode A 本地 TUI" → 可能是本地多 client 协作唯一合理路径 (待 revisit) - 新增 🌟 设计原则段落 §02 §7 部署模式 — Mode B mainline / Mode A parking lot: - TUI 在多 session daemon 下的语义段重写, 把本地单用户 TUI in-process 放第一位 - 新增 🌟 设计原则段落: - zero-cost abstraction 引用 - 本地 TUI 必须 in-process / 跨进程 client 走 daemon 对比表 - 明确 Wave 5 PR 26 scope 收紧 (TUI default 不切换) - chiga0 #3803 auto-daemon UX 草图仅适用 multi-client 场景 待后续做: - §01 §三 双部署模式可加 callout 引到本原则 - §06 §三·二 (chiga0 #3803 deployment + package contract) 需 caveat: "Local auto-daemon UX" 仅适用用户主动选 multi-client 协作场景 - Wave 5 PR 26 scope 文档明确 "TUI default 不切换" Memory: 保存 feedback_local_tui_in_process_priority.md 索引到 MEMORY.md
之前立 zero-cost abstraction 原则后,3 处旧措辞未同步: §04 §六 Deployment shape matrix line 309: - "1. Local - Local" 之前列 "现有用户默认迁移目标" + 含 TUI - 修: 拆为 1 (本地单用户 TUI in-process) + 1b (multi-client 协作 daemon) - 标 🌟 永久 default UX §06 §三·二 Shape 表 line 256: - "Local - Local 本机 daemon/runtime/workspace" 之前是 "qwen 默认迁移目标" - 修: 拆为本地单用户 TUI (不存在 daemon) + multi-client 协作 (loopback daemon) §06 §三·二 #3 Local auto-daemon UX 段: - 之前是 "local TUI 默认走 daemon 不能变成..." - 改为 "仅 multi-client 协作场景, 不作 local TUI default" - 加 callout 引 #3803 reply 4483031818 - 提议 Mode A 可能更合适 - 标 "Wave 6 前不入主线" §06 §三·二 #5 Client default migration gate: - 之前 "TUI / channel / IDE default 切换必须等..." - 改为⚠️ TUI default 永远不切换, gate 仅适用 channel/web/IDE - 区分 PR#4266 (TUI exp = opt-in advanced 永远 behind flag) vs PR#4267 (IDE exp = 合规 behind-flag for default migration) - 引 #4175 reply 4483033542 (Wave 5 PR 26 scope 收紧) 跨章节一致性现在符合: - §02 §7 🌟 设计原则段 (本地 TUI in-process) - §04 §一 Mode B 拓扑核心特征 (重写 callout) - §04 §二 TUI 形态 4 种 (🌟 #1 优先级标注) - §04 §六 Deployment shape matrix (本次修) - §06 §三·二 (本次修 3 处) 总账数 (35 MERGED + 5 OPEN + 3 CLOSED, Wave plan 22.5/31 ≈ 73%) 全章节一致 ✅ 剩余非冲突项 (未在本次修): - §03 http-api 内容停留较早 (没有 Wave 1-5 PR refs), 可后续 refresh - §05 permission-auth 同上, 可后续 refresh
… 后续 + #4514 backlog + side-channel #4511 PR 状态变化(OPEN → MERGED 或 CLOSED): - PR#4380 ytahdn web-shell: OPEN CHANGES_REQUESTED → MERGED 2026-05-27 01:42 (历时 ~6 天,最终 +17121/-66) - PR#4484 chiga0 cross-client sync: OPEN → MERGED 2026-05-25 09:28 (历时 17h, 最终 +835/-105) - PR#4530 doudouOUC T2.9 prompt deadline + writer idle: OPEN → MERGED 2026-05-26 17:09 to daemon_mode_b_main (target 改了, 不是原 main) - PR#4321 doudouOUC telemetry Phase 2: OPEN → MERGED 2026-05-21 03:55 to main - PR#4367 doudouOUC telemetry resource attributes: OPEN → MERGED 2026-05-21 05:54 to main - PR#4477 wenshao InlineParallelAgentsDisplay + LiveAgentPanel keyboard nav: OPEN → MERGED 2026-05-26 06:23 to main - PR#4472 chiga0 ACP HTTP: 仍 OPEN, +3475 → +6098/-316 20 files (review 期间 ×1.75 涨) - PR#4516 doudouOUC T1.3+T1.4: OPEN → CLOSED 2026-05-26 09:25 author self-close 后 re-triage —— compress 经 /prompt slash passthrough 已可达,_meta route 当前非 must-have 需 client demand 驱动 reopen,架构 lesson 写入文档 新 PR 入活动流(10 项): - PR#4460 F2 cleanup B (W133-a + W134 self-heal observability) - PR#4504 /recap route 关 #4175 daemon missing inventory #1 - PR#4527 --allow-origin CORS allowlist 关 #4514 T2.4 - PR#4539 chiga0 voterClientId on permission_resolved (#4511 A4) - PR#4546 chiga0 in-session model switch reaches bus (#4511 A1) - PR#4559 daemon file logger 关 #4548 - PR#4473 F5 release chain PR 27 (v0.16-alpha docs known limits + SDK env fallback) - PR#4483 F5 release chain PR 30a (local launch templates) - PR#4469 periodic main → integration sync 05-24 (45 commits) - PR#4500 periodic main → integration sync 05-25 (5 commits) 01-overview.md F-series intro 段全面重写: - 截至 2026-05-27 状态汇总 - 加 F5 release chain 4 PR 链 (27 → 28 → 30a → 31) 标 v0.16-alpha - 加 #4511 side-channel coordination design A1/A4 track (chiga0 第 6 PR 已开) - 加 #4514 backlog 关 2 项 (T2.4 + T2.9) + 1 项撤回 (T1.3+T1.4) - 加 #4548 daemon file logger - ytahdn 从 OPEN 到 MERGED
Summary
基于 /root/git/ 下的源码仓库(qwen-code、goose、opencode)进行深度源码分析,大幅扩展文档覆盖。
Changes
Qwen Code — 从 2 文件扩展到 6 文件
Goose — 从 2 文件扩展到 6 文件
OpenCode — EVIDENCE.md 大幅扩充
对比文档更新
/reviewSkill(4 代理并行)和/vim支持Source Repositories Analyzed
/root/git/qwen-code— commit0b8ff03f8(2026-03-26)/root/git/goose— commit0ace570(2026-03-21)/root/git/opencode— commit41c77ccb3(2026-03-24)Test Plan