Repository navigation
Closed
Description
Parent
Problem
The Web transcript currently renders thinking, tool calls, and tool results through generic expandable text blocks. This preserves basic evidence but makes common coding-agent output difficult to inspect:
- file reads lose line-oriented navigation;
- write/edit results do not provide a reviewed change view;
- diffs are not rendered as additions/deletions with file identity;
- test results are not grouped by command, status, or failure;
- terminal output lacks a dedicated bounded log view.
A generic raw-text fallback is necessary, but it should not be the primary UI for structured evidence.
Value
- Make actual code changes and validation evidence reviewable.
- Reduce the risk of treating a tool label as proof of success.
- Preserve exact raw evidence while providing useful bounded projections.
Approach constraints
- Use Pi/OpenPI tool events and canonical results as the source of truth.
- Keep user-visible presentation, model-visible context, and persisted runtime evidence separate.
- Every renderer must have explicit byte/line/item bounds and a raw fallback.
- Never infer success, file identity, or changed lines from colors or display labels.
- Escape untrusted content and avoid executing rendered HTML, ANSI, links, or terminal control sequences.
- Unknown and future tools must continue to render safely through the generic path.
Acceptance criteria
- File-read evidence shows canonical path, line context, truncation, and recovery information.
- Write/edit evidence shows affected files and a bounded, reviewable diff when exact evidence exists.
- Test evidence distinguishes command, running/completed state, pass/fail/cancel, and failure excerpts.
- Terminal evidence supports bounded incremental output and exact terminal status.
- Each specialized view can reveal the sanitized raw arguments/result.
- Oversized and malformed results remain bounded and cannot break transcript rendering.
- Unknown tool types retain the current generic fallback.
- Snapshot, SSE replay, and reconnect produce stable renderer input.
- Protocol projection, UI rendering, accessibility, and browser tests cover each renderer.
- bun run check and bun run test pass.
Out of scope
- A browser code editor or filesystem explorer.
- Reimplementing tool execution in the UI.
- Treating presentation state as execution evidence.
Metadata
Metadata
Assignees
Labels
No labels
Activity
SSK988I commentedon Sep 2, 2026
认领
tt-a1i commentedon Sep 8, 2026
补充一个已实际复现、会阻断成果验收的缺口:模型给出的本地成果链接看起来可点击,但 Web 无法打开或下载对应文件。 这适合纳入本 Issue 的文件证据与产物呈现范围,或拆成关联的受控产物读取子任务;无需先建设完整文件浏览器或编辑器。
验证日期:2026-09-08;固定源码为
ed9dbc1018f890fd54375f5371990ddfee8af5df。使用干净的同提交 checkout、独立临时 Pi agent 目录,pi list唯一 OpenPI 来源与源码一致。Provider 仅为本地 HTTP 协议 fixture,没有调用付费模型或公开私人数据。实际复现
AUDIT_ARTIFACT,本地 fixture 返回指向该文件绝对路径的 Markdown 报告链接。结果:
[report](/tmp/project/report.pdf)变成http://127.0.0.1:<port>/tmp/project/report.pdf,./out/chart.png则变成站点/out/chart.png。invalid or missing token,HTTP 401。这里有两个连续缺口:普通链接导航没有客户端 API 请求的认证机制;即使解决认证,Host 也没有相应的受控文件/产物读取路由。
源码依据
safeUrl使用document.baseURI解析链接,随后以普通新标签链接渲染。建议补充的验收
这项缺口影响报告、生成页面、图片和代码成果的领取与核对;单独改善工具输出样式无法解决它。
tt-a1i commentedon Sep 8, 2026
补充社区实现机制,接上本 Issue 已复现的“报告文件存在,Web 链接却 401/404”的断点。
pi-studio@e04fc7a区分精确文件与目录 grant,canonicalize 后做权限判断,grant 数量有界;只读预览 watcher 绑定文件身份和内容 revision,变化后更新,失败保留上次可用内容。资源 registry、文件跟随预览。pi-markdown-preview@273bc5a进一步把启动中、正常、保留旧预览、清理失败都做成可观察状态,并把每 Session watcher 限到 8 个。状态、上限。建议最小切片:Session/workspace 归属的只读 artifact handle,先完成“生成报告 → 点击预览/下载 → 模型修改 → 看见新版本”。relative link 以产物目录解析,宿主处理认证;不把任意绝对路径变成 HTTP 文件服务。显示来源、当前文件版本、预览失败/旧版本,关闭 Session 清理 watcher。图片/PDF/HTML 可逐类增加,不要求先做完整文件编辑器。
若以后开放编辑,pi-studio 的expectedRevision 冲突检查是可借鉴的机制:外部改文件后明确 Reload/Save As/Overwrite 决策;不能用陈旧浏览器内容静默覆盖磁盘。这里只记录源码机制,不宣称消除了全部文件系统竞态。
本次未安装或运行第三方包。两项目 package.json 声明 MIT;pi-studio 0.9.60/Pi>=0.84.3,pi-markdown-preview 0.16.0 的 Pi peer 为
*,不能将其当全版本兼容保证。研究记录:Pi 社区能力研究与候选清单(2026-09-08)。源码证据、运行验证与采用决策分别记录。