Skip to content

fix(terminal): a slow window no longer makes orca terminal create fail and then duplicate - #28158

Merged
Jinwoo-H merged 9 commits into
mainfrom
fix/cli-terminal-create-main-start
Oct 13, 2026
Merged

Jinwoo-H merged 9 commits into
mainfrom
fix/cli-terminal-create-main-start

Conversation

@Jinwoo-H

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

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 8 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​516 $\color{#cf222e}{\Huge{\mathbf{−}}}$​152 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​364
Prod 14 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​233 $\color{#cf222e}{\Huge{\mathbf{−}}}$​64 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​169

ELI5

When you ran orca terminal create --focus, or created a terminal that runs an interactive coding agent, Orca asked the window to make the terminal and gave the window 10 seconds. If the window was slow, the command said "failed" — but the window still made the terminal a moment later. Running the command again then gave you two terminals. Now Orca's background process starts the terminal itself and only asks the window to show it, so a slow window can only delay showing the tab, never turn a success into a failure.

What Changed

Before (as a user sees it): with a busy or slow window, orca terminal create --worktree <wt> --focus (or with --command naming an interactive coding agent) printed Terminal creation timed out, then the tab appeared anyway. A retry made a duplicate.

After: the command prints the new terminal's handle as soon as the terminal is running. If the window has not shown it within 10 s, the reply carries the existing warning ("Terminal … is running, but Orca could not make it discoverable … run orca terminal focus") instead of an error, and nothing runs twice.

Size of a new terminal: a terminal started in Orca's background process now starts at the size of the tab group it will open in: the group the caller named, else the workspace's active group. The window measures that size and reports it to Orca's background process; when the tab is opened, the window fits it to its pane as before. Before this PR, every such terminal started at a fixed 120x40 (from #1707, May 2026) and was only resized when its tab was opened, so an agent that draws at startup kept output wrapped to the wrong width. That also applies to creates that were already started in the background on main, such as orchestration workers and agent launches: they now start at the group's real size too. A workspace not shown since Orca started has no group on screen to measure; if its saved layout has at most one group, the terminal starts at the size a single-group workspace gets, since every workspace shares the same content area. It still starts at 120x40 when there is no measurement to use: no window at all (a remote orca serve or orcad host, as on main today), a workspace with two or more groups not shown since Orca started, or no terminal pane at the default font size mounted yet.

How the size is measured: for each tab group on screen, the window computes the terminal grid an unsplit terminal would get there, using one small function that mirrors the terminal library's own fit calculation (pinned by a test against that library's result). It reads the cell size from any mounted pane at the default font size with no title strip or banner. It also sends the grid for a single-group workspace: the content area minus the space a lone group's tab row and border take, measured once on any shown single-group workspace (only group bodies inside the content area count, so the floating terminal panel and hidden workspaces do not). It sends the results on its existing window-to-main graph update, and sends it again when a group's grid changes (a resize observer on each group). The field is a separate part of that window-to-main update: it is never copied into the tab list that phones and paired clients receive, and the web client never sends it.

Mechanism: createTerminal had two paths. One (used by phones, orchestration workers, agent launches and plain CLI creates) starts the terminal in Orca's background process and then asks the window to show it, best-effort. The other asked the window to create and start the terminal, and gave up after 10 s with no way to cancel the request. That second path was taken for any focused create and for CLI creates flagged rendererBacked (interactive coding-agent commands). Now every create that names a workspace takes the first path; the window-made path remains only for a create with no workspace, which lands in whatever workspace the window shows and so needs the window.

Removed with it:

  • the host's routing on rendererBacked. The host has to stop honouring it, because that flag is exactly what sent interactive-agent creates down the window-made path. The CLI keeps sending it, as isolated compatibility code: hosts before v1.4.211 (fix(runtime): answer startup terminal queries for background-created terminals #22384) don't reply to a background-started agent's startup questions, so a new CLI talking to such a host (for example an app updated on disk but not yet restarted) still needs that host to start the agent in the window. Delete the CLI side once those hosts can no longer run alongside this CLI.
  • the workspace branches of the window-made path, which nothing reaches any more.

Why

The alternative was to make the window acknowledge each request and let the background process cancel one that timed out. That is a new request/ack/cancel protocol between the background process and the window. The "start here, show best-effort" path already exists, is what every other caller uses, and has no request that can time out and still complete — so the duplicate cannot happen by construction.

The window-made path for these creates came from two older rules:

The 10 s give-up itself was added in #734 (CLI terminal create) and is kept for the no-workspace path, where the window really is the only one who can make the terminal.

Linked Issue

N/A (internal legacy-rule cleanup, rule 7).

Visual Proof

Real app, windows hidden, two tab groups with the active one split in two, then orca terminal create --command <agent> without --focus, then open the new tab. The agent prints its starting size and draws a box and ruler as wide as its terminal:

Starting size On open Box after opening
main 63x60 (the window made the tab and measured it hidden) resized to 66 63 wide, not wrapped
this PR 66x63, the group's real grid no resize needed 66 wide, not wrapped
an earlier head of this PR (fixed 120x40) 120x40 resized to 66 wrapped onto two lines

The new tab landed in the active (second) group in both builds; the window's own placement decides that.

Second probe: the same command into a new workspace that was never shown since Orca started (its groups are not on screen), then switch to it and open the tab:

Starting size On open
main 227x80 resized to 239
this PR 239x80, the single-group size no resize needed, ruler 239 wide on one line

Testing

  • New test reports the running CLI terminal, not a failure, when the window is slow (terminal-creation-and-readiness-part-04.spec.ts), driven through the real terminal.create RPC with the two parameter shapes the CLI sends (--focus, and an interactive agent with rendererBacked). On main both cases fail with Terminal creation timed out after the window was sent terminal:requestTabCreate; on this branch both return the running terminal with the reveal warning, spawn once, and never ask the window to create.

  • New tests: terminalGridSizeForBox matches the terminal library's fit result for five shapes; the group measurement skips zoomed and titled panes and leaves the field out when nothing is measurable; the window republishes only when a group grid changes; main uses the named group, else the window's latest active group, else the single-group size for a workspace with at most one saved group, else 120x40; a measured group beats the single-group size; the single-group size is learned only from a lone body inside the content area (a floating-panel body and a hidden body are ignored).

  • pnpm vitest run over src/main/runtime and src/cli (1297 files) pass; pnpm tc, oxlint and check:code-quality:changed pass.

  • Full e2e suite on this head and on main at the same base, plus the layout-oracle and CLI terminal specs: no failure that only happens on this head reproduces on re-run (details in the comment below).

  • I manually tested these changes locally

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

Review

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

  • SSH/remote: the remote CLI never sent rendererBacked, and paired clients were already forced to background creates; SSH workspaces take the same background start as before.
  • Mixed versions: this CLI still sends rendererBacked, which this host accepts and ignores, and which an older host (before v1.4.211) still routes on, so an old host keeps starting interactive agents in the window as it did. An older CLI against this host gets the background start.
  • Kill-switch caveat: the startup replies come from main's terminal query handling. With terminalModelQueryAuthority or terminalHiddenDeliveryGate turned off, a focused agent started this way gets no startup replies (before, a focused create was started by the window, which replied itself).
  • Side benefit: focused agent-session creates are now recoverable after a lost spawn, because the background path keeps preAllocatedHandle and the spawn-commit callback that the window-made path dropped.
  • Side effect, deliberate: focused agent launches (without a reserved pane) and focused agent-session creates on a desktop host also went through the window-made path, with the same 10 s give-up, and now start in Orca's background process too. What users see: the same focused tab in the same workspace. Differences: the agent starts at the measured size of the group its tab opens in (see "Size of a new terminal"); a window that takes over 10 s to show the tab yields a "running but not shown" warning instead of a failed launch; and the reply can arrive slightly sooner because it no longer waits for the window to build the tab.
  • Known gaps: a font-size or font-family change republishes the group sizes only with the next graph update, not by itself; the only remaining size gap is a workspace with two or more groups not shown since Orca started: it gets 120x40 and is resized when its tab is opened, where main's window-made create would have measured it hidden. Its groups are not on screen until it is shown, and computing their sizes from saved split ratios was ruled out.
  • Unchanged: a create with no workspace still goes through the window (legacy rule 8), and the phone's own create flow (legacy rule 12) is untouched.

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)

