feature: SSH 远程会话支持本地 HTML 预览(previewLocalHtml 远程适配)
- Dominant language
- TypeScript
- Stars
- 2.7k
- Forks
- 401
- Avg merge
- 21h 48m
- Merged PRs (30d)
- 776
Description
### 问题描述
`cindy_browser` 的 `previewLocalHtml` 动作在 SSH 远程会话中返回 `UNAVAILABLE`("SSH 远程会话不支持本地预览(工作目录位于远端机器)")——预览服务运行在本机,而 SSH 会话的 workingDir 是远端路径,本地无法解析。
但 `browser-workflow` 已引导 agent 通用使用该动作验证生成的 HTML,导致远程任务无法完成广告的截图验证流程。
### 现状与根因
- 预览服务(`local-html-preview-server`)是**本机进程**,token 化沙箱渲染工作区内 HTML
- SSH 会话的 workingDir 位于**远端主机**,本地进程无法直接读取
- 当前拒绝是安全的 fail-closed(`BROWSER_RUNTIME_LOCAL_PREVIEW_UNAVAILABLE`),不泄露数据
### 候选方向(供讨论)
1. **materialize 到本地**:SSH 会话中把目标 HTML + 相对资源拉到本地临时工作区再预览(需处理路径映射与资源完整性问题)
2. **远程侧预览**:在远端执行预览并回传截图(需远端有浏览器工具链)
3. 明确降级:SSH 会话下 browser-workflow 不再引导使用 previewLocalHtml
### 关联
- 来源:#1803(本地 HTML 预览功能)审查意见(chatgpt-codex-connector)
- 相关:#1766(浏览器工具链问题)
Contributor guide
Research direction
Start by tracing the previewLocalHtml action and the BROWSER_RUNTIME_LOCAL_PREVIEW_UNAVAILABLE guard for SSH sessions. Read the local-html-preview-server behavior and the implementation from #1803, then compare the three candidate directions in this issue. Done means remote browser-workflow tasks can verify generated HTML screenshots without the current UNAVAILABLE failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100