Skip to content

feat(wsl): a pane main held for a stopped distro shows the Start card - #35927

Merged
nwparker merged 1 commit into
mainfrom
nwparker/wsl-held-pane-start-card
Oct 29, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/wsl-held-pane-start-card

Conversation

@nwparker

@nwparker nwparker commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​145 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​144
Prod 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​42 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​42

ELI5

When Orca's own background work holds a terminal because its WSL distro is stopped (#35865), the pane used to show "The terminal could not start: terminal_held_wsl_distro_stopped:Ubuntu". Now it shows the same "Ubuntu is stopped" card with Start that #35813 added for held restores. If Orca couldn't check the distro, it shows #35860's "couldn't check" wording. Pressing Start starts that pane, and that press is your act, so it may start the distro.

User risk: low. This only changes panes main owns and already publishes as failed with a WSL hold reason. That happens only in the layout-owner build, where main owns the pane layout, so in shipped builds nothing changes. Other failures still show their message as before.

What Changed

Why

It reuses the existing pieces, so there is no second card or store: #35813's card and store, #35860's states, and main's one start for an owned pane (ensureRestoredPaneStarted). layout.reopenHeldPanes isn't reused because it first stops newer daemons, which is specific to the newer-build hold.

Third of the stopped-distro follow-ups after #35857 and #35865.

Linked Issue

N/A (maintainer change; follow-up to #35813 and #35865)

Visual Proof

N/A: the card is #35813's existing WslDistroStoppedCard, unchanged. It now also appears on a main-owned held pane, which exists only in the layout-owner build, not in shipped builds.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated:
    • wsl-held-pane-start-layout-owner.test.ts (real runtime, layout-owner build):
      • a held start publishes failed with the hold reason, and main's own start didn't name the user's act;
      • startWslHeldTerminalPanes spawns with wslUserAct and clears the failure.
    • main-pane-start-wait.test.ts:
      • a held failure shows the card instead of the error text, and Start calls layout.startWslHeldPanes with the pane;
      • the card clears when main's start ends;
      • an unverifiable hold carries state: 'unverifiable'.
  • Ran pnpm tc, pnpm run typecheck:ci, oxlint, the anti-slop lint, check:code-quality:changed, the ast-grep test and gates, verify:rpc-params-catalog, and the pty-connection and layout-owner tests (1,113 passed).

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

  • Mixed versions: the new RPC is local to the window, which always ships with its own main. The published pane status is unchanged (failed with a reason), so older and paired clients behave as before.
  • SSH: untouched. Server panes skip the card.

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)

The renderer maps main's terminal_held_wsl_distro_stopped start failure to #35813's shared stopped card; its Start calls layout.startWslHeldPanes, which starts each pane through ensureRestoredPaneStarted as the user's act.
@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 4/5

[Low impact] The change is limited to explicit Start actions for main-owned WSL-held panes.

The PR appears safe to merge, with a non-blocking stale-card issue.

Findings

  1. P2 Old WSL card stays visible ▶

Summary

This PR shows the shared WSL Start card for local panes whose main-owned start was held.

  • Held WSL panes now show a Start card and can start on request.

Diagram

sequenceDiagram
  participant Main
  participant Window
  participant User
  Main->>Window: Publish failed with WSL hold reason
  Window->>User: Show shared Start card
  User->>Window: Press Start
  Window->>Main: layout.startWslHeldPanes
  Main->>Main: ensureRestoredPaneStarted with wslUserAct
  Main->>Window: Publish start result
Loading

Reviews (1) · Last reviewed commit: "feat(wsl): a pane main held for a stoppe..." · Reviewed by Greptile

Comment on lines +113 to +114
const hold = reason ? parseWslDistroHold(reason) : null
if (hold && !session.disposed && !session.runtimeEnvironmentId) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Old WSL card stays visible

A retry that fails for another reason does not clear the previous WSL card. For example, after the distro starts outside Orca, automatic tab activation can retry the pane and fail because its directory is missing. Both starting and failed stay inside the wait, so neither reaches the card cleanup. The pane still says the distro is stopped alongside the new error.

Clear the old hold when main publishes a non-WSL failure, and add a test for that transition.

@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Walkthrough

The runtime adds a workspace RPC to retry WSL-held panes and starts each pane with a user-action trigger. The renderer registers a hold card for applicable WSL start failures, avoids reporting those failures as PTY errors, and calls the new RPC when the card is released. The renderer also clears the card when a later start outcome occurs. Tests cover runtime retry behavior and renderer hold-card behavior.

Priority: Normal

Merge Risk: Low · up to f965d

WSL recovery can show an outdated card or lose its Start action after an error. The change is mergeable with awareness of these localized issues.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… 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 and concisely describes the main change: showing a Start card for a pane held by a stopped WSL distro.
Description check Passed The description is complete and relevant. It explains the user impact, implementation, scope, rationale, testing, visual-proof exception, and compatibility considerations. It references existing follo…
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 complete and relevant. It explains the user impact, implementation, scope, rationale, testing, visual-proof exception, and compatibility considerations. It references existing follow-up issues instead of providing a Fixes link, and manual testing plus the full local command checklist are not marked complete, but these are non-critical omissions.

Full details: Docstring Coverage

Explanation

Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 3 functions across 5 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

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.

@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
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 99adcad7-0bc0-4a1e-82eb-448ce1e6d80a
Commits

Reviewing files that changed from the base of the PR and between 43ed987 and f965d11.

Files ignored due to path filters: 1
  • src/shared/rpc-contract/rpc-params-catalog.generated.ts is excluded by !**/*.generated.*
Files selected for processing: 5
  • src/main/runtime/rpc/methods/workspace-layout.ts
  • src/main/runtime/session-lifecycle/projection/restored-pane-materialize.ts
  • src/main/runtime/wsl-held-pane-start-layout-owner.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection/main-pane-start-wait.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection/main-pane-start-wait.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 +75 to +76
heldCards.get(session)?.()
heldCards.delete(session)

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.

Minor · Functional Correctness · Quick win

Clear the hold card when the failure reason changes.

If another start attempt fails for a non-WSL reason, failed remains gated. The failure handler reports the new error, but this cleanup does not run. The obsolete WSL Start card remains visible. Clear the prior card before handling a new failure that is not a WSL hold. (raw.githubusercontent.com)

Comment on lines +125 to +126
release: () =>
callRuntimeRpc({ kind: 'local' }, 'layout.startWslHeldPanes', { panes: [pane] })

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.

Minor · Stability & Availability · Quick win

Keep the Start action available if the RPC fails before a start attempt.

startHeldPanesForWslDistro removes the card before calling release() and does not handle a rejected promise. If the local RPC rejects before main starts the pane, no start-state update restores the card. The user cannot retry Start from that card. Handle the rejection and restore the card while the pane remains held. (raw.githubusercontent.com)

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