Repository navigation
Create workspaces through one host path and open on the agent - #31255
brennanb2025 wants to merge 75 commits into
Conversation
|
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:
Walkthrough
Merge Risk:
|
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:
191ad5ef-869c-4b9d-830f-fb796b446c2b
📒 Files selected for processing: 46
mobile/src/session/active-session-tab.tsmobile/src/session/session-tab-snapshot-gate.tsmobile/src/session/use-mobile-session-tab-application-launch.test.tsmobile/src/session/use-mobile-session-tab-application.tssrc/main/runtime/client-session-tab-selection.test.tssrc/main/runtime/client-session-tab-selection.tssrc/main/runtime/rpc/methods/agent-launch-caller-selection.test.tssrc/main/runtime/rpc/methods/agent-launch-surfaces.tssrc/main/runtime/rpc/methods/agent-launch.test.tssrc/main/runtime/rpc/methods/structured-agent-session.test.tssrc/main/runtime/session-lifecycle/projection/build-headless-mobile-session-browser-tabs.tssrc/renderer/src/components/dashboard/launch-dashboard-agent.tssrc/renderer/src/components/right-sidebar/runSourceControlAgentActionStart.tssrc/renderer/src/components/right-sidebar/source-control/ai/recovery-launch.tssrc/renderer/src/components/right-sidebar/source-control/sync/use-git-history-commit-actions.tssrc/renderer/src/components/tab-bar/QuickLaunchButton.tsxsrc/renderer/src/components/tab-group/useTabGroupActivationCommands.tssrc/renderer/src/components/tab-group/useTabGroupCreationCommands.tssrc/renderer/src/components/tab-group/useTabGroupWorkspaceModel.focus.test.tssrc/renderer/src/components/terminal-pane/terminal-agent-session-fork.tssrc/renderer/src/components/terminal/terminal-tab-create.tssrc/renderer/src/components/use-terminal-create-actions.tssrc/renderer/src/hooks/ipc-tab-switch.tssrc/renderer/src/lib/fix-checks-agent-launch.tssrc/renderer/src/lib/run-quick-command-in-new-tab.tssrc/renderer/src/lib/tab-number-shortcuts.tssrc/renderer/src/lib/workspace-session-unified-tabs.tssrc/renderer/src/lib/workspace-tab-palette-activation.test.tssrc/renderer/src/lib/workspace-tab-palette-activation.tssrc/renderer/src/runtime/web-session-tabs-sync/apply-preparation-base.tssrc/renderer/src/runtime/web-session-tabs-sync/state.tssrc/renderer/src/runtime/workspace-layout-frame-builds.tssrc/renderer/src/store/slices/browser/browser-tab-actions.tssrc/renderer/src/store/slices/editor/actions/markdown-preview-actions.tssrc/renderer/src/store/slices/editor/actions/open-file-action.tssrc/renderer/src/store/slices/tabs/create-tabs-slice.tssrc/renderer/src/store/slices/tabs/desktop-tab-choice.test.tssrc/renderer/src/store/slices/tabs/desktop-tab-choice.tssrc/renderer/src/store/slices/tabs/tabs-reconciliation.tssrc/renderer/src/store/slices/tabs/tabs-session-actions.tssrc/renderer/src/store/slices/tabs/tabs-slice-contract.tssrc/renderer/src/store/terminals/terminal-active-workspace-creation.tssrc/renderer/src/store/terminals/terminal-tab-creation.tssrc/renderer/src/store/workspace-layout-frame-slices.tssrc/shared/workspace-creation-tab.tssrc/shared/worktree/types.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
There was a problem hiding this comment.
Actionable comments posted: 3
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
521162d1-2747-4fa0-999d-4fa07ee3f8e2
📒 Files selected for processing: 45
mobile/src/session/active-session-tab.tsmobile/src/session/session-read-reply-schema.tsmobile/src/session/use-mobile-session-tab-application-launch.test.tsmobile/src/session/use-mobile-session-tab-application.tssrc/main/runtime/client-session-tab-selection.test.tssrc/main/runtime/client-session-tab-selection.tssrc/main/runtime/session-lifecycle/projection/build-headless-mobile-session-browser-tabs.tssrc/main/runtime/session-lifecycle/projection/client-session-tab-projection.tssrc/renderer/src/components/tab-group/useTabGroupActivationCommands.tssrc/renderer/src/components/tab-group/useTabGroupCreationCommands.tssrc/renderer/src/components/terminal/terminal-tab-create.tssrc/renderer/src/components/use-terminal-create-actions.tssrc/renderer/src/hooks/ipc-events/content-creation-ipc-bridge.tssrc/renderer/src/hooks/ipc-tab-switch.tssrc/renderer/src/lib/browser-workspace-tab-activation.tssrc/renderer/src/lib/launch-agent-in-new-tab.tssrc/renderer/src/lib/launch-agent-structured-chat-guard.test.tssrc/renderer/src/lib/launch-agent-tab-choice.tssrc/renderer/src/lib/open-mobile-emulator-tab.test.tssrc/renderer/src/lib/open-mobile-emulator-tab.tssrc/renderer/src/lib/simulator-tab-palette-activation.tssrc/renderer/src/lib/tab-number-shortcuts.tssrc/renderer/src/lib/workspace-session-terminal-tabs.tssrc/renderer/src/lib/workspace-session-unified-tabs.tssrc/renderer/src/lib/workspace-session.tssrc/renderer/src/lib/workspace-tab-commands.tssrc/renderer/src/lib/workspace-tab-palette-activation.test.tssrc/renderer/src/lib/workspace-tab-palette-activation.tssrc/renderer/src/runtime/web-session-tabs-sync/apply-final-patch.tssrc/renderer/src/runtime/web-session-tabs-sync/apply-preparation-base.tssrc/renderer/src/runtime/web-session-tabs-sync/state.tssrc/renderer/src/store/slices/browser/browser-tab-actions.tssrc/renderer/src/store/slices/editor/actions/open-file-action.tssrc/renderer/src/store/slices/tabs/create-tabs-slice.tssrc/renderer/src/store/slices/tabs/desktop-tab-choice.test.tssrc/renderer/src/store/slices/tabs/desktop-tab-choice.tssrc/renderer/src/store/slices/tabs/tabs-close-actions.tssrc/renderer/src/store/slices/tabs/tabs-reconciliation.tssrc/renderer/src/store/slices/tabs/tabs-session-actions.tssrc/renderer/src/store/slices/tabs/tabs-slice-contract.tssrc/renderer/src/store/terminals/terminal-active-workspace-creation.tssrc/renderer/src/store/terminals/terminal-tab-creation.tssrc/renderer/src/store/workspace-layout-frame-slices.tssrc/renderer/src/store/workspace-layout-frame-store-view.tssrc/shared/workspace-layout/workspace-layout-save.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
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:
77dbd619-bf0a-4543-9fa3-365eaf5c0fa9
📒 Files selected for processing: 3
src/renderer/src/lib/launch-agent-in-new-tab.tssrc/renderer/src/lib/launch-agent-tab-choice.tssrc/shared/workspace-creation-tab.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.
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
dd005faa-e6d5-42c4-8031-277abaf37f67
📒 Files selected for processing: 63
src/main/agent-launch/agent-launch-created-workspace.tssrc/main/agent-launch/agent-launch-executor.tssrc/main/agent-launch/agent-launch-initial-surface.test.tssrc/main/agent-launch/agent-launch-prompt-delivery.tssrc/main/agent-launch/agent-launch-surface-creation.tssrc/main/agent-launch/agent-launch-surface-factories.tssrc/main/automations/headless-automation-agent-launch.tssrc/main/runtime/created-mobile-session-tab-caller-selection.test.tssrc/main/runtime/rpc/methods/agent-launch-surfaces.tssrc/main/runtime/rpc/methods/agent-launch-worktree-creation.tssrc/main/runtime/rpc/methods/agent-launch.test-fixture.tssrc/main/runtime/rpc/methods/agent-launch.test.tssrc/main/runtime/rpc/methods/agent-launch.tssrc/main/runtime/rpc/methods/orchestration/federation/federated-worker-agent-launch.test.tssrc/main/runtime/rpc/methods/orchestration/federation/federated-worker-agent-launch.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-start-agent-placement.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-topology.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-worktree-creation.tssrc/main/runtime/rpc/methods/worktree-create-args.tssrc/main/runtime/runtime-folder-worktree-create.tssrc/main/runtime/runtime-local-worktree-terminal-startup.tssrc/main/runtime/runtime-managed-worktree-create-types.tssrc/main/runtime/runtime-notifier-contract.tssrc/main/runtime/runtime-terminal-contracts.tssrc/main/runtime/runtime-worktree-initial-surface.tssrc/main/runtime/session-tabs/pty-backed-session-publication.tssrc/main/runtime/session-tabs/structured-session-tab-restoration.tssrc/main/runtime/terminal/launch/terminal-create-deduplication.tssrc/main/runtime/terminal/launch/terminal-create-reveal.tssrc/main/runtime/terminal/launch/terminal-create.tssrc/main/runtime/workspaces/startup/workspace-terminal-provisioning.tssrc/main/runtime/workspaces/workspace-creation.tssrc/main/runtime/workspaces/workspace-removal-target.tssrc/main/window/runtime-window-lifecycle.tssrc/main/workspace-create-telemetry.tssrc/preload/api/ui-bridge-terminal-and-session-tabs.tssrc/preload/api/ui-command-event-api.tssrc/renderer/src/hooks/ipc-events/terminal-presentation-ipc-bridge.tssrc/renderer/src/hooks/ipc-events/terminal-tab-mount-ipc-bridge.tssrc/renderer/src/lib/pending-worktree-creation.tssrc/renderer/src/lib/web-runtime-worktree-initial-surface.test.tssrc/renderer/src/lib/web-runtime-worktree-initial-surface.tssrc/renderer/src/lib/web-runtime-worktree-terminal-after-wake.tssrc/renderer/src/lib/worktree-activation-created-agent.test.tssrc/renderer/src/lib/worktree-activation-empty-remote.test.tssrc/renderer/src/lib/worktree-agent-live-surface-adoption.tssrc/renderer/src/lib/worktree-creation-flow-execute.tssrc/renderer/src/lib/worktree-creation-host-completion.tssrc/renderer/src/lib/worktree-creation-host-result.tssrc/renderer/src/lib/worktree-creation-surface.tssrc/renderer/src/lib/worktree-creation-through-host.test.tssrc/renderer/src/lib/worktree-creation-through-host.tssrc/renderer/src/runtime/local-structured-session-tabs-sync/snapshot-apply.tssrc/renderer/src/runtime/web-runtime-session-snapshot.tssrc/renderer/src/runtime/web-session-tabs-sync-initial-terminal-relaunch.test.tsxsrc/renderer/src/runtime/web-session-tabs-sync/initial-terminal-seeder.tssrc/renderer/src/runtime/web-session-tabs-sync/tracking-decisions.tssrc/renderer/src/runtime/workspace-initial-surface-materialization.test.tssrc/renderer/src/runtime/workspace-initial-surface-materialization.tssrc/shared/agent-launch-intent.tssrc/shared/agent-launch-runtime-capability.tssrc/shared/electron-remote-runtime-client-capabilities.tssrc/shared/rpc-contract/worktree-create-params.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
The desktop host-create path resolved the new worktree's host through a helper that can fall back to the Active Server focus; it now reads the single repo row that owns the repo, as its transport target already does. Narrow the progress creation id and the initial chat selection map to the shapes their callers actually pass.
…terialization The initial-surface reducer wrote the window's active tab directly when the new workspace was already on screen. The window already shows the remembered per-workspace selection: a chat panel renders its group's active tab, and the terminal surface's repair restores the remembered terminal when none is set. The tests now pin that the remembered and visible selection is the agent, never Setup, in every committed state.
Use the same host-derived SSH connection the startup-agent create path already reports, instead of the repo row's raw connectionId.
Automatic terminal provisioning now asks for the current workspace topology, Setup's reveal carries it, and a blank remote seed is authorized by the host's current empty inventory. The tests' host fakes and expectations now reflect those contracts.
A chat created with its workspace now appears at once and takes messages at once, while its agent's first start waits for the workspace's setup to finish (bounded by the same 60 second wait the launch used to take, starting anyway on setup failure or timeout). Setup time no longer counts against the agent's startup clock, and a Stop during the wait cancels the pending start. The create holds agent starts in the workspace from before the chat exists, releases the hold when the observed setup terminal finishes, and every start of a chat there (the launch prompt, a later send from any device) waits on that hold inside the start flight a Stop already aborts.
|
@brennanb2025 heads-up: #29133 merged today and took daemon protocol v52 (new terminals start on a daemon with patched Node). It ships in 1.4.241. This PR also bumps to v52 in |
|
@brennanb2025 correction to my note above: we are reverting the v52 bump in #33688 before anything shipped with it, so this PR can keep v52. Sorry for the noise. |
…ly readers - Move the mobile composer's workspace-setup editing/Send/Stop/dictation assertions into the composer's owning suite and delete the duplicate old-path copy, so the setup coverage uses that suite's maintained mocks. - Open a real journal for the Sleep-compat status feed instead of a cast double, and parse the workerStart result with a receipt schema checked against WorkerStartReceipt instead of asserting its type. - Publish the setup-hold readers' latest callback from a layout effect, so uncommitted renders never leak into retained send handlers; add a renderer test that a reader kept from the first render follows the current status source and workspace. - Render the setup notice's "Change in settings" as a ghost xs button that inherits the notice's faint color, instead of restyling Button.
Resolve the one conflict in cli-chat-resume-run.test.ts by keeping both sides' appended tests, and move the PR's startup-restoration bound test into its own file so the merged file stays under the line limit.
- Memoize the setup hold's owner lookup on the owner resolver's inputs, so the 2-3 readers in each chat do no owner resolution on unrelated store writes. - Wake setup-hold readers only for workspaces whose held answer a frame changed, instead of every chat on the host's shared status feed. - Add an N/10N contract: unrelated writes, another workspace's setup frame and another host's frame render no chat and do no owner lookups or listener calls; a chat's own hold re-renders only that chat and shows the setup notice.
Brings in 3601c5a, including #36315 (open native chats on the phone in place). Created chats publish through main's shared tab publication and capture their surface for close-before-create; the founding attempt still records the chat as installed once its tab is in the host's list, even if notifying viewers fails.
…e input when the status stream ends - The host no longer presents a chat whose agent start is held for workspace setup as working: its status reads as no turn yet and its chat pages carry working=false, so no client (old phones included) shows "Working" or a running tab status until the agent starts. Stop stays offered and still withdraws the held message. - The setup notice is localized on desktop and phone. - An ended or refused status stream answers "not held", so an older server whose chat host is refused no longer greys out every chat's input; the next stream re-derives the hold.
Creating a workspace from the phone could open its agent chat on the phone while the desktop later opened the Setup tab. Desktop and phone creation used separate sequences, and the desktop could select Setup before receiving the agent tab. The “wait for setup” setting also delayed the phone-created chat surface while desktop chats could start their agent before setup finished.
Desktop chat creation now uses the same host operation as phone and CLI creation. The host establishes the agent tab before Setup and default tabs, and the desktop applies that initial layout before inserting those other tabs. Opening the workspace starts on its agent, an existing tab choice stays selected, and creating from another device leaves the desktop in its current workspace. Older hosts keep the existing desktop creation path when they do not advertise support.
When “wait for setup” is enabled, the chat tab and messages are accepted immediately; the agent's first start waits for setup. Stop cancels that pending start. Setup failure or the existing 60-second timeout releases the wait. Desktop creation retains its progress, cancellation, drafts, options and ready feedback across the host operation.
Intended differences:
Review and validation: full review path because this changes chat startup, tab ordering and mixed-version host behavior. Rebuilt-design round 1 is in progress. The initial rebuilt head passed CI. Final-head review, one main merge, CI, real phone/desktop QA with Claude and Codex, main comparison, restart/upgrade state and compatibility evidence are still pending; this PR is not yet ready to merge.
Author: @BrennanKB5