Conversation
tt-a1i
left a comment
There was a problem hiding this comment.
审查提交:9d95088b2958474180829b887ac97f5549fe91b3。
需要修改后再合并。
具体问题
P2 — 终端历史请求未绑定浏览器选择的工作区 · web/ui/src/protocol/client.ts:290
SessionHistory depends on selectedWorkspace but terminalSessions sends only search query/cursor; host adapter uses runtime.cwd. Composer setWorkspace changes browser draft only. Selecting another workspace before creating a Session therefore lists old runtime workspace records; list accepts wrong-cwd rows, while detail rejects them. Added UI repro at exact head confirms /repo rows render with workspace=/other.
验证范围
Full production/test diff reviewed; 47 existing UI tests pass and 4-test supplemental reproduction passes, including wrong-workspace rendering. Request/host/store path traced.
限制与后续
No interactive browser/native-history run. E2E additions stub list/detail API; they do not cover browser draft workspace vs runtime cwd divergence.
Problem
The archived sidebar only filtered the bounded snapshot (500 Sessions), so older archives could not be found or restored there. The existing read-only terminal Pi history endpoint had no Web entry point. Refs #347; deletion/fork and full transcript recovery remain separate work.
Value
Users can page through older archives and inspect compatible terminal Pi Sessions without transferring control or copying their history into Web storage. Empty, failed, partial-scan, and end-of-history states are explicit.
Approach
Validation
bun run checkpassed (Node 24 toolchain, basef6b49ae59605b1276b8267f2886d22c03f01533c).bun run testpassed: Node 1658 passed/1 skipped; Vitest 223 passed.playwright test --config tests/web/playwright.config.ts tests/web/openpi-web.e2e.tspassed 35/35, including multi-page archive discovery, restore/failure, read-only terminal preview and 390/1280px layout.pi listreported a single OpenPI source at this checkout; the package was not installed into the user Pi agent dir.Impact