Repository navigation
A chat started in a server workspace drawn from the server's layout stays where you opened it (switch-on builds only) - #32003
Conversation
…drawn workspace survive the server's frames (switch-on) A tab the server's layout never lists (a client-hosted browser tab today; any kind recorded the same way) used to vanish on the server's next frame rebuild. This desktop now records such tabs by server and workspace, in its localStorage only (never a session field nor sent), and the server's frame builds keep them as drawn, inside the server's own groups: - A held tab drawn in a group the server lacks moves to the nearest server group; it shows there only if the user was on it, and the user's group follows it. The group tree stays the server's. - The record forgets an id once the server's frame lists it, on close, and on worktree removal, and prunes ids the restored session no longer has before the first frame after a reload. - A held tab's drag moves it here only (no session.tabs.move); it offers no new split, and a server tab sharing its group counts only the server's tabs for split no-ops. - Client-hosted staging records its tab (both ids) in layout-owner builds; restage takes the worktree from its caller instead of scanning the store.
…tch off; clearer names - With the switch off the record is never read, kept or written (a single gate in the record). - The frame-drawn check is isDesktopCreatedTabInFrameDrawnServerWorkspace in frame-drawn-desktop-created-tabs.ts: "held" stays the frame hold's word. - The held-tab placement drops its unread activeGroupId; the group follow derives it.
…ens a created chat's tab where the creating client asked, in its own group and tab ids
…client place at the end of the remembered active group, as before (test only)
…ut: the frames hold its provisional tab until the server lists it, and the create names its group and the server tab before it (layout-owner build only)
…named; the server-layout read moves to one e2e helper (test only)
…yout rule's comment names the client's place first
… and the windowless save passes its chat through, so no file passes its line limit; the placement test types its mocks without assertions
…chat-place-on-core # Conflicts: # src/renderer/src/components/tab-group/tab-group-layout-owner-commands.ts # src/renderer/src/runtime/server-layout-frames-held-tabs.test.ts
…chat-place-on-core # Conflicts: # tests/e2e/paired-desktop-server-layout-frames.spec.ts
|
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: ⚪ Minimal · up to
|
…e, which also skips tabs the server's frames do not hold
… snapshot still names its group; the layout-owner e2e list runs the placement spec
… tab place, so every other create keeps its timing (the eager History joiner after an early terminal close opens again)
There was a problem hiding this comment.
🧹 Nitpick comments: 1
tests/e2e/headless-serve-chat-tab-placement.spec.ts: 1
72-93: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winRun this assertion through the paired Electron chat-launch path.
The test calls
host.client.call('agentSession.create', ...)and suppliestabPlacementitself. It therefore bypasses renderer group lookup, server-tab projection, capability gating, and placement injection. A regression in those steps can leave this test passing.Launch the paired Electron client with
launchPairedElectronClient, arrange the frame-drawn workspace, then use the tab-bar agent menu's chat row.QuickLaunchAgentMenuItemsinvokeslaunchAgentInNewTabwith the selected group and chat surface. Keep the server-layout assertion, but remove the direct RPC and caller-suppliedtabPlacement.
ℹ️ Review info
⚙️ Run configuration
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
cfb81180-c86e-45bd-bc53-ba59f666db82
📒 Files selected for processing: 2
src/renderer/src/lib/frame-drawn-chat-tab-placement.tssrc/renderer/src/lib/structured-agent-session-launch-create-call.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
… so an eager History joiner's create is still sent
…not compile; name the probe that fills the cache
…chat-place-on-core # Conflicts: # .github/workflows/layout-owner-e2e.yml
ELI5
With the layout-owner build switch on (off in every shipped build), a desktop paired to an Orca server draws that server's workspaces from the server's layout updates ("frames"). Starting a chat in such a workspace showed the new chat's tab where you asked, then any frame that arrived before the server saved the chat removed it, and it came back at the end of the group: a flicker and a jump. Now the tab stays where you opened it, and the server saves it there.
Builds on L273-core (#31853, merged), whose "created on this desktop" hold this reuses.
What Changed
agentSession.create). A new optionaltabPlacement(groupId,afterTabId, in the server's own ids) tells the server where the creating client put the chat. One rule decides the tab's place for both the switch-on layout queue and the switch-off windowless save (chatTabLayoutCommand): the client's group if the workspace still has it, else the remembered active group; afterafterTabIdonly if that tab is in the chosen group.agentSession.create.tab-placement.v1.frame-drawn-chat-tab-placement.ts, switch-on only, in a workspace a paired server's frames draw):tabPlacementwhen the host has the capability.Why
The server owns the layout of its workspaces, so the place has to travel with the create rather than be fixed up on the desktop afterwards. Reusing the created-here hold keeps one mechanism for "a tab this desktop made that the server does not list yet" instead of a second chat-only hold.
Linked Issue
Internal (terminal-layout final design; ledger L270).
Visual Proof
N/A: dark path behind a build switch that is off in shipped builds. Covered by the e2e spec and unit tests below.
Testing
E2e:
headless-serve-chat-tab-placement.spec.ts(new), run switch-on: a client's create naming the first of two terminals lands the chat between them. It passes at head and fails at base, where the host advertises no placement capability. The two specs moved to the shared helper (paired-desktop-server-layout-frames,paired-desktop-server-file-open-group) pass at head.Unit: the placement rule (3 of 4 tests fail without it), the create handler forwarding the place outside the fingerprint, and the desktop side (
frame-drawn-chat-tab-placement.test.ts: group plus preceding server tab skipping held tabs; group alone; capability false or unknown; not frame-drawn; the hold).Eager History joiner:
cli-chat-resume-run.test.tsruns the "terminal closes before create, then an eager History joiner" case on the frame-drawn path too, and checks its create is sent with the place. It failed when the placement awaited the host and passes now.Switch-off pin: a switch-off windowless host saving a chat with no client place puts it at the end of the remembered active group, as before (passes at base and head).
Server specs (switch-on build at head 36bd87c): tab-composition, layout-frames, focused-terminal-create, layout-intents, client-hosted-browser and the new chat-placement spec all pass.
Per-test comparison (src/main/runtime, src/shared/rpc-contract, src/renderer/src/lib, src/renderer/src/runtime/server-layout-apply, src/renderer/src/components/tab-bar; run-vitest with the pinned Bun 1.4.3), head d73d889 against base main 4dd97f0:
orca-runtime.test.ts, which fail at base too.After merging main e710e89 (the only overlap was the e2e workflow's spec list; both additions kept): typecheck, the static gate, and the 727 tests around the changed files pass switch-on and switch-off.
Static gate: every pr.yml static step passes.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Review
Independent reviews: no correctness bugs. A later review found the eager History joiner could lose its create on the frame-drawn path (the placement awaited the host); fixed by reading the cached capability synchronously, with a test. The main merge's resolution was reviewed clean.
Agent skill upstream boundary
Notes
agentSession.create.tab-placement.v1); a switch-off host with no placement saves the chat exactly as before.agentSession.createis a strict object, so an older host refuses a create carrying an unknown field. The desktop therefore sendstabPlacementonly to a host advertisingagentSession.create.tab-placement.v1(a failed probe counts as unsupported); an older host without the capability gets today's placement. Older clients never send it.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)