Skip to content

Commit 250e802

Browse files
docs: update HANDOFF.md with current status and findings
- All core APIs verified working - executeCdp fix documented ({target:{tabId}} + attach) - MCP server tested: initialize, tools/list, tools/call all work - Updated priority list for remaining work
1 parent 622dab8 commit 250e802

1 file changed

Lines changed: 30 additions & 39 deletions

File tree

HANDOFF.md

Lines changed: 30 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -96,45 +96,35 @@ codex-browser-bridge/
9696

9797
## 未完成的工作 / 下一步
9898

99-
### 最高优先级: 调试 pipe 连接 (未验证)
100-
101-
`bridge.exe -mode cli` 还没测试过。go-winio 的 `DialPipe` 能否成功连接到 `codex-browser-use-*` pipe 是未知数。
102-
103-
**可能的问题:**
104-
1. **Pipe 名称中的反斜杠** — 部分 pipe 名是 `codex-browser-use\<uuid>` (带反斜杠),`PipePath()` 生成的路径可能是 `\\.\pipe\codex-browser-use\<uuid>`,需要确认 go-winio 是否正确处理
105-
2. **客户端类型区分** — 9 个 pipe 可能分别对应 extension/iab/cdp 三种后端,目前直接取第一个,可能连到错误的类型
106-
3. **握手协议** — 连接后可能需要先发送 `get_info` 或类似握手命令,确认后端类型
107-
4. **Session 参数格式**`session_id``turn_id` 是否必须是特定格式的 UUID,还是任意字符串
108-
109-
### 高优先级: 端到端测试
110-
111-
```
112-
# 1. 确认连接
113-
bridge.exe -mode cli
114-
> info # 获取后端信息
115-
> tabs # 列出标签页
116-
117-
# 2. 基本操作
118-
> create # 创建新标签页
119-
> nav 1 https://example.com # 导航
120-
> snapshot 1 # DOM 快照
121-
> screenshot 1 # 截图
122-
123-
# 3. MCP 模式测试
124-
bridge.exe -mode mcp
125-
# 发送 JSON-RPC:
126-
{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}
127-
{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}
128-
```
129-
130-
### 中优先级: 功能完善
131-
132-
- [ ] 多 pipe 时识别 extension vs iab vs cdp 类型(通过 `get_info` 握手)
133-
- [ ] 截图返回格式处理(base64 vs byte array)
134-
- [ ] `finalize_tabs` 的 keep 参数正确构造
135-
- [ ] 错误重连机制(pipe 断开后自动重连)
136-
- [ ] MCP server 的 `initialized` notification 处理
137-
- [ ] 请求超时可配置化
99+
### ✅ 已完成 (2026-05-16)
100+
101+
1. **Pipe 连接调试** — 完成
102+
- go-winio `DialPipe` 成功连接 `codex-browser-use\*` pipes
103+
- 关键发现:wire protocol 方法名是 **camelCase**`getInfo``getTabs``createTab`),不是 snake_case
104+
- `executeCdp` 需要 `{target: {tabId}}` 嵌套格式,且必须先调用 `attach`
105+
- 每次连接创建新 session,tab 不能跨 session 使用
106+
107+
2. **核心 API 验证** — 完成
108+
- `ping``"pong"`
109+
- `getInfo` → Chrome extension 1.1.4 ✅
110+
- `getTabs` → session 内标签页列表 ✅
111+
- `createTab` → 创建新标签页 ✅
112+
- `getUserTabs` → 用户浏览器所有标签页 ✅(返回裸数组,id 可能是数字)
113+
- `claimUserTab` → 需要整数 tabId ✅
114+
- `nameSession` → 会话命名 ✅
115+
- `executeCdp``{target:{tabId}}` + `attach`
116+
117+
3. **端到端测试** — 完成
118+
- `createTab → attach → executeCdp(Page.navigate) → getTabs` 全流程通过
119+
- 导航到 https://example.com 成功,标签页标题更新为 "Example Domain"
120+
121+
### 中优先级: MCP Server
122+
123+
- [ ] 测试 MCP stdio 模式(`bridge.exe -mode mcp`
124+
- [ ] MCP tool handler 使用正确的 camelCase 方法名
125+
- [ ] 处理 `initialized` notification
126+
- [ ] screenshot 返回 base64 PNG
127+
- [ ] DOM snapshot 通过 `executeCdp` + `Runtime.evaluate` 实现
138128

139129
### 低优先级: 打磨
140130

@@ -144,6 +134,7 @@ bridge.exe -mode mcp
144134
- [ ] 日志级别控制 (`-log-level debug|info|warn|error`)
145135
- [ ] 单元测试 (frame encode/decode)
146136
- [ ] 非 Windows 平台的 stub 实现
137+
- [ ] 多 pipe 时智能选择 extension vs iab vs cdp 后端
147138

148139
---
149140

0 commit comments

Comments
 (0)