fix: apply post-merge audit fixes to input-queue-deep-dive.md#31
Conversation
Includes 5 rounds of fixes that were pushed to feat/input-queue-deep-dive after PR #29 squash-merged (only initial commit was included): 1. Audit fixes: drain() semantics, Qwen Code 3-layer cancel, line counts, Escape→cancelCurrentRound (queue preserved), other-agent table precision 2. Replace 排水→drain/queue drain terminology 3. Add Mid-Turn Queue Drain as core architectural difference (query.ts#L1550) 4. Align document with mid-turn drain thesis (architecture diagram, priority table, practical impact scenarios, agent comparison table, design insights) 5. Update for Qwen Code v0.15.0: follow-up suggestions + speculation (PR #2525) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
433433b to
e23418c
Compare
There was a problem hiding this comment.
Pull request overview
Updates the input-queue-deep-dive.md comparison doc to incorporate post-merge audit fixes and newer Qwen Code (v0.15.0) behavior, especially around follow-up suggestions/speculation and clarified abort/drain semantics.
Changes:
- Update the intro and comparison sections to reflect Qwen Code v0.15.0 (follow-up suggestions + speculation).
- Expand the “预测与预执行 / Speculation” sections with new capability/behavior tables and source references.
- Refresh agent comparison + key source file lists and adjust user-facing impact notes (abort/drain semantics).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| | Tab 接受 | ✅ 预执行结果直接注入 | — | | ||
| | Prompt Suggestion | ✅ 默认开启 | ✅ 默认开启(`followupSuggestionsEnabled`) | | ||
| | Speculation | ✅(ant-only,`USER_TYPE === 'ant'`) | ✅ opt-in(`enableSpeculation: false` 默认关闭) | | ||
| | Overlay FS 隔离 | ✅ Copy-on-Write | ✅ Copy-on-Write(`/tmp/qwen-speculation/{pid}/`) | |
There was a problem hiding this comment.
The Qwen Code Overlay FS path here uses /tmp/qwen-speculation/{pid}/, but later in the doc the path is /tmp/qwen-speculation/{pid}/{uuid}/. Please make these consistent (or explain the directory structure) to avoid confusing readers.
| | Overlay FS 隔离 | ✅ Copy-on-Write | ✅ Copy-on-Write(`/tmp/qwen-speculation/{pid}/`) | | |
| | Overlay FS 隔离 | ✅ Copy-on-Write | ✅ Copy-on-Write(基目录:`/tmp/qwen-speculation/{pid}/`;每次 speculation 实例目录:`/tmp/qwen-speculation/{pid}/{uuid}/`) | |
| | Pipelined Suggestion | ✅ speculation 完成后预生成下一个 | ✅ `generatePipelinedSuggestion()` | | ||
| | Early Input | ✅ 启动阶段 stdin 捕获 | ❌ | | ||
|
|
||
| > **重要变化**:Qwen Code v0.15.0(2026-04-03 合入 `#2525`)新增了完整的 follow-up suggestions + speculation 系统,架构与 Claude Code 高度相似。但 speculation 默认关闭,需手动启用。 |
There was a problem hiding this comment.
#2525 is wrapped in inline code, so GitHub won’t auto-link it, and it’s also ambiguous which repository it refers to (this repo vs qwen-code). Consider using a normal #2525/full link and explicitly naming the repo (e.g., qwen-code PR #2525).
| > **重要变化**:Qwen Code v0.15.0(2026-04-03 合入 `#2525`)新增了完整的 follow-up suggestions + speculation 系统,架构与 Claude Code 高度相似。但 speculation 默认关闭,需手动启用。 | |
| > **重要变化**:Qwen Code v0.15.0(2026-04-03 合入 qwen-code PR #2525)新增了完整的 follow-up suggestions + speculation 系统,架构与 Claude Code 高度相似。但 speculation 默认关闭,需手动启用。 |
| | Tab 接受路径 | 注入对话历史 | `acceptSpeculation()` → `addHistory()` 绕过队列 | | ||
| | Cache 共享 | prompt cache breakpoint 机制 | `saveCacheSafeParams()` 捕获 cache 参数 | | ||
|
|
||
| > Qwen Code 的 speculation 实现于 2026-04-03 合入(PR #2525),与 Claude Code 架构高度相似。 |
There was a problem hiding this comment.
This references “PR #2525” without specifying which repository. Since this doc lives in a different repo, please disambiguate (e.g., “qwen-code PR #2525”) and/or link to the PR for traceability.
| > Qwen Code 的 speculation 实现于 2026-04-03 合入(PR #2525),与 Claude Code 架构高度相似。 | |
| > Qwen Code 的 speculation 实现于 2026-04-03 合入(qwen-code PR #2525),与 Claude Code 架构高度相似。 |
Closed PR #72 (qwen3.6-plus) — 22 of 26 items duplicated existing 183. Extracted 4 new items to p2-tools: - #31 /plan (plan mode) - #32 /rename (session rename) - #33 /upgrade (version upgrade + changelog) - #34 Plugin system (aggregated container for commands+skills+hooks+MCP) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
All 5 genuinely new (source verified): useRemoteSession, useDiffInIDE, useCancelRequest, AgentSummary, useBackgroundTaskNavigation. Renumbered as P3 #27-#31 (PR had #26-#30, conflicting with existing #26). Best qwen3.6-plus content PR: 5/5 new items (100% hit rate). Total: 214 items. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
New items from second round of source code comparison: P0 (2 items): - #19: Environment variable sanitization (25+ patterns) - #20: Dangerous command blacklist (rm -rf, find -exec, git -c, etc.) P1 (4 items): - #21: Edit fuzzy matching with Levenshtein distance (10% tolerance) - #22: Omission placeholder detection (prevent "// ... rest") - #23: JIT context discovery for read/write/edit tools - #24: OS-level sandbox (Linux bwrap, macOS Seatbelt, Windows) P2 (6 items): - #25: Folder trust discovery (pre-execution scanning) - #26: Web fetch rate limiting + SSRF hardening - #27: Grep advanced parameters (include/exclude/names_only) - #28: Advanced vim operations (big words, find, replace, toggle) - #29: Footer customization dialog - #30: Write file LLM content correction P3 (2 items): - #31: OAuth flow refactoring (shared utils + RFC 9728) - #32: Conseca safety framework (context-aware policy) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
PR #29 was squash-merged with only the initial commit. 5 subsequent commits (audit fixes, terminology, mid-turn drain core thesis, Qwen Code v0.15.0 update) were left on the old branch. This PR applies all those changes.
Changes (34 insertions, 10 deletions)
drain()semantics fix: "清空队列" → prevents new enqueues + loop exits (items abandoned, not cleared)shutdown()as 3rd layerquery.ts#L1550-L1643— user input injected between tool steps within same turnTest plan
🤖 Generated with Claude Code