Tencent / Tencent/BrowserSkill
[Bug][dsh-plugin] browser_session start hangs forever on Windows - bsk child exits fine, but plugin close event never fires; its own 120s timeout never surfaces
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5.7k
- Forks
- 399
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 74
Description
环境
- DeepSeek Harness (dsh) 0.1.2-alpha.4,Windows 11
- @wxg-prc-cpg/browser-skill-dsh-plugin 0.1.2(并核对过 0.2.0:
createBskRunner与 0.1.2 逐字一致,未修复) - bsk CLI 0.1.11(daemon + Chrome 扩展 0.2.0),
bsk doctor全部 ok,bsk status显示扩展已连接
现象
调用插件的 browser_session { action: "start" } 永久挂起:
- Agent Window 正常弹出,daemon 侧会话已创建(daemon log 随后出现
idle session stopped) - 但工具调用永不返回;插件自身的
defaultTimeoutMs: 120000超时也不会浮出任何结果(kill 子进程后 promise 仍不 settle) - 插件停用/DSH 重启均无法恢复;
browser_session list显示无会话(会话未被注册回插件)
分层实测(关键证据)
同一条命令 bsk session start --json:
| 调用方 | 结果 |
|---|---|
| pwsh 直跑 | 231ms,正常返回 JSON |
Node child_process.spawn(与插件完全同形:管道 stdio + --json 尾参) |
231ms,正常返回 |
| DSH 宿主进程内、经宿主 subprocess 服务 spawn | 162–267ms,正常返回 |
插件自身的 raw child_process.spawn 桥接层 |
挂起:CLI 在 daemon 侧创建会话后,插件的 close 事件永不触发 |
插件内部代码已逐段排查,无可自我挂起的等待点:reserveStart/acquireForeground 均同步;观察截帧 15s 超时+退避;runner.run 有超时。唯一嫌疑是 runner 的 spawn 在 Windows(ConPTY/控制台场景)下 stdio 管道关闭事件丢失——子进程退出后 child.on("close") 不触发,且超时 kill 也救不回来,导致 120s 超时形同虚设。
另一条独立挂起路径(供参考):当 Chrome 扩展与 daemon 断连时(日志 ws read error: Connection reset without closing handshake → browser disconnected),bsk session start 会等待浏览器重连而长时间无响应;区分方法:挂起时 daemon sessions 里是否有新建会话(有=桥接层问题;无=浏览器断连等待)。
复现
Windows + dsh + 本插件(0.1.2/0.2.0 均可)+ bsk doctor 全绿:
browser_session({ action: "start", url: "about:blank" }) # 永久挂起
临时绕过(已验证可用)
绕过插件桥接层,用宿主 subprocess 服务直连 bsk CLI(自有小插件,bsk fetch/diag 全程 200ms 级);或将命令交给 shell 工具直跑。
建议排查方向
createBskRunner的spawnImpl(bskPath, [...args, "--json"])在 Windows 下的 stdio 管道关闭语义(对比宿主 subprocess 服务的 spawn 参数差异,如进程树终止/graceMs/draining)- 超时 kill 后
close不触发的原因(子进程退出后管道被谁持有) - 考虑对
close缺失增加兜底:exit事件 + 管道 drain 超时后强制 settle
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the plugin's createBskRunner and its raw child_process.spawn via spawnImpl, then run the Windows browser_session start reproduction. Compare its stdio and process-termination behavior with the working host subprocess service, focusing on why close does not fire after the bsk child exits. Done means the call settles reliably on Windows, including when timeout cleanup is required.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, typescript
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100