Skip to content

Layout groundwork (switched off): main creates, starts and closes terminal tabs and panes itself - #31130

Merged
Jinwoo-H merged 33 commits into
mainfrom
fd/d1-terminal-main-first
Oct 20, 2026
Merged

Jinwoo-H merged 33 commits into
mainfrom
fd/d1-terminal-main-first

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 31 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1783 $\color{#cf222e}{\Huge{\mathbf{−}}}$​169 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1614
Prod 38 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1031 $\color{#cf222e}{\Huge{\mathbf{−}}}$​171 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​860

ELI5

This is groundwork for the layout rewrite and stays switched off in every build that ships. With the switch on, the main process now decides when a terminal tab or pane is created or closed and starts the terminal itself. The window no longer makes those calls and reports them back. Users see no change today.

What Changed

All of this happens only with the layout-owner build switch (ORCA_LAYOUT_OWNER=main) on:

  • A pane whose terminal ends. Main decides only whether to keep the pane, using the rule the window uses today; anything it does not keep is retired exactly as main always has (retireTerminalSurfaceFromPersistence). Kept: a failed process (its "Terminal exited" card stays), a brand-new pane that dies before anyone uses it (a split only while on screen, a tab's last pane always), and a negative exit code nothing vouches for. A negative code closes only when a stop was asked for or the host confirmed the death; a raw -1 from the terminal provider can mean a closed socket, and the shipped window keeps every negative exit. A kept pane sends the phone no retirement notice.
  • A worktree's default tabs. Main writes all of them in one step, with their titles and colours, under the ids the window proposed, and then starts each one. With no window open, the phone's live tab list also gets the title and colour (bridge, ledger L238, until the phone reads main's layout in A2). The window draws them from main's layout, so main no longer sends it a separate rename.
  • An agent or setup start that fails during worktree or folder creation. Main still sets up the worktree. The failed pane stays and shows a failed status with the reason, whether the failure came before or after the pane was written. The window no longer receives the start to retry (owner-visible row 15). The kept pane counts as the workspace's terminal, so no extra shell opens next to it.
  • Pane start status. Each pane published in the layout can carry status (starting or failed) and a reason. It is live state that is never saved, and it rides the pane's binding record. It lasts only while the binding it was first published with stands; any later bind ends it, including a same-id respawn, since every bind raises the pane's generation.
  • A create of a tab the user closed is refused (tab_closed) on every way a pane is written. The check sits in applyToSession (terminal-pane-admission.ts), which every pane write goes through: applyCommandToSession (a client's layout.apply, and the renderer shutdown checkpoint), admitPaneToSession (Store.admitTerminalPane, the terminals main starts itself) and withdrawPaneFromSession, all reached through terminal-topology-commit.ts. So a paired desktop's terminal.create retried after another client closed the tab is refused before anything spawns, and the caller gets tab_closed. The held-id checks (tab_exists, pane_in_other_tab) stay on the client-command path only: a paired host legitimately starts each pane of a client's tab as a create under that tab's id, and refusing it there stopped the second pane of a split. Pane creates are not refused: a create lifts the closed-pane fence by design (A pane closed while its terminal starts stays closed (dark, layout-owner build only) #30560).
  • A close whose profile write fails (unwritable profile, full disk) stays applied. Main logs the failure and saves again later. A profile frozen for a move still refuses the close before anything changes.
  • The window's automatic flag on pane closes is removed. Main now closes exited panes itself, so every close the window sends is the user's.

Bugs fixed with the switch on, found by running every main-process runtime and persistence test with the switch on against main: default tabs lost their title and colour on the phone and in the window; an exited pane closed through the layout model mishandled shared terminals and -1 exits; a create replayed after a close brought the tab back.

Why

Under the final design, main is the only process that changes the layout, with or without a window. Each of these was a place where the window still made the decision and main learned about it afterwards. That is what lets a closed tab come back, or a failed pane disappear, when no window is open. Starting the failed pane in main, instead of handing the start back to the window, keeps a single implementation. The alternative was to keep the window hand-off for the windowed case and add a separate no-window path, which would mean two implementations to keep in sync. The exit rule only decides "keep" and falls back to the shipped retirement, rather than closing through the layout model, so a pane main does not keep goes exactly where it goes today.

Linked Issue

N/A (internal design work).

Visual Proof

N/A: switched off in every shipped build, so nothing a user sees changes. With the switch on, the behaviour is covered by the unit tests below.

Testing

  • ci-static-gate (typecheck, the type-aware oxlint baseline, code-quality, layout-writer and max-lines ratchets, census, routing, stub and import-closure tests) passes.

  • Every test under src/main/runtime and src/main/persistence (about 16,300), at this head and at main, in both builds:

    • switch on, against main at b8a5c8f: no test fails only at this head. (Two orchestration CLI subprocess tests timed out once while the static gate ran alongside; they pass on their own.) Five tests in terminal-close-async-durability fail on main and pass here (bonus fix). The 11 failures shared with main include returns the exact pre-minted leaf for concurrent renderer-backed splits (tracked for D1b) and two tmp-path tests that fail on macOS.
    • switch off, against main at 98e7dbe (before the last merge of main): the same 2 failures at main and here; none new.
  • New tests fail on main and pass on this branch: the exit rule (kept card, unvouched -1 kept, requested stop and host-confirmed -1 close, no phone retirement for a kept pane), default tabs, a paired desktop's create replayed after a close (no spawn, no tab, tab_closed; a retry before any close returns the same terminal), the closed-tab guard on both pane write paths, a failed start keeping its pane, start status in the published layout, and a close that survives a real failed profile write.

  • Switch-on tests that asserted the window hand-off or the window rename now assert the same outcome through main's layout and start status (owner-visible row 15): the setup and agent failed-start tests in orca-runtime and runtime-local-worktree-terminal-startup, the default-tab tests, and the unclaimed daemon-wide -1 in terminal-intentional-stop-exit (the pane is kept, as the window keeps it).

  • Switch-off bundle diff: renderer and preload are identical apart from the embedded build commit. Main differs only in the changes listed under Notes.

  • Latency, layout oracle e2e in a hidden window, Apple M5 Pro, 40 samples per condition, median of 3 runs at 6b8c37f, p95 drawn time switch on minus off (idle / output flood / title flood): split -1 / -1 / +2 ms; new tab -24 to -43 ms; rename +3 / +2 / -1 ms. Not gate operations: close tab +2 / +9 / +17 ms, close pane +5 / +5 / +12 ms; where that time goes is being investigated separately.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

Review

One independent review per head, plus a review of each fix delta.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Switch-off main bundle changes (renderer and preload are identical). Each either cannot be reached with the switch off or gives the same result:

  • The closed-tab refusal cannot fire switch-off: closedCreate returns null when the switch is off (terminal-pane-admission.ts, if (!ORCA_LAYOUT_OWNER_IS_MAIN) return null). A switch-off test closes a tab as the user and then creates the same tab id through both layout.apply and the runtime admission; both are written, as on main (the test passes unchanged on main).
  • The held-id checks run where they ran before, on the client-command path; runtime admissions get none, as before. A switch-off test pins that a client tab's second pane is admitted.
  • spawnInAdmittedPane surfaces tab_closed, which cannot occur switch-off; every other refusal keeps terminal_split_source_not_found. Its startStatus is undefined switch-off, so it takes its existing path with the same spawn args.
  • stageTerminalSurfaceRetirements and retireMobileSessionSurfacesForPty take an exit argument passed as undefined; the keep branch is gated on the switch, so kept is always empty and every retirement proof is sent as before. onPtyExit names stopRequested and computes an unused expression.
  • LayoutCommandPersistence gets a third argument that is undefined; its only reader is gated on the switch.
  • createTerminal passes through a new runtime layer (failed-start-pane.ts). With the switch off it returns super.createTerminal(...) directly. It is not async, so it adds no await.
  • The worktree and folder create paths read the launch runtime into a local variable. The new guards fold to the old ones (|| false, && true). A launch error still throws before the create.
  • The layout stream names two temporaries, and the new stream input (paneStartFact) is never called with the switch off.
  • The layout.apply schema accepts applyDefaultTabs and drops automatic, and markAgentLaunchesClosedByUser now runs for every closePane. layout.apply is registered only in a layout-owner build.
  • The layout-owner provisioning host is compiled in but only selected with the switch on.

SSH: closes and refusals use the partition of the host that owns the workspace. The exit rule skips workspaces served by a paired server, and an SSH -1 the host did not confirm is kept before the rule runs. Folder workspaces get the same failed-start handling as git worktrees.

Visible with the switch on, compared with the shipped (switch-off) build:

  • A failed agent or setup start during worktree creation (owner-visible row 15). Shipped: the window starts the agent (or setup) again in a tab it makes, and if that fails too it shows the failure there. Switch on: no retry. The pane stays, and main publishes it as failed with the reason. The window doesn't draw that status until D1b, so in this PR the window mounts the empty pane as it would any unbound pane and starts a plain shell in it. The user sees a shell tab where the agent would have been, with no failure message. This comes from reading the code; I have not run it in the app.
  • A terminal ending in a pane. Matches shipped: a failed or brand-new pane keeps its card, a -1 nothing vouches for keeps the pane, and everything else is retired as main does today.
  • Default tab titles and colours. Match shipped: the window draws them from main's layout; a headless phone gets them in its live list.
  • A close whose profile write fails. Matches shipped (fixes a switch-on regression).
  • A tab create re-sent after the user closed it, by any sender. Matches shipped: the tab stays closed.

Senders of pane creates, and whether any replays one it already sent:

Sender Entry point Replays a sent create? Dedupe
Window new tab layout.apply createTerminalTab No: one IPC call, no retry (layout-apply-send.ts:245, runtime-rpc-client.ts:74) window-chosen tab id, tab_exists / tab_closed
Window first terminal on activation layout.apply createTerminalTab (initial) No replay; a thrown call falls back to a new tab with a new id main creates only into an empty workspace
Window user split layout.apply splitPane No (terminal-pane-split-with-inherited-cwd.ts:38-75) newLeafId: the same split changes nothing
Window startup split (issue command) layout.apply splitPane Not a replay: a remount runs the split again under a new leaf id newLeafId
Paired desktop terminal.create Yes, by design, with the same mutation id and pane ids (remote-runtime-pty-transport.ts:1255-1340) in-flight merge plus handle-based reconcile; tab_closed after a close
Phone session.tabs.createTerminal No transport replay; only subscriptions are replayed clientMutationId, 60 s result cache
Web or paired client session.tabs.createTerminal, terminal.split No create: unclear; split: none
CLI terminal.create, terminal.split No: errors are rethrown none

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ac66206d-a61e-49fa-a7c8-021ce4a23601
📥 Commits

Reviewing files that changed from the base of the PR and between 81323a4 and 41e957a.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

The main layout owner now provisions default tabs through layout commands and reports pane-starting or failed states in published layouts. Startup flows can retain panes when terminal startup fails. PTY exit handling passes visibility and activity facts into split-pane retirement. Terminal-close commands can keep their in-memory mutation after a persistence write failure and schedule a later save. The change also removes the automatic pane-close command variant and expands the store-write ratchet’s named-import parsing.

Priority: ⬇️ Low

Merge Risk: 🔵 Low · up to 81323

Most of this change is behind an off switch, so shipped behavior is largely unchanged. Several remaining issues only affect the switched-on layout path: an exited pane can be closed or kept incorrectly, and a stale failed status can appear over a live pane. Separately, CI does not exercise the new switched-on test branches, and the id-only store-write check may miss aliased imports. These are reasonable follow-ups and do not block merging the switched-off groundwork.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 51.56% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 64 functions across 67 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly describes the primary change: enabling the main process to create, start, and close terminal tabs and panes, while noting that the feature is switched off.
Description check Passed The description is comprehensive. It includes the required change summary, rationale, testing details, visual-proof explanation, compatibility notes, and checklist status. The missing linked issue is …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description is comprehensive. It includes the required change summary, rationale, testing details, visual-proof explanation, compatibility notes, and checklist status. The missing linked issue is explained as internal design work, which matches the template's maintainer exception.

✨ Finishing Touches: 💡 2
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c85a6ff7-26c1-4255-a46e-f803b6a15cc8
📥 Commits

Reviewing files that changed from the base of the PR and between a18b44b and f482089.

📒 Files selected for processing: 54
  • src/main/ipc/pty/provider/bind-listeners.ts
  • src/main/ipc/pty/provider/local-configure.ts
  • src/main/persistence/loading-store/store-domain-composition.ts
  • src/main/persistence/terminal-topology/layout-command-persistence.ts
  • src/main/persistence/terminal-topology/terminal-close-write-failure-store.test.ts
  • src/main/persistence/terminal-topology/terminal-close-write-failure-switch-off.test.ts
  • src/main/persistence/terminal-topology/terminal-close-write-failure.test.ts
  • src/main/persistence/terminal-topology/terminal-close-write-failure.ts
  • src/main/persistence/terminal-topology/terminal-layout-create-resend.test.ts
  • src/main/persistence/terminal-topology/terminal-layout-create.test.ts
  • src/main/persistence/terminal-topology/terminal-pane-admission-layout-owner.test.ts
  • src/main/persistence/terminal-topology/terminal-pane-admission.ts
  • src/main/runtime/exited-split-pane-layout-close.test.ts
  • src/main/runtime/exited-split-pane-layout-close.ts
  • src/main/runtime/orca-runtime-create-terminal-dependencies.ts
  • src/main/runtime/orca-runtime-default-tabs-layout-owner.test.ts
  • src/main/runtime/orca-runtime-exited-split-pane-close.test.ts
  • src/main/runtime/orca-runtime-failed-start-pane-layout-owner.test.ts
  • src/main/runtime/orca-runtime-layout-owner-start-fixture.ts
  • src/main/runtime/orca-runtime.ts
  • src/main/runtime/pane-start-statuses.test.ts
  • src/main/runtime/pane-start-statuses.ts
  • src/main/runtime/runtime-folder-worktree-create-layout-owner.test.ts
  • src/main/runtime/runtime-folder-worktree-create.ts
  • src/main/runtime/runtime-layout-apply.test.ts
  • src/main/runtime/runtime-layout-apply.ts
  • src/main/runtime/runtime-local-worktree-terminal-startup-layout-owner.test.ts
  • src/main/runtime/runtime-local-worktree-terminal-startup.ts
  • src/main/runtime/runtime-pane-admission.ts
  • src/main/runtime/runtime-terminal-contracts.ts
  • src/main/runtime/runtime-worktree-default-tabs-layout-owner.test.ts
  • src/main/runtime/runtime-worktree-terminal-provisioning.ts
  • src/main/runtime/session-tabs/terminal-surface-retirements.ts
  • src/main/runtime/terminal/launch/failed-start-pane.ts
  • src/main/runtime/terminal/launch/mobile-terminal-create.ts
  • src/main/runtime/terminal/launch/terminal-create.ts
  • src/main/runtime/terminal/lifecycle/exited-split-pane-rule.test.ts
  • src/main/runtime/terminal/lifecycle/exited-split-pane-rule.ts
  • src/main/runtime/terminal/lifecycle/pty-exit-lifecycle.ts
  • src/main/runtime/workspace-layout-stream.ts
  • src/main/runtime/workspaces/startup/workspace-terminal-provisioning.ts
  • src/renderer/src/components/terminal-pane/layout-owner-pane-close-command.ts
  • src/renderer/src/components/terminal-pane/pty-connection/exited-split-pane-close.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection/exited-split-pane-close.ts
  • src/renderer/src/components/terminal-pane/pty-connection/pty-exit-hibernate.ts
  • src/renderer/src/runtime/layout-apply-send.ts
  • src/shared/rpc-contract/workspace-layout-params.ts
  • src/shared/rpc-contract/workspace-layout-terminal-tab-params.ts
  • src/shared/workspace-layout/workspace-layout-command-types.ts
  • src/shared/workspace-layout/workspace-layout-commands.ts
  • src/shared/workspace-layout/workspace-layout-default-tabs.test.ts
  • src/shared/workspace-layout/workspace-layout-default-tabs.ts
  • src/shared/workspace-layout/workspace-layout-published.ts
  • src/shared/workspace-layout/workspace-layout-records.ts
💤 Files with no reviewable changes: 1
  • src/main/runtime/runtime-layout-apply.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.

Comment on lines +231 to +241
function takenDefaultTabId(
layout: WorkspaceLayoutModel,
command: CommandOf<'applyDefaultTabs'>
): LayoutApplyOutcome | null {
const ids = new Set(command.tabs.map((tab) => tab.tabId))
const holds = Object.values(layout.workspaces).some((entry) =>
entry.tabs.some((tab) => ids.has(tab.id) || ids.has(tab.entityId))
)
if (holds) {
return { ok: false, code: 'tab_exists' }
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Check the applied mark before the held-id check.

takenDefaultTabId runs before applyDefaultTabs checks defaultTabsAppliedByWorkspace. Suppose a sender resends the same applyDefaultTabs command after the first one committed, for example after the reply was lost. The held-id check matches the tabs that the first command created and returns tab_exists. The command contract says main makes nothing once the workspace is marked, so the resend should succeed with createdTabs: []. A sender that treats tab_exists as a refusal logs "Main refused the default tabs" and starts no terminals in the panes that already exist.

Return null from takenDefaultTabId when the workspace is already marked. The pure command then returns { createdTabs: [] }.

🐛 Proposed fix
--- "a/src/main/persistence/terminal-topology/terminal-pane-admission.ts"
+++ "b/src/main/persistence/terminal-topology/terminal-pane-admission.ts"
@@ -228,11 +228,14 @@
 }
 
 /** Default tabs come once, so any proposed id another tab holds refuses them all. */
 function takenDefaultTabId(
   layout: WorkspaceLayoutModel,
   command: CommandOf<'applyDefaultTabs'>
 ): LayoutApplyOutcome | null {
+  if (layout.records.defaultTabsAppliedByWorkspace?.[command.workspace]) {
+    return null
+  }
   const ids = new Set(command.tabs.map((tab) => tab.tabId))
   const holds = Object.values(layout.workspaces).some((entry) =>
     entry.tabs.some((tab) => ids.has(tab.id) || ids.has(tab.entityId))
   )
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
function takenDefaultTabId(
layout: WorkspaceLayoutModel,
command: CommandOf<'applyDefaultTabs'>
): LayoutApplyOutcome | null {
const ids = new Set(command.tabs.map((tab) => tab.tabId))
const holds = Object.values(layout.workspaces).some((entry) =>
entry.tabs.some((tab) => ids.has(tab.id) || ids.has(tab.entityId))
)
if (holds) {
return { ok: false, code: 'tab_exists' }
}
function takenDefaultTabId(
layout: WorkspaceLayoutModel,
command: CommandOf<'applyDefaultTabs'>
): LayoutApplyOutcome | null {
if (layout.records.defaultTabsAppliedByWorkspace?.[command.workspace]) {
return null
}
const ids = new Set(command.tabs.map((tab) => tab.tabId))
const holds = Object.values(layout.workspaces).some((entry) =>
entry.tabs.some((tab) => ids.has(tab.id) || ids.has(tab.entityId))
)
if (holds) {
return { ok: false, code: 'tab_exists' }
}

Comment on lines +181 to +183
// Switch point: a start main could not make stays main's to show, never the window's.
ORCA_LAYOUT_OWNER_IS_MAIN ? undefined : startup && !didSpawnStartup ? startup : undefined,
ORCA_LAYOUT_OWNER_IS_MAIN ? undefined : failedSetup,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

#!/bin/bash
rg -nP -C4 '\breturnedSetup\b' --type=ts -g '!**/*.test.ts'

Repository: stablyai/orca

Length of output: 4120


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- startup function ---'
nl -ba src/main/runtime/runtime-local-worktree-terminal-startup.ts | sed -n '1,245p'
printf '%s\n' '--- workspace creation result path ---'
nl -ba src/main/runtime/workspaces/workspace-creation.ts | sed -n '180,275p'
printf '%s\n' '--- setup result consumers ---'
rg -n -P -C6 'CreateWorktreeResult|\.setup\b|setupReceipt|awaitTerminalProvisioning' src --type=ts -g '!**/*.test.ts' | sed -n '1,320p'
printf '%s\n' '--- provisioning definition and callers ---'
rg -n -P -C8 'provisionWorktreeTerminals|keepPaneOnStartFailure|startFailure' src/main --type=ts -g '!**/*.test.ts' | sed -n '1,360p'

Repository: stablyai/orca

Length of output: 42513


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- all non-test result/setup consumers ---'
rg -n -P -C8 'CreateWorktreeResult|createWorktree|create-worktree|result\.setup|setup:\s*result\.setup|\.setup\??\.' src --type=ts --type=tsx -g '!**/*.test.ts' -g '!**/*.spec.ts' | sed -n '1,420p'
printf '%s\n' '--- provisioning implementation ---'
nl -ba src/main/runtime/runtime-worktree-terminal-provisioning.ts | sed -n '1,330p'
printf '%s\n' '--- shared result contract ---'
rg -n -P -C12 'export\s+(type|interface)\s+CreateWorktreeResult|type\s+CreateWorktreeResult|interface\s+CreateWorktreeResult' src --type=ts --type=d.ts
printf '%s\n' '--- renderer/preload worktree creation handlers ---'
rg -n -P -C10 'worktree.*create|create.*worktree|setupReceipt|runSetup|setupAgent|setupCommand' src/renderer src/preload src/shared --type=ts --type=tsx -g '!**/*.test.ts' -g '!**/*.spec.ts' | sed -n '1,420p'

Repository: stablyai/orca

Length of output: 12713


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- result contract and exact symbol references ---'
rg -n -F --glob '*.ts' --glob '*.tsx' --glob '*.d.ts' 'CreateWorktreeResult' src || test "$?" -eq 1
printf '%s\n' '--- worktree creation result handling ---'
rg -n -P --glob '*.ts' --glob '*.tsx' --glob '*.d.ts' -C8 'createWorktree|create-worktree|result\.setup|\.setup\b|setupReceipt' src/renderer src/preload src/shared 2>/dev/null | sed -n '1,500p'
printf '%s\n' '--- shared create contract ---'
rg -n -P --glob '*.ts' --glob '*.tsx' --glob '*.d.ts' -C15 'export\s+(type|interface)\s+CreateWorktreeResult|type\s+CreateWorktreeResult|interface\s+CreateWorktreeResult' src || test "$?" -eq 1

Repository: stablyai/orca

Length of output: 41892


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- renderer creation flow ---'
nl -ba src/renderer/src/lib/worktree-creation-flow-execute.ts | sed -n '1,230p'
printf '%s\n' '--- renderer create slice ---'
nl -ba src/renderer/src/store/slices/worktrees/create/create-worktree.ts | sed -n '1,190p'
printf '%s\n' '--- created-worktree merge ---'
nl -ba src/renderer/src/store/slices/worktrees/create/created-worktree-state-merge.ts | sed -n '1,180p'
printf '%s\n' '--- renderer setup/startup handling ---'
rg -n -P --glob '*.ts' --glob '*.tsx' -C10 'result\.setup|created\.setup|setupReceipt|activationSetup|setupTerminal|runSetup|start.*setup' src/renderer/src src/main/window src/main/ipc | sed -n '1,500p'

Repository: stablyai/orca

Length of output: 42087


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- activation implementation ---'
rg -n -P --glob '*.ts' --glob '*.tsx' -C6 'export\s+(async\s+)?function\s+activateAndRevealWorktree|function\s+activateAndRevealWorktree|activateAndRevealWorktree\s*=' src/renderer/src
printf '%s\n' '--- activation setup handling ---'
rg -n -P --glob '*.ts' --glob '*.tsx' -C12 'setup\??:|args\.setup|options\.setup|setupOnly|createSetup|Setup' src/renderer/src/lib/worktree-activation* src/renderer/src/lib/worktree-initial-terminal-seeding.ts | sed -n '1,420p'

Repository: stablyai/orca

Length of output: 41942


🏁 Script executed:

set -o pipefail
nl -ba src/renderer/src/lib/worktree-activation.ts | sed -n '120,245p'
printf '%s\n' '--- initial terminal seeding implementation ---'
nl -ba src/renderer/src/lib/worktree-initial-terminal-seeding.ts | sed -n '1,210p'

Repository: stablyai/orca

Length of output: 16144


🏁 Script executed:

set -o pipefail
nl -ba src/renderer/src/lib/worktree-initial-terminal-seeding.ts | sed -n '205,390p'
printf '%s\n' '--- setup and issue command queue ---'
nl -ba src/renderer/src/lib/worktree-setup-issue-command-queue.ts | sed -n '1,300p'

Repository: stablyai/orca

Length of output: 7319


Do not return setup after main has attempted its setup create.

When main owns the layout and setup creation fails, main retains the failed Setup pane, but didSpawnSetup remains false. The current code returns the same setup to the renderer. The renderer then creates another Setup tab beside the retained pane.

Track whether provisioning reached the setup create. Omit returnedSetup only when ORCA_LAYOUT_OWNER_IS_MAIN and that attempt occurred. Keep returning setup when main could not spawn terminals or did not attempt setup.

return {
exitCode,
freshSpawn: run.freshSpawn,
inputSeen: run.firstUserInputAt !== null || runs.readLastInputAt(ptyId) !== null,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

#!/bin/bash
rg -nP -C3 '\brecordInput\s*\(' --type=ts src/main
rg -nP -C2 "inputKind|TerminalInputKind" --type=ts src/main/runtime | head -80

Repository: stablyai/orca

Length of output: 28551


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- target rule ---'
nl -ba src/main/runtime/terminal/lifecycle/exited-split-pane-rule.ts | sed -n '1,130p'
printf '%s\n' '--- run facts implementation ---'
nl -ba src/main/runtime/terminal-run-facts.ts | sed -n '1,180p'
printf '%s\n' '--- input kinds ---'
nl -ba src/shared/terminal-input-kind.ts | sed -n '1,120p'
printf '%s\n' '--- launch-related write call sites ---'
rg -n -P -C4 --type=ts '(inputKind\s*:\s*['"'"']launch['"'"'"]|write(?:WithSettlement)?\s*\([^;\n]*['"'"'"]launch['"'"'"]|sendTerminalAgentPrompt|launch)' src/main/runtime src/main/ipc/pty src/shared | head -240

Repository: stablyai/orca

Length of output: 31456


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- launch write producers ---'
rg -n -F --glob '*.ts' -e "inputKind: 'launch'" -e "inputKind='launch'" -e ", 'launch')" -e ", 'launch'," src/main || test "$?" -eq 1
printf '%s\n' '--- startup readiness implementation ---'
rg -n -F --glob '*.ts' -e 'writeWorktreeStartupPrompt' -e 'startup prompt' -e 'sendTerminalAgentPrompt' src/main/runtime

Repository: stablyai/orca

Length of output: 34987


Count only driving input for a fresh spawn.

readLastInputAt includes launch writes, but firstUserInputAt records only driving input. Therefore, a fresh pane that receives only a launch command sets inputSeen to true. Both newborn keep branches then close the pane instead of keeping its exit card.

Use the fallback only for non-fresh runs.

🐛 Suggested fix
--- "a/src/main/runtime/terminal/lifecycle/exited-split-pane-rule.ts"
+++ "b/src/main/runtime/terminal/lifecycle/exited-split-pane-rule.ts"
@@ -46,7 +46,9 @@
   return {
     exitCode,
     freshSpawn: run.freshSpawn,
-    inputSeen: run.firstUserInputAt !== null || runs.readLastInputAt(ptyId) !== null,
+    inputSeen:
+      run.firstUserInputAt !== null ||
+      (!run.freshSpawn && runs.readLastInputAt(ptyId) !== null),
     outputSeen: pty?.lastOutputAt != null,
     shown: options.viewShown === true
   }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
inputSeen: run.firstUserInputAt !== null || runs.readLastInputAt(ptyId) !== null,
inputSeen:
run.firstUserInputAt !== null ||
(!run.freshSpawn && runs.readLastInputAt(ptyId) !== null),

Comment on lines +57 to +69
export const ApplyDefaultTabsCommand = z.object({
type: z.literal('applyDefaultTabs'),
workspace,
tabs: z.array(
z.object({
tabId: z.string().refine(isValidHostTerminalTabId),
leafId: z.string().refine(isTerminalLeafId),
title: z.string().trim().min(1).optional(),
color: z.string().min(1).optional(),
creation: TerminalCreation.optional()
})
)
})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Reject duplicate ids inside one applyDefaultTabs batch.

LayoutApplyParams accepts applyDefaultTabs from the window, so the window controls tabs. The schema does not require unique tabId or leafId values across entries. takenDefaultTabId compares the proposed ids only against tabs that already exist in the layout. It does not compare the entries with each other. createTerminalTab runs no id check of its own. Two entries with the same tabId therefore persist two tabs with one id. Two entries with the same leafId persist two panes with one leaf id. Both results break pane-key identity in the saved session.

Add a uniqueness check at the boundary. The check can be a schema refine, or the same check in takenDefaultTabId.

🛡️ Proposed schema refine
-  tabs: z.array(
-    z.object({
+  tabs: z
+    .array(
+      z.object({
       tabId: z.string().refine(isValidHostTerminalTabId),
       leafId: z.string().refine(isTerminalLeafId),
       title: z.string().trim().min(1).optional(),
       color: z.string().min(1).optional(),
       creation: TerminalCreation.optional()
-    })
-  )
+      })
+    )
+    .refine(
+      (tabs) =>
+        new Set(tabs.map((tab) => tab.tabId)).size === tabs.length &&
+        new Set(tabs.map((tab) => tab.leafId)).size === tabs.length
+    )

E2E Test added 19 commits October 20, 2026 10:17
… starts them, window or none (dark; twin e)
… starts them, window or none (dark; twin e)
…nt fails to start; no window takes over (dark)
…ne; a terminal close stands after a failed write (dark)
…abs start once; a tab's last pane keeps its card (dark)
@Jinwoo-H
Jinwoo-H force-pushed the fd/d1-terminal-main-first branch from f482089 to 288be57 Compare October 20, 2026 14:23

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ef10b0ec-9323-44c2-bfbc-d9e5034b95c5
📥 Commits

Reviewing files that changed from the base of the PR and between f482089 and 288be57.

📒 Files selected for processing: 9
  • src/main/persistence/loading-store/terminal-close-async-durability.test.ts
  • src/renderer/src/components/terminal-pane/pending-pane-close-confirmation.test.ts
  • src/renderer/src/components/terminal-pane/pending-split-close-test-fixture.ts
  • src/renderer/src/components/terminal-pane/pending-split-close.test.ts
  • src/renderer/src/store/terminals/terminal-tab-close-intent.test.ts
  • src/shared/rpc-contract/workspace-layout-params.ts
  • src/shared/rpc-contract/workspace-layout-terminal-tab-params.ts
  • src/shared/workspace-layout/workspace-layout-command-types.ts
  • src/shared/workspace-layout/workspace-layout-records.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.

return layoutApplyTestTransport.sentOfType('closeTabs').map((command) => ({
worktreeId: command.workspace,
tabId: command.tabIds[0]!,
reason: command.recordClose === 'cleanup' ? 'cleanup' : 'user'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Do not treat an absent recordClose as a user close.

If main receives closeTabs without recordClose, this helper reports reason: 'user'. The user-close assertions then pass even though the command did not request a close record. Preserve the optional value in sentCloses so those assertions detect the missing field.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ed4140e1-234d-4558-b030-3222be1b32ec
📥 Commits

Reviewing files that changed from the base of the PR and between 288be57 and 6b8c37f.

📒 Files selected for processing: 9
  • config/scripts/check-id-only-store-write-ratchet.mjs
  • config/scripts/check-id-only-store-write-ratchet.test.mjs
  • src/main/persistence/terminal-topology/terminal-layout-create-resend.test.ts
  • src/main/persistence/terminal-topology/terminal-pane-admission.ts
  • src/main/runtime/orca-runtime-layout-owner-start-fixture.ts
  • src/main/runtime/orca-runtime.ts
  • src/main/runtime/pane-start-statuses.test.ts
  • src/main/runtime/pane-start-statuses.ts
  • src/renderer/src/store/terminals/terminal-tab-close-intent.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

Comment on lines +90 to +95
.trim()
.split(/\s+as\s+/)
.at(-1)
)
.filter(Boolean)
.map((name) => [name, m[2]])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

#!/bin/bash
# Inspect whether findIdOnlyWrites uses its className argument to select a declaration.
ast-grep outline config/scripts/check-id-only-store-write-ratchet.mjs --match findIdOnlyWrites --view expanded
sed -n '114,194p' config/scripts/check-id-only-store-write-ratchet.mjs

Repository: stablyai/orca

Length of output: 3360


🏁 Script executed:

sed -n '1,125p' config/scripts/check-id-only-store-write-ratchet.mjs
printf '\n--- references and tests ---\n'
rg -n -F --glob '*.mjs' -e 'listStoreOperationClasses' -e 'collectIdOnlyStoreWrites' -e 'findIdOnlyWrites' -e 'as LocalOps' -e 'RowOps as' config test tests 2>/dev/null || test "$?" -eq 1

Repository: stablyai/orca

Length of output: 8381


Preserve the imported declaration name for aliased classes.

findIdOnlyWrites searches for export class ${className}. For import { RowOps as LocalOps }, listStoreOperationClasses returns LocalOps, but the source declares RowOps. collectIdOnlyStoreWrites then misses all writes in that class.

Keep the composition name for import lookup, but pass the imported declaration name to findIdOnlyWrites. Add an aliased-class test case.

Suggested fix
-        .map((name) =>
-          name
-            .trim()
-            .split(/\s+as\s+/)
-            .at(-1)
-        )
-        .filter(Boolean)
-        .map((name) => [name, m[2]])
+        .map((raw) => {
+          const [importedName, localName] = raw.trim().split(/\s+as\s+/)
+          return [localName ?? importedName, importedName, m[2]]
+        })
+        .filter(([localName]) => Boolean(localName))
+        .map(([localName, importedName, specifier]) => [
+          localName,
+          { importedName, specifier }
+        ])
@@
-      const specifier = imports.get(name)
-      if (!specifier) {
+      const imported = imports.get(name)
+      if (!imported) {
         throw new Error(`${COMPOSITION}: no import for ${name}`)
       }
-      return [name, path.posix.join(path.posix.dirname(COMPOSITION), `${specifier}.ts`)]
+      return [
+        imported.importedName,
+        path.posix.join(path.posix.dirname(COMPOSITION), `${imported.specifier}.ts`)
+      ]

Comment on lines +28 to +31
set(paneKey: string, fact: PaneStartFact): void {
this.byPaneKey.set(paneKey, { fact })
this.changed()
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

#!/bin/bash
fd -i 'workspace-layout-stream.ts' src --exec rg -n -C6 'paneStartFact|subscribe\(|markLiveTitlesDirty|settledSeq|listeners' {}
rg -nP -C4 'paneStartStatuses\s*=' src/main/runtime

Repository: stablyai/orca

Length of output: 7818


🏁 Script executed:

#!/bin/bash
set -e
printf '%s\n' '--- pane-start-statuses.ts ---'
nl -ba src/main/runtime/pane-start-statuses.ts
printf '%s\n' '--- stream projection and flush ---'
nl -ba src/main/runtime/workspace-layout-stream.ts | sed -n '250,355p'
printf '%s\n' '--- status writes and binding-related calls ---'
rg -n -F --glob '*.ts' -e 'paneStartStatuses' -e 'paneStartStatusArgs' -e 'paneStartFactsOf' -e 'bindingOf(' -e 'ptyGeneration' src/main/runtime src/shared
printf '%s\n' '--- owning launch implementation ---'
nl -ba src/main/runtime/terminal/launch/failed-start-pane.ts | sed -n '1,190p'

Repository: stablyai/orca

Length of output: 23344


Pin the pane binding when set runs.

set stores the fact without a binding, and get pins it to the first binding it receives. WorkspaceLayoutStream reads the fact only while projection is active. Without a subscriber, markLiveTitlesDirty() returns without reading it. A later subscriber can therefore read the fact after the pane has rebound and publish the stale failed status over the running terminal.

Pass a bindingAt(paneKey) reader to PaneStartStatuses and capture that binding in set. Keep get bound to the captured value so a later bind clears the fact.

…ayout switch on

An exited pane closes through the legacy retirement unless the keep rule holds; the
default tab's title and color still reach the window and the phone's live tabs.
E2E Test and others added 6 commits October 20, 2026 12:59
…vouched -1

Main's taken and closed-id guard now runs where every pane write goes, so a runtime create
replayed after its tab closed is refused before it spawns. An exit code nothing vouches for
keeps the pane, as the window does; a kept pane sends the phone no retirement. Converts the
switch-on tests that asserted the deleted window hand-off and title bridge.
… checks on client commands

A paired host starts each pane of a client's tab as a create under the tab's id, so a held tab
id is refused only for a client's own layout command.
Only a requested stop or a host-confirmed death closes a pane on a negative exit code. Pins that
the closed-tab guard never fires in the shipped build.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments: 1
src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-04.spec.ts: 1

456-474: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Run the runtime aggregator with the layout-owner switch enabled.

The normal unit command does not set ORCA_LAYOUT_OWNER, so ORCA_LAYOUT_OWNER_IS_MAIN is false and the new switch-on assertions are skipped. Add an equivalent CI invocation:

ORCA_LAYOUT_OWNER=main pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/orca-runtime.test.ts

ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 79c6ade6-6552-43fe-abe8-7b0e1106a19b
📥 Commits

Reviewing files that changed from the base of the PR and between 6b8c37f and 81323a4.

📒 Files selected for processing: 20
  • src/main/persistence/terminal-topology/terminal-close-write-failure-switch-off.test.ts
  • src/main/persistence/terminal-topology/terminal-pane-admission-taken-ids-switch-off.test.ts
  • src/main/persistence/terminal-topology/terminal-pane-admission-taken-ids.test.ts
  • src/main/persistence/terminal-topology/terminal-pane-admission.ts
  • src/main/runtime/exited-split-pane-layout-close.test.ts
  • src/main/runtime/exited-split-pane-layout-close.ts
  • src/main/runtime/orca-runtime-default-tab-agent-status.test.ts
  • src/main/runtime/orca-runtime-exited-split-pane-close.test.ts
  • src/main/runtime/orca-runtime-terminal-create-replay-after-close.test.ts
  • src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-03.spec.ts
  • src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-04.spec.ts
  • src/main/runtime/orca-runtime-tests/worktree-setup-single-creator.spec.ts
  • src/main/runtime/runtime-local-worktree-terminal-startup.test.ts
  • src/main/runtime/runtime-pane-admission.ts
  • src/main/runtime/session-tabs/terminal-surface-retirements.ts
  • src/main/runtime/terminal-intentional-stop-exit.test.ts
  • src/main/runtime/terminal/lifecycle/exited-split-pane-rule.test.ts
  • src/main/runtime/terminal/lifecycle/exited-split-pane-rule.ts
  • src/main/runtime/terminal/lifecycle/pty-exit-lifecycle.ts
  • src/main/runtime/workspaces/startup/workspace-terminal-provisioning.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.

Comment on lines +67 to +70
const endVouched =
stopRequested ||
options.hostExitConfirmed === true ||
this.ptyLivenessVerdictByPtyId.get(ptyId)?.verdict.status === 'exited'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

#!/bin/bash
# Find every write and clear of the liveness verdict register.
rg -nP -C4 'ptyLivenessVerdictByPtyId\s*\.(set|delete|clear)|rememberPtyLivenessVerdict\s*\(' --type=ts -g '!**/*.test.ts'

Repository: stablyai/orca

Length of output: 11102


🏁 Script executed:

set -e
printf '%s\n' '--- registration declaration and body ---'
nl -ba src/main/runtime/terminal/lifecycle/pty-registration.ts | sed -n '1,125p'
printf '%s\n' '--- registration references ---'
rg -n -F --glob '*.ts' -e 'registerPty' -e 'pty-registration' src/main/runtime/terminal
printf '%s\n' '--- exit context ---'
nl -ba src/main/runtime/terminal/lifecycle/pty-exit-lifecycle.ts | sed -n '40,105p'
nl -ba src/main/runtime/terminal/lifecycle/pty-exit-lifecycle.ts | sed -n '205,252p'
printf '%s\n' '--- incarnation fields and registration-related calls ---'
rg -n -F --glob '*.ts' -e 'exitIncarnationId' -e 'incarnationId' src/main/runtime/terminal/lifecycle src/main/runtime/terminal | head -160

Repository: stablyai/orca

Length of output: 33868


🏁 Script executed:

set -e
printf '%s\n' '--- recordPtyWorktree callers ---'
rg -n -F --glob '*.ts' -e 'recordPtyWorktree(' src/main/runtime/terminal src/main/runtime | head -240
printf '%s\n' '--- record implementation and direct identity updates ---'
nl -ba src/main/runtime/terminal/identity/pty-worktree-record.ts | sed -n '1,180p'
printf '%s\n' '--- controller inventory refresh ---'
nl -ba src/main/runtime/terminal/lifecycle/pty-controller-inventory-refresh.ts | sed -n '150,245p'
printf '%s\n' '--- recovery and adoption references ---'
rg -n -F --glob '*.ts' -e 'adopt' -e 'restore' -e 'reattach' src/main/runtime/terminal/recovery src/main/runtime/terminal/adoption src/main/runtime/terminal/lifecycle | head -240

Repository: stablyai/orca

Length of output: 25846


🏁 Script executed:

set -e
printf '%s\n' '--- recordPtyWorktree continuation ---'
nl -ba src/main/runtime/terminal/identity/pty-worktree-record.ts | sed -n '120,245p'
printf '%s\n' '--- exited split-pane rule and consumers ---'
nl -ba src/main/runtime/terminal/lifecycle/exited-split-pane-rule.ts | sed -n '1,130p'
rg -n -F --glob '*.ts' -e 'exitedSplitPaneOutcome' -e 'endVouched' src/main/runtime/terminal src/main/runtime | head -160
printf '%s\n' '--- inventory refresh entry and surrounding flow ---'
nl -ba src/main/runtime/terminal/lifecycle/pty-controller-inventory-refresh.ts | sed -n '1,155p'

Repository: stablyai/orca

Length of output: 21461


🏁 Script executed:

set -e
printf '%s\n' '--- liveness live writer ---'
nl -ba src/main/runtime/terminal/layout/terminal-input-floor.ts | sed -n '1,65p'
printf '%s\n' '--- direct live-record callers ---'
nl -ba src/main/runtime/terminal/output/pty-output-ingestion.ts | sed -n '140,205p'
nl -ba src/main/runtime/terminal/lifecycle/floating-session-liveness.ts | sed -n '1,90p'
nl -ba src/main/runtime/session-graph/session-window-graph.ts | sed -n '155,205p'
nl -ba src/main/runtime/terminal/launch/terminal-create-deduplication.ts | sed -n '90,165p'
printf '%s\n' '--- registration assertion and incarnation fence ---'
nl -ba src/main/runtime/terminal/lifecycle/pty-registration.ts | sed -n '170,235p'

Repository: stablyai/orca

Length of output: 19978


🏁 Script executed:

set -e
printf '%s\n' '--- acceptPtyIncarnationForExit callers ---'
rg -n -F --glob '*.ts' -e 'acceptPtyIncarnationForExit(' src/main/runtime
printf '%s\n' '--- terminal deduplication class and callers ---'
nl -ba src/main/runtime/terminal/launch/terminal-create-deduplication.ts | sed -n '1,130p'
rg -n -F --glob '*.ts' -e 'adoptExistingControllerTerminal' -e 'adoptControllerTerminalHandle' -e 'launchAgentTerminal' src/main/runtime/terminal src/main/runtime | head -220
printf '%s\n' '--- reconnect attach lifecycle references ---'
rg -n -P --glob '*.ts' 'reattach|attach.*reply|attach.*result|incarnation' src/main/runtime/terminal/lifecycle src/main/runtime/terminal/launch src/main/runtime/terminal/recovery | head -260

Repository: stablyai/orca

Length of output: 22497


🏁 Script executed:

set -e
printf '%s\n' '--- adopted handle method ---'
nl -ba src/main/runtime/workspaces/known-workspace-file-target.ts | sed -n '195,235p'
printf '%s\n' '--- exit consumer block ---'
nl -ba src/main/runtime/terminal/lifecycle/pty-exit-lifecycle.ts | sed -n '252,282p'

Repository: stablyai/orca

Length of output: 3644


Scope the liveness verdict to the PTY incarnation.

registerPty clears the verdict, but controller reconciliation can admit a live replacement through recordPtyWorktree without clearing it. A stale exited verdict can then make an uncertified negative exit close the replacement pane.

Clear or replace the verdict whenever a new live incarnation is accepted, including restore, adoption, and reconnect paths. Alternatively, store the incarnation with the verdict and require it to match the exiting exitIncarnationId.

@Jinwoo-H
Jinwoo-H merged commit 997d34b into main Oct 20, 2026
69 of 70 checks passed
brennanb2025 added a commit that referenced this pull request Oct 20, 2026
Main's layout-owner groundwork (#31130, #31171, #31187, dark) and the binding
fast lane (#31033) touched the same files. Binding retirement keeps this
branch's incarnation fence and uses main's dirty marking; a failed start keeps
its pane for main's keep-on-failure starts and for owner contention; the fresh
launch path takes main's pane start status arguments.
Jinwoo-H added a commit that referenced this pull request Oct 21, 2026
…e, the window only attaches (#31258)

* feat(terminal): the window's store shows main's pane start status (layout-owner build)

A status-only frame changes one store entry and no pane tree, so the pane's view stays mounted.

* refactor(terminal): keep the frame sync within its line budget

* feat(terminal): every pane main starts shows 'starting' from before it is written (layout-owner build)

* feat(terminal): a pane main is starting waits and attaches; a failed start shows why (layout-owner build)

Fixes owner-visible row 15: a failed agent or setup start no longer opens a plain shell.

* test(terminal): iterate store listeners directly

* fix(terminal): an exit that reports no code keeps its pane, as lost contact (layout-owner build)

* test(terminal): a pane main started attaches to main's terminal at its own grid

* test(terminal): detach census tests assert main's move and frame with the switch on

* test(terminal): exited-pane tests assert main's close with the switch on

These 8 have failed switch-on since #31130 moved the exit close to main.

* feat(terminal): main writes and starts every split of a pane it holds; the window attaches (layout-owner build)

The window's split, a startup split with its command, and a CLI split all go through main's
terminal.split; main's frame mounts the pane, with or without a window intent. Deletes the
window's split wait and withdraw, the split appear intents, and the queued-split skip and cancel.
The e2e helper uses the real split. A startup split leaves focus on its source pane.

* fix(terminal): the attach-only wait leaves sleeping, resuming and held panes to their restore path

* fix(terminal): a split pane attaches to the terminal main bound it to; a taken pane id is refused

Also restores the proof that a split closed while it starts gets one answer and leaves no
pane or start status behind.

* fix(terminal): a window split main cannot start still shows its pane, failed, with why

* fix(terminal): check a taken pane id first, keep the start's own error, clear a gone pane's status

Three test stores gain the pane-start field the window's store always has.

* test(terminal): the admission stub answers whether its pane is still written; a closed pane's failed start clears

* refactor(terminal): the rebound workspaces' bindings show through one call in the bindings module

* test(terminal): a pane main wrote and the user closed mid-start drops its failed status

* fix(terminal): a split main starts is listed to phones and session.tabs without a window's report

* fix(terminal): a reconnect shows its pane starting and why it failed; a lost owner race shows no failure; a split no one asked to see keeps the phones' tab

* fix(terminal): a kept create another owner won shows no failure; the window attaches to the winner
Jinwoo-H added a commit that referenced this pull request Oct 22, 2026
…, and the window only attaches and paints the host's history (#31567)

* feat(terminal): the window's store shows main's pane start status (layout-owner build)

A status-only frame changes one store entry and no pane tree, so the pane's view stays mounted.

* refactor(terminal): keep the frame sync within its line budget

* feat(terminal): every pane main starts shows 'starting' from before it is written (layout-owner build)

* feat(terminal): a pane main is starting waits and attaches; a failed start shows why (layout-owner build)

Fixes owner-visible row 15: a failed agent or setup start no longer opens a plain shell.

* test(terminal): iterate store listeners directly

* fix(terminal): an exit that reports no code keeps its pane, as lost contact (layout-owner build)

* test(terminal): a pane main started attaches to main's terminal at its own grid

* test(terminal): detach census tests assert main's move and frame with the switch on

* fix(terminal): a restored pane paints history only from its terminal's host, never the window's copy (layout-owner build only)

* fix(terminal): main releases a painted cold restore only for the pane's current terminal (layout-owner build only)

* test(terminal): typed ack args in the painted cold-restore test

* test(terminal): exited-pane tests assert main's close with the switch on

These 8 have failed switch-on since #31130 moved the exit close to main.

* feat(layout): main starts the panes a client's startPane or wake names, through its one restored-pane starter (layout-owner build only)

The model's start and stop effects reach the runtime once the command is written, never the
reply. startPane starts a pane whose binding has a start status, and a slept pane from its record.
A wake keeps a pane's resume record until its start binds; a failed start keeps it and shows why.
With the switch on, main owns a running agent's wake even with a window open.

* fix(layout): a window's wake of a pane it resumed itself is record-only, so main does not start it again (layout-owner build only)

* test(layout): a client's startPane starts the pane before any other trigger

* Revert "fix(terminal): a restored pane paints history only from its terminal's host, never the window's copy (layout-owner build only)"

This reverts commit a646d89.

* test(terminal): the cold-restore repaint ack names its pane in the layout-owner build

* fix(layout): a wake keeps the pane's resume record in the pane-owned form, so a host crash resumes the agent again (layout-owner build only)

* test(layout): a failing start in the pane-start runner test throws

* feat(terminal): main writes and starts every split of a pane it holds; the window attaches (layout-owner build)

The window's split, a startup split with its command, and a CLI split all go through main's
terminal.split; main's frame mounts the pane, with or without a window intent. Deletes the
window's split wait and withdraw, the split appear intents, and the queued-split skip and cancel.
The e2e helper uses the real split. A startup split leaves focus on its source pane.

* fix(terminal): the attach-only wait leaves sleeping, resuming and held panes to their restore path

* fix(terminal): a split pane attaches to the terminal main bound it to; a taken pane id is refused

Also restores the proof that a split closed while it starts gets one answer and leaves no
pane or start status behind.

* Reapply "fix(terminal): a restored pane paints history only from its terminal's host, never the window's copy (layout-owner build only)"

This reverts commit 420e605.

* fix(layout): a trigger between a restored pane's start and its bind write joins that start, not a second one (layout-owner build only)

* fix(terminal): a window split main cannot start still shows its pane, failed, with why

* fix(terminal): keep the switch import the D1b-1 merge dropped from the layout restore

* feat(layout): main's starter shows a restored pane starting before any await, and a failed start with its reason; startPane starts a pane whose bound terminal ended (layout-owner build only)

* feat(terminal): a window's attach-only view of a pane attaches to its terminal or starts nothing, keeping the binding for main's start (layout-owner build only)

* feat(terminal): a restored pane with no live terminal asks main to start it and attaches once main binds it; the window's wake, hibernated wake, restart-on-show and gone-terminal fallbacks route through main (layout-owner build only)

* fix(terminal): check a taken pane id first, keep the start's own error, clear a gone pane's status

Three test stores gain the pane-start field the window's store always has.

* test(terminal): the admission stub answers whether its pane is still written; a closed pane's failed start clears

* test(terminal): with the switch on, the window's restores, wakes and restart replacements ask main to start the pane and attach to the terminal main binds, starting and resuming nothing themselves

* refactor(terminal): the rebound workspaces' bindings show through one call in the bindings module

* fix(terminal): a held pane connects as today so main's refusal holds it; main's start follows output; a capacity death after main's resume keeps the resume (layout-owner build only)

* fix(layout): main passes its start options only for commands that start panes; a windowed open resumes the agent under main (layout-owner build only)

* refactor(terminal): break the pane start module cycle; typed test fixtures

* test(terminal): a pane main wrote and the user closed mid-start drops its failed status

* fix(terminal): every waiter on main's start runs, a failed or refused start settles and is asked again on the next view, a hidden gone pane waits for its view, a twin main hands back stays on today's path, and lost contact never starts a pane (layout-owner build only)

* test(terminal): iterate the store listeners directly

* test(terminal): a cold-restore paint applies no window resume with the switch on

* fix(terminal): a split main starts is listed to phones and session.tabs without a window's report

* test(terminal): name the main pane start test helper as a fixture

* fix(terminal): a reconnect shows its pane starting and why it failed; a lost owner race shows no failure; a split no one asked to see keeps the phones' tab

* fix(terminal): a kept create another owner won shows no failure; the window attaches to the winner

* fix(terminal): a pane main starts at relaunch keeps its full history and starts before the window's graph lists its tab (layout-owner build only)

* feat(terminal): main replaces the empty shell a hibernated agent left and resumes the agent when a view asks; a start main could not attach shows main's own terminal_not_started (layout-owner build only)

* test(terminal): main seeds its copy of a restored pane even when a window declared one, with the switch on

* fix(terminal): a pane main started hidden paints once when its view attaches (switch-on builds only)

The view's attach snapshot, taken after main unmarks the hidden gate, already holds the bytes main
dropped, so the reveal no longer asks a second restore from main's buffer.

* refactor(terminal): main's pane start reads the pane from its own layout, not the client projection (switch-on builds only)

* fix(terminal): a pane restart stops its terminal before writing the pane unbound, so a stop that fails keeps the pane (switch-on builds only)

* test(terminal): a start main could not bind shows terminal_not_started through the window's wait, from one copy site (switch-on builds only)

* fix(terminal): main's pane start resumes an agent recorded under the pane's number, as the window did; stale switch-on tests show main's start and the known banner loss (switch-on builds only)

* fix(terminal): review round: a visible view alone retires main's hidden-start drops, by episode; main reads a split pane's numbered record by its number; the window keeps a shell main kept (switch-on builds only)

* fix(terminal): main's start of a pane a window view is attaching to leaves it visible, so the view paints once (switch-on builds only)

* fix(terminal): a window view that attaches while main starts its pane takes main's start, with no second provider attach (switch-on builds only)

* fix(terminal): review round: a view takes main's start only when it carries a payload and still owns its terminal; attaching views are counted, keep main's pre-spawn mark off, and a failed attach hides only what it kept visible (switch-on builds only)

* test(terminal): checked test doubles in the view-join and numbered-record tests; reattach options fit the file budget

* test(e2e): with the switch on, the mount-authority spec keeps the window's bindings, which only main's frames write

Claude-Session: W5b

* test(e2e): the mount-authority spec fits its line budget; the layout-owner build check is one helper

Claude-Session: W5b

* test(layout): an unbound pane holding a resume record starts and keeps the record, since main's start resumes from it

Claude-Session: W5b

* fix(terminal): a pane main resumed holds a running agent's record, so it reads awake, not sleeping (switch-on builds only)

Claude-Session: W5b

* fix(terminal): in a split where no pane owns a numbered record, main resumes the tab's one conversation in pane 1 only (switch-on builds only)

Claude-Session: W5b

* fix(terminal): main marks only the record a resume started from live, never a sleep captured after it (switch-on builds only)

Claude-Session: W5b

* test(terminal): with the switch on, a windowless resume leaves the pane's record a running agent's

Claude-Session: W5b

* test(terminal): the resumed-record test double typechecks

Claude-Session: W5b

* refactor(terminal): with the switch off, main's pane start reads no resume record for the live mark

Claude-Session: W5b

* refactor(terminal): the merged files fit their line budget: the folder-fallback notice and a hidden pane's wait for its first view are helpers, and the answering-transport lookup moves to its one test caller

Claude-Session: W5b

* refactor(runtime): the window's layout apply fits the runtime's line budget after the main merge

Claude-Session: W5b
Jinwoo-H added a commit that referenced this pull request Oct 22, 2026
…tart resumed a pane's agent, so the restored banner and reopen count come back (#31908)

* feat(terminal): the window's store shows main's pane start status (layout-owner build)

A status-only frame changes one store entry and no pane tree, so the pane's view stays mounted.

* refactor(terminal): keep the frame sync within its line budget

* feat(terminal): every pane main starts shows 'starting' from before it is written (layout-owner build)

* feat(terminal): a pane main is starting waits and attaches; a failed start shows why (layout-owner build)

Fixes owner-visible row 15: a failed agent or setup start no longer opens a plain shell.

* test(terminal): iterate store listeners directly

* fix(terminal): an exit that reports no code keeps its pane, as lost contact (layout-owner build)

* test(terminal): a pane main started attaches to main's terminal at its own grid

* test(terminal): detach census tests assert main's move and frame with the switch on

* fix(terminal): a restored pane paints history only from its terminal's host, never the window's copy (layout-owner build only)

* fix(terminal): main releases a painted cold restore only for the pane's current terminal (layout-owner build only)

* test(terminal): typed ack args in the painted cold-restore test

* test(terminal): exited-pane tests assert main's close with the switch on

These 8 have failed switch-on since #31130 moved the exit close to main.

* feat(layout): main starts the panes a client's startPane or wake names, through its one restored-pane starter (layout-owner build only)

The model's start and stop effects reach the runtime once the command is written, never the
reply. startPane starts a pane whose binding has a start status, and a slept pane from its record.
A wake keeps a pane's resume record until its start binds; a failed start keeps it and shows why.
With the switch on, main owns a running agent's wake even with a window open.

* fix(layout): a window's wake of a pane it resumed itself is record-only, so main does not start it again (layout-owner build only)

* test(layout): a client's startPane starts the pane before any other trigger

* Revert "fix(terminal): a restored pane paints history only from its terminal's host, never the window's copy (layout-owner build only)"

This reverts commit a646d89.

* test(terminal): the cold-restore repaint ack names its pane in the layout-owner build

* fix(layout): a wake keeps the pane's resume record in the pane-owned form, so a host crash resumes the agent again (layout-owner build only)

* test(layout): a failing start in the pane-start runner test throws

* feat(terminal): main writes and starts every split of a pane it holds; the window attaches (layout-owner build)

The window's split, a startup split with its command, and a CLI split all go through main's
terminal.split; main's frame mounts the pane, with or without a window intent. Deletes the
window's split wait and withdraw, the split appear intents, and the queued-split skip and cancel.
The e2e helper uses the real split. A startup split leaves focus on its source pane.

* fix(terminal): the attach-only wait leaves sleeping, resuming and held panes to their restore path

* fix(terminal): a split pane attaches to the terminal main bound it to; a taken pane id is refused

Also restores the proof that a split closed while it starts gets one answer and leaves no
pane or start status behind.

* Reapply "fix(terminal): a restored pane paints history only from its terminal's host, never the window's copy (layout-owner build only)"

This reverts commit 420e605.

* fix(layout): a trigger between a restored pane's start and its bind write joins that start, not a second one (layout-owner build only)

* fix(terminal): a window split main cannot start still shows its pane, failed, with why

* fix(terminal): keep the switch import the D1b-1 merge dropped from the layout restore

* feat(layout): main's starter shows a restored pane starting before any await, and a failed start with its reason; startPane starts a pane whose bound terminal ended (layout-owner build only)

* feat(terminal): a window's attach-only view of a pane attaches to its terminal or starts nothing, keeping the binding for main's start (layout-owner build only)

* feat(terminal): a restored pane with no live terminal asks main to start it and attaches once main binds it; the window's wake, hibernated wake, restart-on-show and gone-terminal fallbacks route through main (layout-owner build only)

* fix(terminal): check a taken pane id first, keep the start's own error, clear a gone pane's status

Three test stores gain the pane-start field the window's store always has.

* test(terminal): the admission stub answers whether its pane is still written; a closed pane's failed start clears

* test(terminal): with the switch on, the window's restores, wakes and restart replacements ask main to start the pane and attach to the terminal main binds, starting and resuming nothing themselves

* refactor(terminal): the rebound workspaces' bindings show through one call in the bindings module

* fix(terminal): a held pane connects as today so main's refusal holds it; main's start follows output; a capacity death after main's resume keeps the resume (layout-owner build only)

* fix(layout): main passes its start options only for commands that start panes; a windowed open resumes the agent under main (layout-owner build only)

* refactor(terminal): break the pane start module cycle; typed test fixtures

* test(terminal): a pane main wrote and the user closed mid-start drops its failed status

* fix(terminal): every waiter on main's start runs, a failed or refused start settles and is asked again on the next view, a hidden gone pane waits for its view, a twin main hands back stays on today's path, and lost contact never starts a pane (layout-owner build only)

* test(terminal): iterate the store listeners directly

* test(terminal): a cold-restore paint applies no window resume with the switch on

* fix(terminal): a split main starts is listed to phones and session.tabs without a window's report

* test(terminal): name the main pane start test helper as a fixture

* fix(terminal): a reconnect shows its pane starting and why it failed; a lost owner race shows no failure; a split no one asked to see keeps the phones' tab

* fix(terminal): a kept create another owner won shows no failure; the window attaches to the winner

* fix(terminal): a pane main starts at relaunch keeps its full history and starts before the window's graph lists its tab (layout-owner build only)

* feat(terminal): main replaces the empty shell a hibernated agent left and resumes the agent when a view asks; a start main could not attach shows main's own terminal_not_started (layout-owner build only)

* test(terminal): main seeds its copy of a restored pane even when a window declared one, with the switch on

* fix(terminal): a pane main started hidden paints once when its view attaches (switch-on builds only)

The view's attach snapshot, taken after main unmarks the hidden gate, already holds the bytes main
dropped, so the reveal no longer asks a second restore from main's buffer.

* refactor(terminal): main's pane start reads the pane from its own layout, not the client projection (switch-on builds only)

* fix(terminal): a pane restart stops its terminal before writing the pane unbound, so a stop that fails keeps the pane (switch-on builds only)

* test(terminal): a start main could not bind shows terminal_not_started through the window's wait, from one copy site (switch-on builds only)

* fix(terminal): main's pane start resumes an agent recorded under the pane's number, as the window did; stale switch-on tests show main's start and the known banner loss (switch-on builds only)

* fix(terminal): review round: a visible view alone retires main's hidden-start drops, by episode; main reads a split pane's numbered record by its number; the window keeps a shell main kept (switch-on builds only)

* fix(terminal): main's start of a pane a window view is attaching to leaves it visible, so the view paints once (switch-on builds only)

* fix(terminal): a window view that attaches while main starts its pane takes main's start, with no second provider attach (switch-on builds only)

* fix(terminal): review round: a view takes main's start only when it carries a payload and still owns its terminal; attaching views are counted, keep main's pre-spawn mark off, and a failed attach hides only what it kept visible (switch-on builds only)

* test(terminal): checked test doubles in the view-join and numbered-record tests; reattach options fit the file budget

* test(e2e): with the switch on, the mount-authority spec keeps the window's bindings, which only main's frames write

Claude-Session: W5b

* test(e2e): the mount-authority spec fits its line budget; the layout-owner build check is one helper

Claude-Session: W5b

* test(layout): an unbound pane holding a resume record starts and keeps the record, since main's start resumes from it

Claude-Session: W5b

* fix(terminal): a pane main resumed holds a running agent's record, so it reads awake, not sleeping (switch-on builds only)

Claude-Session: W5b

* fix(terminal): in a split where no pane owns a numbered record, main resumes the tab's one conversation in pane 1 only (switch-on builds only)

Claude-Session: W5b

* fix(terminal): main marks only the record a resume started from live, never a sleep captured after it (switch-on builds only)

Claude-Session: W5b

* test(terminal): with the switch on, a windowless resume leaves the pane's record a running agent's

Claude-Session: W5b

* test(terminal): the resumed-record test double typechecks

Claude-Session: W5b

* refactor(terminal): with the switch off, main's pane start reads no resume record for the live mark

Claude-Session: W5b

* fix(terminal): main publishes whether its start of a pane resumed the agent, for the window's banner (switch-on builds only)

Claude-Session: W5b

* fix(terminal): a pane main started shows its "session restored" or "resume unavailable" banner again (switch-on builds only)

Claude-Session: W5b

* test(terminal): the resume-banner store double carries no type assertion

Claude-Session: W5b

* fix(terminal): main records a resume outcome only when its start wakes the pane's own sleeping record, and each new start clears the old one (switch-on builds only)

Claude-Session: W5b

* fix(terminal): a renderer reload shows no resume banner again for a pane main started, and the window stops waiting once that pane holds another terminal (switch-on builds only)

Claude-Session: W5b

* refactor(terminal): the merged files fit their line budget: the folder-fallback notice and a hidden pane's wait for its first view are helpers, and the answering-transport lookup moves to its one test caller

Claude-Session: W5b

* fix(terminal): main's resume outcome arrives in the same frame as the terminal it names, a same-id respawn included (switch-on builds only)

Claude-Session: W5b

* fix(terminal): the reopened-terminals toast counts agent sessions main resumed again (switch-on builds only)

Claude-Session: W5b

* refactor(terminal): the attach's resume check names the window's resume type

Claude-Session: W5b

* test(terminal): pin the resume outcome's wire contract: an outcome alone rebinds nothing, it shows once per start, and no saved session holds it

Claude-Session: W5b

* refactor(runtime): the window's layout apply fits the runtime's line budget after the main merge

Claude-Session: W5b

* test(terminal): any create through main that wakes a pane's record publishes its outcome, and the sidebar resume keeps its restored banner (switch-on builds)

Claude-Session: W5b

* refactor(runtime): the layout stream takes main's pane facts from one source, keeping the runtime in its line budget

Claude-Session: W5b

* fix(terminal): a relaunch resume into a pane kept under its saved terminal id shows its banner again, and a start whose bind fails leaves no outcome (switch-on builds only)

Claude-Session: W5b

* fix(terminal): the reopen toast counts only a resume main made for the attached terminal since the attach began, and the banner reads main's outcome once at attach (switch-on builds only)

Claude-Session: W5b

* test(terminal): two pane test stores carry main's resume outcomes, which every attach now reads

Claude-Session: W5b

* test(terminal): the hidden-output repro's test store carries main's resume outcomes

Claude-Session: W5b

* fix(terminal): an SSH same-id resume whose bind writes nothing new keeps its banner, and a start that lost its pane leaves the winner's outcome (switch-on builds only)

Claude-Session: W5b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant