Repository navigation
fix(terminal): seed list preview from daemon snapshots after restart (STA-4326) - #15679
brennanb2025 wants to merge 2 commits into
Conversation
…(STA-4326) `orca terminal list` reported lastOutputAt:null and preview:"" for local daemon PTYs this main never attached to, because inventory recorded the session at construction defaults and only onPtyData wrote those fields. Seed the listing once from the same provider snapshot `terminal read` already consults. Do not fabricate recency; if the snapshot cannot be consulted, list activityObservation:unverifiable instead of pretending the pane was idle.
|
Warning Review limit reached
Next review available in: 8 minutes Limit details: You’ve used all 10 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?Wait for the limit to reset, then comment An organization admin can change what happens after included review limits in Billing. How do review limits work?CodeRabbit enforces per-developer PR review limits within each organization. For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Listing seed wrote the shared restore tail at 24 rows, spending the one-shot seed and blocking the legacy provider-reveal's own 120-row fetch. Store listing preview in a listing-only field, seed from listTerminals rather than shared inventory, and skip recovered legacy workers so they keep their own serialize.
ELI5
After Orca restarts,
orca terminal listsaid a still-running agent pane had never produced output, whileorca terminal readof the same pane showed the live TUI. List was looking at a blank in-memory notepad this process never wrote to. It now copies a small screen snapshot from the daemon that kept the pane alive, once, when listing rediscovers that pane. That listing snapshot is a short preview only — it does not steal the deeper scrollbackterminal readand legacy worker reveal still fetch.What Changed
listTerminalsseeds a listing-only preview from a 24-row provider snapshot for never-attached local daemon PTYs. It does not write the shared restore tail.lastOutputAtis not invented from that snapshot. Snapshot bytes are historical screen state, not a recency event.activityObservation: "unverifiable"and leaveslastOutputAtnull. That is not idle and not exited.Why
onPtyDatawas the only writer oflastOutputAt/preview. A pane whose PTY survived restart is discovered only through controller inventory, so this main never attached and never ingested a byte.terminal readalready fell back to the provider snapshot;terminal listdid not. Callers treat a nulllastOutputAtas idle/dead and conclude a live worker is finished.A first version of this seed wrote the shared restore tail. That spent the one-shot restore budget at 24 rows, so the legacy provider-reveal never issued its own 120-row fetch and the revealed worker showed a truncated scrollback. Listing preview and restore tail are different products with different depths; they stay separate.
Linked Issue
Fixes #14523
Linear: STA-4326
Visual Proof
N/A — CLI listing contract in the main process. No layout, chrome, or renderer styling change.
Testing
Commands:
Legacy-worker reveal (
serializeProviderBufferat 120 rows), unmodified expectation:toHaveBeenCalledWith('pty-legacy', { scrollbackRows: 120 })received{ scrollbackRows: 24 }, number of calls: 1.Listing seed suite (5 tests):
preview: "";activityObservationabsent.readstill fetches at 120 rows.Covered: (a) never-attached PTY reports the provider screen through
list; (b) attached PTY with live bytes is unchanged and does not callserializeProviderBuffer; (c) missing snapshot isactivityObservation: unverifiablewithlastOutputAtstill null; (d) four unattached rows seed once, the attached row is skipped, and a secondlistdoes not round-trip again; (e) listing seed does not consume the restore-tail budget.pnpm typecheckpassed. Changed-code quality gate passed since4e058d4a52ea.Review
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
lastOutputAtafter this change: epoch ms of the last byte this main ingested viaonPtyData. Null means this main has not ingested live output — not idle, not exited, and never a synthesized snapshot timestamp. A seeded listingpreviewis retained screen.activityObservation: "unverifiable"means the provider snapshot could not be asked; inventory still proved the PTY live.SSH-scoped PTYs are not seeded here (they have their own lease/reattach path). Folder workspaces use the same inventory record. New optional JSON field only; old clients ignore it. No new stream opcode.
Author: @BrennanKB5
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)