…w window cannot duplicate them

A focused or interactive-agent `orca terminal create` asked the window to make the
terminal and reported failure after 10 s, while the window still made it later; a
retry then made a second one. Main now starts every terminal that names a workspace
and shows it in the window best-effort, as it already did for every other create.
@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d79907a6-5db9-4a60-af6a-24edb50145a0
📥 Commits

Reviewing files that changed from the base of the PR and between 4624292 and 7f835a2.

📒 Files selected for processing (8)
  • src/main/runtime/orca-runtime-create-terminal.ts
  • src/main/runtime/orca-runtime-sync-window-graph.ts
  • src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-04.spec.ts
  • src/renderer/src/runtime/sync-runtime-graph-terminal-group-grid-sizes.test.ts
  • src/renderer/src/runtime/sync-runtime-graph/graph-publication.ts
  • src/renderer/src/runtime/sync-runtime-graph/terminal-group-grid-sizes.test.ts
  • src/renderer/src/runtime/sync-runtime-graph/terminal-group-grid-sizes.ts
  • src/shared/runtime-session-contracts.ts

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

📝 Walkthrough

The renderer now measures terminal group dimensions and includes changed measurements in the runtime graph. The runtime merges incoming dimensions and uses the selected size for PTY creation, with a 120-by-40 fallback. Terminal creation no longer uses the rendererBacked option. Desktop creation uses the authoritative window and sends supplied terminal options directly. Related tests and host-version compatibility comments are updated.

