Repository navigation
Conversation
Jinwoo-H
force-pushed
the
layout/pr6-6c
branch
from
October 12, 2026 15:50
699b989 to
c395a8e
Compare
Jinwoo-H
force-pushed
the
layout/pr6-6d
branch
from
October 12, 2026 16:14
33559f5 to
a805a2f
Compare
Delete the runtime's window layout relays (create, split, focus, rename, close, reveal, mount, move, session tab create/close) and their preload listeners; the runtime's layout is the one path.
…ch; Q4 legacy recovery tests; drop unplaced sleeping records; clear #7587 leftovers
…ted leaves; phone create navigates; offscreen browser pages only without a window; forget settled launch prompts; dead code
… an empty workspace (plan O2)
Jinwoo-H
force-pushed
the
layout/pr6-6d
branch
from
October 12, 2026 16:47
a805a2f to
778a708
Compare
5 of 9 tasks
9 tasks done
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of the PR 6 stack; merged as one unit, do not merge alone.
ELI5
Until now, when a phone, the CLI or an agent asked for a new terminal, a split, a close, a rename or a focus change, the main process asked the desktop window to do it, and only did it itself when no window was open. This slice deletes those requests: the main process's own copy of the layout (added in 6a) now makes every such change, with or without a window. The window catches up in later slices (6f draws what the runtime holds, 6g stops saving its own copy).
What Changed
activateWorktree. Their preload listeners and renderer bridges are gone, with the code that only served them (mount waits, the [Bug]: Creating a Claude tab from mobile spawns it on the desktop, then reaps it ~10s later — mobile tab creation broken #7587 create rescue, close-relay acks, the focus coalescer).terminal.createalways spawns in the runtime; a create naming no workspace opens in the one the desktop view shows. A terminal a phone creates and activates moves the desktop view to it, as main'sfocusTerminaldid.terminal.splitsplits the PTY the handle names, including a window terminal's leaf handle. A split addressed by a leaf handle does not move the desktop (main's window split did not either) and returns the pane's realpaneRuntimeId. A leaf whose terminal is not running yet is split in the layout and the new pane starts; a split that passes a command or env to such a leaf is refused (terminal_handle_stale).navigateframe (focusTab,focusPane,revealWorkspace).proceed,not-started,unconfirmed,withdrawn) is a layout transition (agentLaunchPaneSet).legacyWorkerRecovered) followed by a durable write.invalid_tab_order.sessionProfileIdis a saved layout field, sobrowser tab set-profileis now a layout command (layout.setBrowserTabProfile {workspace, tabId, profileId}, with today's checks: the profile must exist,defaultfalls back to the default profile, the page's tab must be held). The window round trip (browser:requestTabSetProfile, its preload listener and renderer bridge) is deleted.--activate(plan O2). A deliberately activated, empty workspace (no startup agent, default tabs or setup) opens the user's default agent as a chat, by the window's own rule (empty-workspace-default-agent-chat.ts): chat tabs on, default notblank, the default or a detected agent, a structured session the host can create, else the shell. The window ran this rule only when the user opened a workspace; the runtime now runs it forworktree create --activate, with or without a window.pane-says).ui:focusTerminal,ui:focusEditorTab,ui:activateWorktree(notification clicks) and sleep/resume stay.Why
The plan makes the runtime's layout the only writer. As long as the runtime asked the window first, every flow had two implementations that drifted apart (the window path and the headless path) and every bug had to be fixed twice. Deleting the window side, rather than keeping it behind a flag, leaves one path to review and test. Clients of every version keep talking to the runtime the same way.
Linked Issue
Part of the terminal topology / PR 6 stack.
Visual Proof
N/A: until 6f the window does not draw runtime-created tabs, so this slice is not meant to be used alone (see Review).
Testing
pnpm tc, oxlint on changed files,check:code-quality:changed,check-compat-boundary-imports,check-layout-writer-ratchets(baseline pruned) pass.vitest --config config/vitest.config.tsoversrc/main,src/shared,src/preload,src/rendererandtests/e2e, on this branch and on the 6c head699b989f92e, compared test by test: no new failures. The tests that fail on both are local-environment ones (fish profile, zsh live shell, packaged CLI assets, browser-manager identity/viewport,relay-region-correction). One test inruntime-environment-preference.test.tsfailed once under the full run and passes on 3 reruns; this PR does not touch it.CI e2e: per the plan (§2), unit and static checks gate this slice and e2e gates the stack top. Each failing spec on head
778a7083e24(the same set asdbc14ffc5cdand5f8e3d5bf77), with its failing assertion:client-reorder-tabs,cli-create-rename-close,client-create-split-close,two-clients-create-close(tests/e2e/workspace-layout-oracle.spec.ts:510): oracle "view" findings, e.g. "runtime order [...] but drawn [...]", "runtime terminal tab ... has no drawn tab", "runtime group ... is not drawn". The oracle compares the runtime's layout with the window's DOM; the window does not draw runtime changes until 6f.cli-split(:226) andold-client-pane-tree(:374): "Expected 2 visible terminal panes" inwaitForBoundPanes, which counts panes in the window's DOM. The split happened in the runtime.host-navigation(:323): the window's tab strip must mark the focused tab active; the runtime sent thefocusTabnavigate frame, which the window follows from 6f.setup-split-first-activation(:510):group_id_changed. The runtime provisions the setup terminals in its group, then the window's first activation saves its own group over it (the window saves until 6g).terminal-parked-cli-split.spec.ts:258: "CLI did not remount its parked target", which reads the window's mounted pane managers. Its "active tab unchanged" assertion holds once 6f draws the split: a leaf-handle split no longer moves the desktop.paired-remote-terminal-serve-restart-binding.spec.tspasses on778a7083e24(fixed in 6c381552ab581).Headless layout oracle (
workspace-layout-oracle-headless.spec.ts, orcad and electron serve): 18/18 pass ondbc14ffc5cdand5f8e3d5bf77.ssh-orcad-terminal-root-ownerfailed once and passed on the next run.Tests of deleted window round trips were deleted. Tests of the behaviour they guarded were rewritten against the runtime's layout (pane-close no-widening, paired close stays closed, phone-created terminal stays listed, old-client reorder with a hidden chat and a stale browser page, legacy worker durability ordering). New: a CLI create
--activatewith a default agent configured gets that agent's chat (and a shell with chat tabs off), the default-chat rule, a phone-created terminal moving the desktop, a leaf-handle split leaving the desktop where it is, a split of a leaf whose terminal has not started, a serve's window taking browser pages, launch prompts forgotten once settled,legacyWorkerRecoveredandagentLaunchPaneSettransitions, the launch tab show/verdict,setBrowserTabProfile(pure command; with no window it updates the model and survives a save and reload), a CLI split on a window leaf handle, and the unplaced sleeping record drop.I manually tested these changes locally
Automated tests added/updated, or explained why not below
Review
Incomplete until later slices
navigateframes. A terminal created from a phone or the CLI exists in the runtime and on phones but not in the window.browser tab set-profilechanges the saved profile; the window remounts the tab's webviews when it reacts to the frame.notifier.resumeSleepingAgentsstay untillayout.wakelands.runtime:server workspace can be refused withworkspace_not_found.setTabPropsandupdatePaneLayout(main made them no-ops with a window); an agent-session close; a legacy worker'sexitedretire and its sleeping-record clear.waitForTabRegistration, because the window mounts no webview until 6f (the wait is old code).not-startedinstead of explaining in the pane. The hold's other releases were in the deleted publish relays; the window path moves in 6g.agent launchwhose agent did not start no longer offers "Copy prompt" in the window (see below).Decisions and behaviour changes
terminal.create(no window to reveal in) returnedsurface: 'background'with "Terminal X is running, but Orca could not make it discoverable. Runorca terminal focus --terminal X…" (6corca-runtime-create-terminal.ts:246-271), and the CLI printedCreated terminal … [background]plus that warning (src/cli/terminal-format.ts:230-235); with a window it returnedvisible. After: every create returnsvisibleunless it asked for background, with no warning (orca-runtime-create-terminal.ts~248). The tab is in the runtime's layout, which every client reads, so it is discoverable everywhere; from 6d to 6f the window does not draw it.agent launchwith a prompt whose agent did not start showed a pane notice with a "Copy prompt" button (AgentLaunchPaneNotice.tsx:19-36); the window remembered the prompt in its publish relay (6cagent-launch-tab-publication.ts:80-82, ~120-122). After: launches started in the window still remember it and now forget it once settled unless the pane offers it (agent-launch-through-host.ts); remote launches have no window relay, and the prompt is session-only and not in the layout (agent-launch-pane-prompt.ts:1-5), so their notice has no prompt to copy. 6f can carry it as an unsaved per-pane fact on the published frame.--activatenow opens the default agent chat in the runtime (O2, above). Main never did this for a CLI activation (it activated withoutseedUserDefaultSurface), and a headless host used to get a shell; it now gets the chat by the same rule.host-session-tab-target.tsis kept: the keptui:focusEditorTablistener imports it.invalid_tab_orderinstead ofduplicate_tab_order, the code the headless path always gave.Agent skill upstream boundary
Notes
Wire: no new methods or fields. Old clients keep their
session.tabs.*andterminal.*calls; the runtime now answers them from its own layout. SSH: closes and creates onssh:workspaces go through the same runtime path that served windowless hosts. Mobile: phones read the same projection as in 6c.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)