Repository navigation
feat(web): expose read-only terminal session history - #397
Conversation
tt-a1i
left a comment
There was a problem hiding this comment.
The read-only terminal-history bridge is valuable, but its current discovery path introduces a P2 history-size-dependent workload on every page and preview. The inline finding was reproduced with real default Pi Session files; focused adapter/host tests pass42/42. Please correct the source-read boundary before merge. No author code was modified, and no installed/deployed performance measurement is claimed.
|
Source-read follow-up (2026-09-09). This PR is still the leftover file-history slice, not live attach. Status. OPEN, What this PR actually does. What it is not. Opening that JSONL later is history. It does not attach the Web Host to the TUI process that still has the file open. Background Terminal / Subagent / Workflow managers are process-local objects keyed by the live Relation to Please keep the P2 source-read fix on this PR (discover the selected workspace first; bound and cancel transcript work; prove unrelated workspace files are not parsed). Rebase onto current main after that. Do not expand the PR into live attach, and do not treat a future merge as “Web can see my running TUI |
|
Replacement-test follow-up (2026-09-09). Head still Must hold
Missing vs current 42/42 (single-fixture) tests — fail closed
Keep existing label / empty- |
|
Fixed and pushed as
|
|
Review follow-up pushed as |
tt-a1i
left a comment
There was a problem hiding this comment.
Reviewed exact head 11348ee.
This is a useful read-only backend seam for terminal Session history, and the earlier global-history scan, cross-workspace exposure, and unbounded transcript accumulation are fixed. I found no P0/P1. Two P2 correctness/boundedness issues remain:
- The 256 KiB prefix is presented as complete metadata. I reproduced a valid 581,477-byte Session with 2,201 messages being reported as 996; a later session_info rename was omitted and an exact search for that name returned zero results. Expose truncation/approximation explicitly or derive correct bounded metadata.
- Discovery readdir/stat calls are not fully bounded: all .jsonl entries are statted concurrently before WEB_MAX_SESSIONS is applied. Filesystem calls and memory still scale with the whole directory.
Focused exact-head tests pass 44/44 and required CI is green. I am not auto-merging because this changes core Session-history discovery and identity semantics; the remaining P2s directly affect the feature contract, and there is not yet user-facing browser acceptance.
# Conflicts: # web/adapter/pi-adapter.ts # web/host/web-host.ts
tt-a1i
left a comment
There was a problem hiding this comment.
Reviewed repaired head de53388. Standards and Spec: the scoped P2 findings are addressed; no remaining P0/P1 or actionable small defect identified. Repository check and full-suite evidence are recorded in this review batch; targeted regressions cover the repair where applicable. This replaces my earlier findings against the old implementation. I pushed the repair, so this approval does not constitute the independent approval required after the last push. Current-head CI, current-main integration, and that independent approval remain merge gates.
Adds authenticated, workspace-scoped read-only discovery and preview of default Pi terminal Session history for #347. It does not activate, copy, attach to, or mutate those Sessions.
Directory iteration and file work stop at 500 entries, with files processed sequentially and at most 256 KiB of metadata read per file. Lists expose
partial; both list rows and detail responses exposemetadataPartialwhen prefix-derived metadata may be incomplete. A negative query result therefore does not claim complete history coverage. Preview retains the existing compaction-aware message/byte limits and request/Host cancellation.Validation:
bun run checkand the full Node 22bun run testpassed. Focused adapter/Host tests passed 46 cases; added regressions cover large-file metadata incompleteness in list/detail/search and bounded directory traversal. Integration preserves current archived Session routes. No installed TUI/live-attach acceptance was performed. Current hosted CI and post-push independent approval gate merge.