Priority: ➖ Normal

Merge Risk: 🔵 Low · up to 7f835

Terminal sizes published by the window are stored without range checks. A malformed or extreme size could produce a badly sized terminal. The window is Orca's own and the effect is narrow, so merging with owner awareness is reasonable.

Pre-merge checks · Passed 4 · Failed 1

Failed Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 44.44% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 18 functions across 20 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks (4 passed)
Check name Status Explanation
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.
Title check Passed The title clearly identifies the main user-facing fix: slow windows no longer cause terminal creation to fail and create duplicates.
Description check Passed The description is detailed and covers the required explanation, user-visible changes, rationale, visual proof, testing, compatibility considerations, and checklist. The linked issue is marked N/A wit…
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • 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.

@Jinwoo-H

Copy link
Copy Markdown
Contributor Author

e2e results for head 66ba624 (base 4d1001f):

  • Full suite, head: run 38343127951. Full suite, base: run 38343129769. Both runs fail; head shows 32 distinct failing tests and base shows 30.
  • Three tests failed on head but not on base: markdown-prose-reflow, ssh-orcad-markdown-conversion, and worktree-delete-dialog-layout (batch case). None of them creates a terminal. I re-ran all three once on both heads (head 38349092298, base 38349094199):
    • the two markdown specs pass on head;
    • worktree-delete-dialog-layout fails on both head and base (in the known-dirty case).
    • No failure that only happens on head reproduces.
  • Targeted run on head: run 38343131573. It covered the layout oracle (base, headless, latency), local-cli-terminal-retention, headless-serve-focused-terminal-create, terminal-codex-hidden-startup-background, live-background-terminal-mount-authority, terminal-send-agent-prompt-submit and paired-cli-terminal-graph-sync-tab-retention.
    • First attempt: one failure, in live-background-terminal-mount-authority (terminal.list returned terminal_surface_ownership_unavailable). That flow creates terminals in the background, so this change does not touch it, and the same test passed in the head full run.
    • Re-running the failed job passed. The same spec also passed on base (run 38347372054).

…ed pane size

