Repository navigation
fix(runtime): save a windowless host's chat tabs in its layout - #28354
Conversation
Claude-Session: p2-headless
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Merge Risk: 🔵 Low · up to
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
18ee504e-463d-4382-ae48-d9676ee446a1
📒 Files selected for processing (5)
config/main-layout-writer-baseline.txtsrc/main/runtime/agent-session-tab-layout.tssrc/main/runtime/orca-runtime-close-structured-agent-session-tab.tssrc/main/runtime/orca-runtime-restore-structured-agent-session-tabs-once.tssrc/main/runtime/structured-agent-session-windowless-layout.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
… which every close reaches Claude-Session: p2-headless
Claude-Session: p2-headless
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
745c1227-eed4-42f6-b1cc-3a1353265496
📒 Files selected for processing (3)
src/main/runtime/orca-runtime-close-structured-agent-session-tab.tssrc/main/runtime/orca-runtime-restore-structured-agent-session-tabs-once.tssrc/main/runtime/structured-agent-session-windowless-layout-host.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
…oject Claude-Session: p2-headless
…l holds it Claude-Session: p2-headless
…ut module Claude-Session: p2-headless
…titions Claude-Session: p2-headless
Review pass: the saved tab reuses the id status and attention address, the close checks for a window before scanning partitions, and the host tests seed readable records with unreadable, other-host and no-index cases. Claude-Session: p2-headless
Claude-Session: p2-headless
The window's existing-tab lookup moves to the shared projection so the windowless-layout test exercises it without importing the renderer. Claude-Session: p2-headless
Drops the shared lookup added for the test; two functions already carry that name. Claude-Session: p2-headless
…at host Claude-Session: p2-headless
…e local partition A desktop mirrors a remote server's chats into that server's runtime partition without a host stamp; the startup sweep must not delete them. Claude-Session: p2-headless
…rtition only Chats run only on local hosts, so their saved tabs live in the local partition: the cross-partition listing and its writer go. Open and close share one layout load, the startup fill and sweep become one function beside the index seed, and the tab filter is the existing savedSessionId. Claude-Session: p2-headless
ELI5
On a computer running Orca without a window (a server that phones and other desktops connect to), chat tabs were remembered only in the chat system's own list, not in the saved tab layout that holds every other tab. This change also saves them in the layout, so the layout is a complete record of the host's tabs.
What Changed
agent-session:<session id>). A host with a window is untouched; the window saves its own layout, chat tabs included.openAgentSessionTab,closeTabs), applied in one layout load per worktree and written through the runtime's existing per-worktree session writer. At startup, one function beside the chat index seed works out every open and close that makes the saved chat tabs match the index. "This host's saved chat tab" is the existingsavedSessionIdrule the startup restore already uses. That rule no longer skips Claude chats: the skip predates Claude structured chats, so a saved Claude chat is now restored, and its tab removed when it closes, like any other. Closing hangs on the chat system's "tab hidden" notice, which every close path already sends once its close settles, and removes the tab only if the chat system's list no longer has the chat.Why
The windowless tab list is moving to be built from the saved layout, as a window builds its own. Without this, chats would disappear from that list. Saving the tab at the same points that already record a chat as open or closed keeps the layout and the chat system's list in step, so the startup fill cannot bring back a closed chat.
Alternatives considered:
Linked Issue
N/A (maintainer; part of the single saved-layout work).
Visual Proof
N/A: no visible change. The tab list clients receive is unchanged; only the saved layout gains the chat tabs.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
structured-agent-session-windowless-layout.test.ts:structured-agent-session-<session id>, or the id the chat host already reserved (fails if the id is minted fresh);structured-agent-session-windowless-layout-host.test.ts, against a real chat host:setSessionTabVisibility(false)) reaches the runtime and removes only that chat's saved tab;saved-structured-agent-session-restoration.test.ts: a saved Claude chat is a restore target (fails with the old Claude skip).Targeted unit tests for the files above and
src/shared/workspace-layoutpass; typecheck and the changed-code gates pass.Earlier heads ran targeted e2e (headless layout oracle, old phone on a new server, remote chat focus, chat quit and resume) against main at the same base; not re-run on this head.
AI Disclosure
Review
Agent skill upstream boundary
Notes
orca-runtime-close-structured-agent-session-tab.ts), counted in the baseline. The change is already built as shared layout commands; the write moves to the runtime's layout command channel when that lands.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)