-
Notifications
You must be signed in to change notification settings - Fork 9
feat: add 9 new improvement items to Qwen Code report (26→35) #38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
afe731b
feat: add 9 new improvement items to Qwen Code report (26→35 total)
wenshao 8e15375
feat: add 2 deep-dive articles + link to 9 new improvement items
wenshao 51015b2
feat: add 8 more improvement items (35→43 total)
wenshao 2b94334
feat: add final 4 items from last sweep (43→47 total)
wenshao 0ab6185
feat: expand Top 5 → Top 20 detailed improvement descriptions
wenshao a94b5c5
fix: remove cost tracking item (multi-model, not applicable to Qwen)
wenshao 34966dc
fix: restore Top 20 — add Denial Tracking as item 20
wenshao c1e5533
fix: remove /btw misreport — Qwen Code already has btwCommand.ts
wenshao c9de808
fix: remove LSP Tool misreport — Qwen Code has lsp.ts with full imple…
wenshao d4db40a
feat: add 3 deep-dive articles + complete P0/P1 link coverage
wenshao 3330cf5
feat: add Team Memory Sync deep-dive (180 lines)
wenshao 0ac2338
fix: replace History Snip (scaffolding) with Team Memory Sync in Top 20
wenshao 36593e9
feat: rewrite all 45 matrix items with clear one-line descriptions
wenshao 5b68598
feat: add dynamic status line as P3 item (45→46 total)
wenshao e9fa3af
feat: expand Top 20 → all 47 items with detailed descriptions
wenshao 8bac2ac
feat: add anchor links + compact status bar + all 48 detailed sections
wenshao 5ea9dd4
fix: correct all 43 mismatched anchor links + shorten progress column
wenshao dd4e9c0
feat: add 9 items from official docs/changelog (48→57 total)
wenshao f35984d
feat: add 15 items from official docs (57→72 total, 1298 lines)
wenshao ca4801a
fix: remove /loop misreport — Qwen Code has loop skill + CronCreate/C…
wenshao e20b79c
fix: remove /context misreport + update Agent SDK (Qwen has TS SDK)
wenshao 849f9b9
feat: split improvement report into 4 files by priority
wenshao 7bd8c03
feat: rewrite P0/P1 file with source-indexed format for developers
wenshao 57e1cba
feat: rewrite all 70 items in developer-friendly format + fix anchor …
wenshao c6b1172
feat: add 意义/缺失后果/改进收益 to all 70 items + fix cross-file anchors
wenshao e464dc4
fix: remove Channels misreport — Qwen Code has full channel system
wenshao 11d1ddc
fix: re-number all 69 items sequentially (1-69) + fix cross-file anchors
wenshao f09bc08
fix: rebuild all 69 anchors + add 3 missing impacts
wenshao File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,131 @@ | ||
| # Computer Use 桌面自动化 Deep-Dive | ||
|
|
||
| > AI Agent 能否操作桌面应用——截图、点击、打字、读剪贴板?本文基于 Claude Code(v2.1.89 源码分析)的源码分析,介绍其 Computer Use 桌面自动化架构。Qwen Code 目前无此功能。 | ||
|
|
||
| --- | ||
|
|
||
| ## 1. 架构总览 | ||
|
|
||
| ``` | ||
| Claude Code CLI | ||
| ↓ MCP 协议 | ||
| Computer Use MCP Server(进程内 stdio 传输) | ||
| ↓ NAPI | ||
| ┌─────────────────────────────────┐ | ||
| │ @ant/computer-use-swift │ ← 截图(SCContentFilter) | ||
| │ @ant/computer-use-input (Rust) │ ← 鼠标/键盘(enigo) | ||
| └─────────────────────────────────┘ | ||
| ↓ macOS API | ||
| NSWorkspace / TCC / IOKit | ||
| ``` | ||
|
|
||
| | 维度 | 详情 | | ||
| |------|------| | ||
| | **集成方式** | MCP Server(进程内,stdio 传输) | | ||
| | **截图** | `SCContentFilter`(macOS ScreenCaptureKit) | | ||
| | **输入控制** | Rust `enigo` NAPI 绑定 | | ||
| | **权限** | TCC Accessibility + Screen Recording | | ||
| | **门控** | GrowthBook `tengu_malort_pedway` + Max/Pro 订阅 | | ||
| | **工具名** | `mcp__computer-use__*` | | ||
|
|
||
| --- | ||
|
|
||
| ## 2. 截图捕获 | ||
|
|
||
| ```typescript | ||
| // 源码: utils/computerUse/swiftLoader.ts | ||
| // 通过 NAPI 加载 @ant/computer-use-swift | ||
| // 方法: captureExcluding(), captureRegion(), screenshot | ||
| // JPEG 质量: 0.75 | ||
| // 坐标缩放: 逻辑坐标 → 物理像素 → API 目标尺寸 | ||
| ``` | ||
|
|
||
| **终端豁免**:截图时自动隐藏终端窗口(避免截到 Agent 自身 UI)。通过 `getTerminalBundleId()` 检测当前终端:iTerm、Terminal.app、Ghostty、Kitty、Warp、VS Code。 | ||
|
|
||
| --- | ||
|
|
||
| ## 3. 鼠标/键盘控制 | ||
|
|
||
| | 操作 | 实现 | 参数 | | ||
| |------|------|------| | ||
| | `moveMouse()` | 瞬移 + 50ms 稳定延迟 | x, y | | ||
| | `click()` | 支持修饰键(press/release 括号化) | button, modifiers | | ||
| | `drag()` | ease-out-cubic 动画,60fps,2000px/s,最大 0.5s | start, end | | ||
| | `scroll()` | 垂直优先 | dx, dy | | ||
| | `key()` / `keys()` | 通过 DispatchQueue.main 分发 | key name, modifiers | | ||
| | `holdKey()` | press/release 追踪防止修饰键卡住 | key, action | | ||
| | `type()` | 剪贴板粘贴(含回读验证)或直接 typeText() | text | | ||
|
|
||
| **Run Loop 排空**:`drainRunLoop()` 确保 main-queue dispatch 事件到达——30s 超时上限,orphan 标志防护。 | ||
|
|
||
| > 源码: `utils/computerUse/executor.ts` | ||
|
|
||
| --- | ||
|
|
||
| ## 4. TCC 权限 | ||
|
|
||
| ```typescript | ||
| // 源码: utils/computerUse/hostAdapter.ts#L47-L54 | ||
| // 启动时检查: | ||
| checkAccessibility() // 辅助功能权限(鼠标/键盘控制) | ||
| checkScreenRecording() // 屏幕录制权限(截图捕获) | ||
| // 两项均需批准才能使用 Computer Use | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## 5. MCP 集成 | ||
|
|
||
| ```typescript | ||
| // 源码: utils/computerUse/setup.ts#L23-L53 | ||
| // Server 配置: | ||
| { | ||
| type: 'stdio', // 进程内传输 | ||
| command: process.execPath, // 自身二进制 | ||
| args: ['--computer-use-mcp'], // MCP 入口 | ||
| scope: 'dynamic', // 按需启动 | ||
| } | ||
| // 工具名: mcp__computer-use__screenshot, mcp__computer-use__click, ... | ||
| // 权限: buildComputerUseTools() 自动添加 allowed tools(绕过权限提示) | ||
| ``` | ||
|
|
||
| **CallTool 覆盖**(源码: `utils/computerUse/wrapper.tsx`):拦截 MCP callTool,注入权限对话框、状态管理、锁获取和截图持久化。 | ||
|
|
||
| --- | ||
|
|
||
| ## 6. 门控与限制 | ||
|
|
||
| | 门控 | 条件 | | ||
| |------|------| | ||
| | GrowthBook | `tengu_malort_pedway` 特性开关 | | ||
| | 订阅 | Max / Pro 订阅(Ant 用户绕过) | | ||
| | 平台 | 仅 macOS(SCContentFilter 依赖) | | ||
| | 并发 | 文件锁(`computerUseLock.ts`)防止并发 CU 会话 | | ||
| | 中止 | Cmd+Escape 热键(`escHotkey.ts` 通过 event-tap 注册) | | ||
|
|
||
| **子门控**(GrowthBook 动态配置): | ||
| - `pixelValidation` — 像素级操作验证 | ||
| - `clipboardPasteMultiline` — 多行剪贴板粘贴 | ||
| - `mouseAnimation` — 鼠标拖拽动画 | ||
| - `hideBeforeAction` — 操作前隐藏终端 | ||
| - `autoTargetDisplay` — 自动选择目标显示器 | ||
| - `clipboardGuard` — 剪贴板保护 | ||
|
|
||
| --- | ||
|
|
||
| ## 7. 关键源码文件 | ||
|
|
||
| | 文件 | 职责 | | ||
| |------|------| | ||
| | `utils/computerUse/mcpServer.ts` | MCP Server 入口 | | ||
| | `utils/computerUse/executor.ts` | 鼠标/键盘/截图执行 | | ||
| | `utils/computerUse/hostAdapter.ts` | TCC 权限检查 | | ||
| | `utils/computerUse/swiftLoader.ts` | SCContentFilter NAPI | | ||
| | `utils/computerUse/inputLoader.ts` | enigo/keyboard NAPI | | ||
| | `utils/computerUse/gates.ts` | GrowthBook 门控 | | ||
| | `utils/computerUse/setup.ts` | MCP 配置 | | ||
| | `utils/computerUse/wrapper.tsx` | CallTool 覆盖 | | ||
| | `utils/computerUse/computerUseLock.ts` | 并发文件锁 | | ||
| | `utils/computerUse/escHotkey.ts` | Cmd+Escape 中止热键 | | ||
|
|
||
| > **免责声明**: 以上分析基于 2026 年 Q1 源码,后续版本可能已变更。Computer Use 仅限 macOS,需 Max/Pro 订阅。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,166 @@ | ||||||
| # 成本追踪与 Fast Mode Deep-Dive | ||||||
|
|
||||||
| > 用户如何了解 AI Agent 的实际花费?能否在速度和成本之间灵活切换?本文基于 Claude Code(v2.1.89 源码分析)和 Qwen Code(v0.15.0 开源)的源码分析,对比两者在成本追踪、Fast Mode 速度分级和并发会话管理方面的差异。 | ||||||
|
|
||||||
| --- | ||||||
|
|
||||||
| ## 1. 架构总览 | ||||||
|
|
||||||
| | 维度 | Claude Code | Qwen Code | | ||||||
| |------|------------|-----------| | ||||||
| | **成本显示** | USD 金额 + 按模型分项 + cache 效率 | Token 计数 + 请求数 + cache 效率百分比 | | ||||||
| | **成本持久化** | 按 session ID 存储在项目配置中 | 无持久化 | | ||||||
| | **Fast Mode** | ✅ Opus 4.6 标准/快速切换($5→$30/Mtok) | ❌(仅 `--fast` 指定备用模型) | | ||||||
|
||||||
| | **Fast Mode** | ✅ Opus 4.6 标准/快速切换($5→$30/Mtok) | ❌(仅 `--fast` 指定备用模型) | | |
| | **Fast Mode** | ✅ Opus 4.6 标准/快速切换(Standard $5/$25 → Fast $30/$150 per Mtok) | ❌(仅 `--fast` 指定备用模型) | |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the overview table, Fast Mode pricing is summarized as “$5→$30/Mtok”, but later in the same document you describe separate input/output pricing (“$5/$25 → $30/$150 per Mtok”). Please make the overview row consistent (e.g., include both rates or use a neutral wording like “显著更贵”).