An unfocused CLI agent opens as an inactive tab that is not resized until the user
opens it, so starting it at 120x40 left its output wrapped to 120 columns. Start it at
the size of the pane active in the worktree's active group, where the new tab opens;
fall back to 120x40 only when that worktree has no measured pane.
Hosts without #22384 leave a background-started agent's startup queries unanswered,
so a new CLI talking to an old, still-running host must keep routing interactive agents
to the window. Newer hosts ignore the flag.
…heir tab group

The window publishes, on its graph sync to main only, the grid an unsplit terminal
would get in each shown tab group, computed by one pure function that mirrors
FitAddon.proposeDimensions and is pinned against it; a ResizeObserver on each group
body republishes when that grid changes. Main starts a new terminal at the size of the
group it opens in (the named group, else the active one) and falls back to 120x40 only
when no window measured it. This replaces the active-pane lookup, which mis-sized split
groups and could read a phone's fitted size.

@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/renderer/src/runtime/sync-runtime-graph.ts (1)

73-90: 🚀 Performance & Scalability | 🔵 Trivial | 💤 Low value

Grid-size observer can republish repeatedly while the last sync is unacknowledged or fails.

publishedTerminalGroupGridSizesKey is set only after syncWindowGraph resolves (see graph-publication.ts Line 199). During an in-flight sync or after a failed sync, every ResizeObserver callback sees a key mismatch and calls scheduleRuntimeGraphSync. During a window drag, this schedules a coalesced sync per resize burst. Each sync rebuilds the full graph. The cost is bounded by the coalesce timer and the in-flight flag, so the impact is small. Consider caching the measured key at call time to skip duplicates.


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 732e8fc9-60dc-426d-8f35-bd607d3453fe
📥 Commits

Reviewing files that changed from the base of the PR and between a2d91d7 and 55fa598.

📒 Files selected for processing (13)
  • src/cli/handlers/terminal.ts
  • src/main/runtime/orca-runtime-create-terminal.ts
  • src/main/runtime/orca-runtime-sync-window-graph.ts
  • src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-04.spec.ts
  • src/renderer/src/components/tab-group/TabGroupPanel.tsx
  • src/renderer/src/lib/pane-manager/terminal-grid-size-for-box.test.ts
  • src/renderer/src/lib/pane-manager/terminal-grid-size-for-box.ts
  • src/renderer/src/runtime/sync-runtime-graph-terminal-group-grid-sizes.test.ts
  • src/renderer/src/runtime/sync-runtime-graph.ts
  • src/renderer/src/runtime/sync-runtime-graph/graph-publication.ts
  • src/renderer/src/runtime/sync-runtime-graph/graph-state.ts
  • src/renderer/src/runtime/sync-runtime-graph/terminal-group-grid-sizes.ts
  • src/shared/runtime-session-contracts.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/cli/handlers/terminal.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.

Comment on lines +73 to +79
if (graph.terminalGroupGridSizes) {
// Merged, not replaced: a group in a worktree the window is not showing keeps its last size.
this.terminalGroupGridSizes = {
...this.terminalGroupGridSizes,
...graph.terminalGroupGridSizes
}
}

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:

sed -n '60,90p' src/main/runtime/orca-runtime-sync-window-graph.ts
sed -n '20,75p' src/main/runtime/orca-runtime-create-terminal.ts
sed -n '115,140p' src/main/runtime/orca-runtime-create-terminal.ts
rg -n -m 8 'syncWindowGraph' src/main/runtime/rpc src/main/ipc

Repository: stablyai/orca

Length of output: 7536


🏁 Script executed:

set -e
printf '%s\n' '--- IPC registration ---'
nl -ba src/main/ipc/runtime.ts | sed -n '1,75p'
printf '%s\n' '--- graph contract and size declarations ---'
rg -n -F --glob '*.ts' -e 'terminalGroupGridSizes' -e 'interface WindowGraph' -e 'type WindowGraph' -e 'syncWindowGraph' src/main src/shared src/renderer 2>/dev/null || true
printf '%s\n' '--- create-terminal relevant declarations and calls ---'
nl -ba src/main/runtime/orca-runtime-create-terminal.ts | sed -n '1,210p'
printf '%s\n' '--- PTY controller/admission definitions ---'
rg -n -F --glob '*.ts' -e 'adoptStablePane' -e 'spawnInAdmittedPane' -e 'RuntimePtyController' src/main src/shared 2>/dev/null || true

Repository: stablyai/orca

Length of output: 41653


🏁 Script executed:

set -e
printf '%s\n' '--- graph type ---'
nl -ba src/shared/runtime-session-contracts.ts | sed -n '145,180p'
rg -n -F --glob '*.ts' -e 'RuntimeRendererSyncWindowGraph' src/shared src/main | head -20
printf '%s\n' '--- runtime PTY contract ---'
nl -ba src/main/runtime/runtime-pty-controller-contract.ts | sed -n '1,85p'
printf '%s\n' '--- pane admission ---'
nl -ba src/main/runtime/runtime-pane-admission.ts | sed -n '1,125p'
printf '%s\n' '--- stable-pane adoption ---'
nl -ba src/main/ipc/pty/pane/adopt-stable.ts | sed -n '1,125p'
printf '%s\n' '--- size validation in relevant PTY/runtime code ---'
rg -n -S --glob '*.ts' '(Number\\.is(Integer|Finite)|cols\\s*[<>]=?|rows\\s*[<>]=?|validate.*(cols|rows)|(cols|rows).*validate)' src/main/ipc/pty src/main/runtime | head -120

Repository: stablyai/orca

Length of output: 13617


🏁 Script executed:

set -e
printf '%s\n' '--- stable-pane owner attachment ---'
rg -n -F --glob '*.ts' -e 'function attachStablePaneOwner' -e 'const attachStablePaneOwner' src/main/ipc/pty
nl -ba src/main/ipc/pty/pane/stable-owner.ts | sed -n '1,180p'
printf '%s\n' '--- concrete PTY controller spawn ---'
nl -ba src/main/ipc/pty/runtime/controller.ts | sed -n '1,150p'
printf '%s\n' '--- provider spawn bindings ---'
rg -n -S --glob '*.ts' 'spawn\\s*\\(|spawnPty|cols|rows' src/main/ipc/pty/runtime src/main/providers/pty-provider* src/main/providers | head -180

Repository: stablyai/orca

Length of output: 14417


🏁 Script executed:

set -e
printf '%s\n' '--- stable-pane attachment body ---'
nl -ba src/main/ipc/pty/pane/stable-owner.ts | sed -n '172,300p'
printf '%s\n' '--- runtime spawn implementation ---'
nl -ba src/main/ipc/pty/runtime/spawn.ts | sed -n '1,220p'
printf '%s\n' '--- provider contract and concrete spawn definitions ---'
rg -n -F --glob '*.ts' -e 'export type PtySpawnOptions' -e 'export interface IPtyProvider' -e 'spawn(opts' -e 'spawn(options' -e 'spawnPty' src/main/providers src/main/ipc/pty | head -160

Repository: stablyai/orca

Length of output: 12127


🏁 Script executed:

set -e
printf '%s\n' '--- provider spawn contract ---'
nl -ba src/main/providers/pty-provider-contract.ts | sed -n '40,155p'
printf '%s\n' '--- runtime spawn option construction ---'
nl -ba src/main/ipc/pty/runtime/spawn-options.ts | sed -n '1,220p'
printf '%s\n' '--- runtime spawn execution ---'
nl -ba src/main/ipc/pty/runtime/spawn-execute.ts | sed -n '1,180p'

Repository: stablyai/orca

Length of output: 28086


Validate renderer-supplied PTY dimensions before merging.

The IPC handler does not validate terminalGroupGridSizes. Invalid or extreme cols and rows can reach both stable-pane adoption and the PTY provider. Filter entries to finite integers in a bounded range before storing them.

🐛 Suggested fix
--- "a/src/main/runtime/orca-runtime-sync-window-graph.ts"
+++ "b/src/main/runtime/orca-runtime-sync-window-graph.ts"
@@ -70,13 +70,23 @@
       this.rendererGeneration = null
     }
 
     if (graph.terminalGroupGridSizes) {
       // Merged, not replaced: a group in a worktree the window is not showing keeps its last size.
-      this.terminalGroupGridSizes = {
-        ...this.terminalGroupGridSizes,
-        ...graph.terminalGroupGridSizes
+      const valid = Object.create(null) as Record<string, { cols: number; rows: number }>
+      for (const [groupId, size] of Object.entries(graph.terminalGroupGridSizes)) {
+        if (
+          Number.isInteger(size?.cols) &&
+          Number.isInteger(size?.rows) &&
+          size.cols >= 1 &&
+          size.cols <= 1000 &&
+          size.rows >= 1 &&
+          size.rows <= 1000
+        ) {
+          valid[groupId] = { cols: size.cols, rows: size.rows }
+        }
       }
+      this.terminalGroupGridSizes = { ...this.terminalGroupGridSizes, ...valid }
     }
     const graphWasReady = this.graphStatus === 'ready'
     const previousTabs = this.tabs
     const previousLeaves = this.leaves
📝 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
if (graph.terminalGroupGridSizes) {
// Merged, not replaced: a group in a worktree the window is not showing keeps its last size.
this.terminalGroupGridSizes = {
...this.terminalGroupGridSizes,
...graph.terminalGroupGridSizes
}
}
if (graph.terminalGroupGridSizes) {
// Merged, not replaced: a group in a worktree the window is not showing keeps its last size.
const valid = Object.create(null) as Record<string, { cols: number; rows: number }>
for (const [groupId, size] of Object.entries(graph.terminalGroupGridSizes)) {
if (
Number.isInteger(size?.cols) &&
Number.isInteger(size?.rows) &&
size.cols >= 1 &&
size.cols <= 1000 &&
size.rows >= 1 &&
size.rows <= 1000
) {
valid[groupId] = { cols: size.cols, rows: size.rows }
}
}
this.terminalGroupGridSizes = { ...this.terminalGroupGridSizes, ...valid }
}

… and use the live active group

A pane with a title or banner pushes its xterm host down, which skewed every group's
row count; skip it like a zoomed pane. Size from the window's latest published active
group, which is where its reveal places the tab, before the saved session's.
@Jinwoo-H

Copy link
Copy Markdown
Contributor Author

e2e results for head 4624292 (base 4d1001f):

  • Targeted run 38363221798: passed. It covered:
    • the layout-oracle specs: base, headless and latency;
    • local-cli-terminal-retention;
    • headless-serve-focused-terminal-create;
    • terminal-codex-hidden-startup-background;
    • live-background-terminal-mount-authority;
    • terminal-send-agent-prompt-submit;
    • paired-cli-terminal-graph-sync-tab-retention.
  • Full suite: head run 38363224745 had 32 distinct failing tests, and base run 38343129769 had 30.
  • Five tests failed on head but not on base:
    • markdown-large-paste-selection
    • native-chat-history-prepend-anchor
    • ssh-orcad-legacy-relay-bridge
    • ssh-orcad-terminal-root-owner
    • terminal-inline-tui-reveal-convergence
  • Re-run of those five on both: all five pass on head (38378313224). On base (38378317050), native-chat-history-prepend-anchor fails.
  • No failure that only happens on head reproduces.

@Jinwoo-H

Copy link
Copy Markdown
Contributor Author

CI for 91288a4 (code head; eaa2a7b and bedc0ad are empty commits that refresh the merge with main after #28297 and #28301 fixed a main-side replay test):

  • Targeted e2e (terminal create specs): 38386211880 passed.
  • Full e2e: 38386215368 had 15 failing tests vs 15 on base 4d1001f (38343129769). The only test that failed on head and not base was browser-tab.spec.ts:722 (missing webview). Rerun on both: head 38396721769 passed, base 38396724441 passed. No head-only failure reproduces.
  • PR checks on eaa2a7b: all pass.

@Jinwoo-H
Jinwoo-H merged commit 24bda71 into main Oct 13, 2026
51 checks passed
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