Skip to content

fix(orcad): recover a host whose PID/readiness markers are empty and nothing runs the slot - #51342

Merged
nwparker merged 2 commits into
mainfrom
nwparker/wsl-empty-orcad-markers
Nov 28, 2026
Merged

nwparker merged 2 commits into
mainfrom
nwparker/wsl-empty-orcad-markers

Conversation

@nwparker

@nwparker nwparker commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Problem

On a WSL host, a staged server update could stay blocked for good with "The terminal daemon did not answer a session count". This happened when the old active slot held zero-byte .orcad-pid and .orcad-readiness files, even with neither orcad nor the terminal daemon running. Force did not help. The only way out was to delete the files by hand.

Cause: the shared POSIX liveness probe (orcadLivenessProbeCommand, used by both WSL and SSH-managed hosts) reported UNKNOWN whenever the PID file was empty or unparseable and either marker file existed. UNKNOWN never counts as proof the server stopped. So the wake never restarted the old slot, its census never ran, and the update deferred as orcad_update_terminal_census_unavailable. That census also counted as unanswered, so it was not forceable. The SSH fix for #34149 (PR #39616) dealt with zsh's lowercase "no such process" for a PID that was recorded. It did not touch the empty-marker branch.

Fix

  • Liveness (new orcad-remote-pid-marker.ts, used by orcad-remote-launch.ts): when the markers name no PID, the probe now scans process argv for this slot's orcad.js or orcad-server.js, skipping the probe's own shells.
    • No match: DEAD. The wake relaunches the slot, the launch rewrites both markers, and the fresh server's census decides the update.
    • It fails closed, staying UNKNOWN, when:
      • a process runs this slot (for example a launch still in progress)
      • /proc lists a process whose argv can't be read (unreadable cmdline, or tr missing)
      • processes can't be listed at all
    • The ps fallback (hosts without /proc) reports a match through command substitution, not exit in a pipeline stage, so it behaves the same in every shell. Checked under sh, bash, dash, zsh and ksh.
    • Matching argv rather than a PID means PID reuse can't fake a live slot or hide one that is starting.
  • What DEAD means: DEAD only says orcad itself has stopped. It does not touch the terminal daemon. After the relaunch, the woken server's census counts the daemon's sessions as usual. A version directory that still serves a live daemon stays pinned against GC by orcadGcPinnedDirNames(record, liveDaemonVersion), and a DEAD orcad does not change that.
  • Writer (orcad-remote-launch.ts): both launch paths (setsid for WSL, nohup for SSH) now remove the previous PID before detaching. They then write the new PID to .orcad-pid.tmp and rename it into place. A failed or interrupted write leaves no PID file, never an empty one or the previous run's PID. The readiness file is orcad's stdout, so it stays a plain redirect; an empty one is handled by the probe.
  • Naming the blocking check (wsl-orcad-incumbent.ts, orcad-update-plan.ts, orcad-terminal-census.ts): when the incumbent can't be woken, the deferral says which check blocked it at every force level: an inconclusive liveness check, a held activation lock, or refused recovery. Previously it blamed a daemon that never answered or never reported its protocol. The reason travels on a client-side unansweredBecause census field that never goes over the wire. Sessions stay guarded: the deferral is still not forceable.

Tests

  • orcad-remote-empty-markers.integration.test.ts runs the real commands in /bin/sh:
    • zero-byte PID, non-numeric PID, or a readiness file alone with no process: DEAD
    • a process running this slot's orcad.js or orcad-server.js: UNKNOWN
    • a process running another slot: DEAD
    • unlistable processes (no /proc): UNKNOWN
    • unreadable /proc argv (Linux only): UNKNOWN
    • a failed PID write leaves no PID file. This fails when the writer is made non-atomic.
    • both launch modes drop the old PID and use the atomic writer
  • wsl-orcad-incumbent.test.ts: an unverifiable or fenced wake produces a deferral that names the check, under no force, live-terminal force and full force. It stays non-forceable, and the recount keeps the reason.
  • The new tests fail on revert. The existing install, lifecycle, WSL and SSH suites pass, and so does pnpm check:changed.
  • Ran on macOS, which takes the ps path. The /proc path runs in Linux CI.
  • Real-WSL validation is still pending.

Performance

The process scan only runs when a slot's markers name no PID, which is rare: after a crash, or during a launch. Its cost is one tr fork per process listed in /proc, or a single ps call. The normal recorded-PID path is unchanged. Each launch adds one rm and one mv.

Fixes #51014

… stale

An empty or unparseable .orcad-pid next to a .orcad-readiness file read as
UNKNOWN forever, so the incumbent was never woken, its census never answered,
and a staged WSL update deferred permanently. The liveness probe now scans
process argv for the slot's entry files: none means DEAD, so the wake relaunches
the slot and its census decides the update. A process still running the slot,
or no way to list processes, stays UNKNOWN. PID writes now go through a temp
file and rename, and an incumbent that could not be woken names the check that
blocked it instead of blaming a silent terminal daemon.

Fixes #51014
… nohup launch

- nohup launches remove the previous PID before detaching, as setsid ones do.
- The /proc scan reports unprovable when a listed process's argv cannot be read.
- The ps fallback reports a match through command substitution, not exit.
- PID writer and slot scan move to orcad-remote-pid-marker.ts, with tests.
- Full force names the blocking check instead of a silent daemon protocol.
@coderabbitai

coderabbitai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Walkthrough

The POSIX liveness probe now checks for slot processes when PID markers are empty or invalid. Launch commands remove old PID markers and write new markers atomically. WSL incumbent handling preserves explanations for blocked or unverifiable wakes, and update planning uses unanswered-census explanations when deferring an update.

Severity of issue fixed: Medium

Merge Risk: Moderate · up to dd9bf

The change lets WSL and SSH hosts recover when PID markers are empty. Two launch-path flaws can still leave the PID marker missing or wrong, which blocks recovery or misreports launch success. A minor message defect also remains: a failed recovery launch is reported as lock contention. Fix the nohup removal ordering and the shared temp file before merging.

Pre-merge checks: Passed 3 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Description check Warning The description covers the problem, the fix, tests, performance, and a linked issue (Fixes #51014). It explains the mechanism clearly, including the liveness probe scan, the atomic PID writer, and the… Add the missing template sections: (1) an ELI5 summary in plain language; (2) a What Changed section with the before and after behavior the user sees; (3) a Why section that compares this approach with alternatives; (4) a Visual Proof secti…
Passed Passed checks: 3 passed

Check name Status Explanation
Title check Passed The title names the fix and its trigger: recovering a host whose PID and readiness markers are empty when nothing runs the slot. The changeset adds a process scan to the liveness probe so an empty-mar…
Linked Issues check Passed Directly linked issue #51014 has three coding requirements.

(1) Recover a WSL host when markers are empty and the old server has exited. At head, orcad_unnamed in `src/main/managed-server/install/o…
Out of Scope Changes check Passed All changed files relate to the #51014 objective. orcad-remote-pid-marker.ts holds the POSIX slot scan and the atomic PID writer. orcad-remote-launch.ts and orcad-remote-host-support.ts use them…
Full details: Title check

Explanation

The title names the fix and its trigger: recovering a host whose PID and readiness markers are empty when nothing runs the slot. The changeset adds a process scan to the liveness probe so an empty-marker slot with no running server is reported DEAD and relaunched. It also covers the atomic PID write and the named blocking check, which the title does not mention, but the main change is clearly captured.

Full details: Linked Issues check

Explanation

Directly linked issue #51014 has three coding requirements.

(1) Recover a WSL host when markers are empty and the old server has exited. At head, orcad_unnamed in src/main/managed-server/install/orcad-remote-pid-marker.ts returns DEAD only when orcad_slot_busy returns 1 (no process argv names this slot's orcad.js or orcad-server.js). The /proc scan returns 2 (unprovable) when a listed process cannot be read while still present. The ps fallback returns 2 when the process list is unavailable. The liveness probe in orcad-remote-launch.ts calls orcad_unnamed() when the PID marker is empty or invalid. The wake then relaunches the slot, and the fresh census decides the update.

(2) WSL regression test with zero-byte files and a stopped server. orcad-remote-empty-markers.integration.test.ts covers zero-byte and non-numeric PID markers with no process (DEAD). wsl-orcad-incumbent.test.ts covers the deferral path for unverifiable and fenced wakes.

(3) When state is ambiguous, keep guarding sessions and name the blocking check. Unprovable scans return UNKNOWN. wsl-orcad-incumbent.ts, orcad-update-plan.ts, and orcad-terminal-census.ts carry unansweredBecause, and the deferral stays non-forceable.

Limits: The probe matches only orcad.js and orcad-server.js argv, not the terminal daemon. The issue asks that the daemon also be confirmed stopped. The design relies on the relaunched census to count daemon sessions, so live sessions still block the update. This is a design inference. The incremental diff from the previous reviewed head could not be read, because changed blobs are missing from the checkout. The head file read of orcad-remote-pid-marker.ts matches the PR summary. Real-WSL validation is pending, which is not a coding requirement. Linked SSH report #34149 is context only.

Full details: Out of Scope Changes check

Explanation

All changed files relate to the #51014 objective. orcad-remote-pid-marker.ts holds the POSIX slot scan and the atomic PID writer. orcad-remote-launch.ts and orcad-remote-host-support.ts use them in the liveness probe and both launch paths. The deferral files (wsl-orcad-incumbent.ts, orcad-update-plan.ts, orcad-terminal-census.ts) implement the requested blocking-check report. unansweredBecause is client-side and does not change the wire format. The tests support these changes. The SSH path receives the same probe change because it shares the POSIX probe. The PR text states this, and the issue names SSH only as related context. No unrelated changes were identified. The incremental diff could not be read, so this verdict relies on the head file read and the PR summary.

Full details: Description check

Explanation

The description covers the problem, the fix, tests, performance, and a linked issue (Fixes #51014). It explains the mechanism clearly, including the liveness probe scan, the atomic PID writer, and the client-side unansweredBecause reason. It does not follow the repository template. Missing sections are ELI5, Visual Proof (a before/after or N/A statement for a behavior change), Risk level and the rollback plan, AI Disclosure, the Agent skill upstream boundary checkbox, and the Checklist. The Testing section does not mark which checkboxes apply, and it does not say whether the author tested on Linux or SSH hosts. The Performance section is present and complete.

Resolution

Add the missing template sections: (1) an ELI5 summary in plain language; (2) a What Changed section with the before and after behavior the user sees; (3) a Why section that compares this approach with alternatives; (4) a Visual Proof section that gives before and after evidence, or N/A with a reason; (5) a Risk section with a Level (Low, Medium, or High), the riskiest part of the change, and the rollback method; (6) an AI Disclosure section; (7) the Agent skill upstream boundary checkbox; (8) the Checklist items. In Testing, tick the applicable boxes and list the platforms actually tested (macOS was tested; Linux and SSH were not stated).

  • 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

@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: c017e47d-8ae2-442d-9ffb-9f187093f1a7
Commits

Reviewing files that changed from the base of the PR and between a75e45a and f99bef7.

Files selected for processing: 7

  • src/main/managed-server/activation/orcad-update-plan.ts
  • src/main/managed-server/install/orcad-remote-empty-markers.integration.test.ts
  • src/main/managed-server/install/orcad-remote-host-support.ts
  • src/main/managed-server/install/orcad-remote-launch.ts
  • src/main/wsl/orcad/wsl-orcad-incumbent.test.ts
  • src/main/wsl/orcad/wsl-orcad-incumbent.ts
  • src/shared/remote-runtime/orcad-lifecycle/orcad-terminal-census.ts

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

Comment on lines +82 to +83
'orcad_sa=$(tr "\\000" " " 2>/dev/null < "/proc/$orcad_sp/cmdline") || continue; ' +
'case "$orcad_sa" in *"$1"* | *"$2"*) return 0;; esac; done; return 1;'

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

Return 2 when /proc process arguments cannot be read.

When /proc/self/cmdline is readable, orcad_slot_busy scans only /proc. If tr cannot run, every $(tr ...) call fails. The || continue on line 82 then skips each process. Line 83 returns 1, and the ps scan on lines 85-89 never runs. orcad_unnamed maps 1 to DEAD, so an empty or invalid marker can report a running slot as DEAD.

Return 1 only when the scan completes and finds no matching process. When no process arguments can be read, the function should either run the ps scan or return 2. The caller maps 2 to UNKNOWN.

Comment on lines +72 to +73
if (wake.outcome === 'fenced') {
return 'Another launch or update holds the activation lock on the host.'

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

Report a failed recovery launch instead of activation-lock contention.

recoverAbandonedFence returns { outcome: 'fenced', launchFailure } when an interrupted activation recovery is unverifiable and its launch failed. wakeBlockedReason maps every fenced outcome to "Another launch or update holds the activation lock on the host." It never reads launchFailure. The user therefore sees a lock-contention reason, and the launch failure is not shown.

Lock contention is established only for the busy-owner (pending) and fence-busy fenced returns. For the unverifiable recovery, the code retries at the next fence check. It does not prove that another process holds the lock.

When wake.launchFailure is present, the blocked reason must report the launch failure. The lock-contention wording must apply only to fenced returns without a launch failure.

@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: a35f6883-29d3-4aac-9c52-45bc6eafa5c6
Commits

Reviewing files that changed from the base of the PR and between f99bef7 and dd9bf1d.

Files selected for processing: 5

  • src/main/managed-server/activation/orcad-update-plan.ts
  • src/main/managed-server/install/orcad-remote-empty-markers.integration.test.ts
  • src/main/managed-server/install/orcad-remote-launch.ts
  • src/main/managed-server/install/orcad-remote-pid-marker.ts
  • src/main/wsl/orcad/wsl-orcad-incumbent.test.ts

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

`rm -f ${quotePosixShell(ORCAD_STOP_REQUEST_FILENAME)} &&`,
...(detach === 'setsid' ? [`rm -f ${pidFile} &&`] : []),
// A failed write must not leave the previous run's PID to be judged instead (#51014).
`rm -f ${pidFile} &&`,

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.

Major · Stability & Availability · Quick win

Remove the old PID marker in the foreground, before the background launch.

The & at line 142 applies to the whole && chain before it. That chain includes rm -f ${pidFile} at line 132. Because && binds tighter than &, the removal runs asynchronously. The foreground write at line 143 can publish the new PID before this removal runs. The removal then deletes that new PID.

If cat at line 147 runs after the removal, the command reports failure even though the server starts. If cat runs first, the command reports success, but the server has no PID marker. A missing marker can leave the liveness probe unable to prove that the server exited. Recovery then stays blocked.

Keep the removal and the other preparation steps in the foreground. Background only the runtime launch. Then publish $!. Leave the setsid branch unchanged.


/** Shell that records `value` at `path` via temp file and rename, so an interrupted write leaves no empty marker. */
export function writeOrcadPidAtomicallyCommand(value: string, path: string): string {
return `echo ${value} > "${path}.tmp" && mv -f "${path}.tmp" "${path}"`

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.

Major · Data Integrity & Integration · Quick win

Give each PID writer its own temporary file.

Every launch for a slot writes its PID to the same <marker>.tmp path. In setsid mode, two overlapping launches can interleave like this:

  1. Launch A writes its PID to <marker>.tmp.
  2. Launch B overwrites <marker>.tmp with its PID.
  3. Launch A renames the file to the marker. The marker now holds B's PID.
  4. Launch B's rename fails. Its && chain stops before exec, so B never starts.

The marker then names an exited process while A's server runs. The liveness probe can then report the slot as DEAD and allow recovery to start over the running server.

Include the writer's PID in the temporary name. Each writer then renames only its own file:

Suggested fix

--- "a/src/main/managed-server/install/orcad-remote-pid-marker.ts"
+++ "b/src/main/managed-server/install/orcad-remote-pid-marker.ts"
@@ -2,7 +2,7 @@
 
 /** Shell that records `value` at `path` via temp file and rename, so an interrupted write leaves no empty marker. */
 export function writeOrcadPidAtomicallyCommand(value: string, path: string): string {
-  return `echo ${value} > "${path}.tmp" && mv -f "${path}.tmp" "${path}"`
+  return `echo ${value} > "${path}.$$.tmp" && mv -f "${path}.$$.tmp" "${path}"`
 }
 
 /** Defines `orcad_slot_busy L S` (0 another process's argv names an entry, 1 none, 2 unprovable) and `orcad_unnamed`. */
Committable suggestion

IMPORTANT
Review the replacement and indentation, then test before committing.

Suggested change
return `echo ${value} > "${path}.tmp" && mv -f "${path}.tmp" "${path}"`
return `echo ${value} > "${path}.$$.tmp" && mv -f "${path}.$$.tmp" "${path}"`

@nwparker
nwparker merged commit 5656c03 into main Nov 28, 2026
60 checks passed
@nwparker
nwparker deleted the nwparker/wsl-empty-orcad-markers branch November 28, 2026 06:08
Jinwoo-H added a commit that referenced this pull request Nov 29, 2026
The nohup launch backgrounds its whole && chain, so the PID removal added in
#51342 ran in the background and could delete the PID file the foreground had
just written. The host's server then read as unverifiable and connect failed.
Remove the old PID before the chain instead.
Jinwoo-H added a commit that referenced this pull request Nov 29, 2026
…2191)

* fix(orcad): an SSH host launch no longer deletes its own PID file

The nohup launch backgrounds its whole && chain, so the PID removal added in
#51342 ran in the background and could delete the PID file the foreground had
just written. The host's server then read as unverifiable and connect failed.
Remove the old PID before the chain instead.

* test(orcad): a failed PID write leaves no old PID, for nohup and setsid launches
Jinwoo-H added a commit that referenced this pull request Nov 29, 2026
…ane (#52103)

* test(layout-owner): run the SSH Docker orcad specs in the switch-on lane

Restores the ssh-orcad journeys (cut 11-21) into the layout-owner suite, passes the
server setting to the Docker host's orcad through sshd, and checks the orcad took it.

* ci(layout-owner): give the SSH lane's orcad template a placeholder phone page

* test(layout-owner): forward app logs from restart launches

* ci(layout-owner): start the SSH lane as soon as the window build is uploaded

* ci(layout-owner): build the orcad template while the window build runs

* test(layout-owner): print the host server's files when an SSH spec fails

* test(layout-owner): list the host slot and processes on SSH spec failure

* ci: retrigger the layout-owner lane

* fix(orcad): an SSH host launch no longer deletes its own PID file

The nohup launch backgrounds its whole && chain, so the PID removal added in
#51342 ran in the background and could delete the PID file the foreground had
just written. The host's server then read as unverifiable and connect failed.
Remove the old PID before the chain instead.

* test(layout-owner): mark the SSH lane's known switch-on failures (C5) and both-mode drift

* test(layout-owner): fit two SSH specs to today's close dialog copy and setup-script prompt

* ci: rerun the layout-owner lane

* test(layout-owner): scope the SSH lane's known failures to their symptom; prove every desktop and orcad path

- Known C5 failures no longer mark whole tests. Only one assertion is forgiven, on the new path,
  and only when the page shows the row's symptom (C5-L312: the typed line never reached the shell,
  which ends at an empty prompt; C5-L310: the editor shows the disk file). Any other error still fails.
  L312 loses a race, so a pass is fine; L310 fails when it passes, so a fix drops the mark.
- The job logs each desktop and host orcad's layout path and checks them, as the servers job does;
  browser-routing proves its orcad too.
- The server setting is validated before it reaches the host's shell, and every Docker host and
  volume is removed in its own finally.
- orcad-remote-empty-markers test synced to main's #52191.

* test(layout-owner): forgive C5-L312 only on a new terminal's first command, and C5-L310 only on the exact disk text

- Lost-keys forgiveness is opt-in at each first-command site, and only counts when the tab was just
  opened by openTerminalTab and nothing else has been typed into it; any expectPaneText consumes it.
  After a reconnect, relaunch, update or sleep, failures stay red.
- The symptom is now a pane holding only its single initial prompt: no echoed input and no output,
  so a command that ran and failed (even a wrapped one) never matches.
- hostCliUntilOk forgives only when no attempt ever got an answer.
- The draft check forgives only when the editor shows exactly the host file's text.
- root-owner's second, managed Open-in-Terminal pane gets the same first-command check.

* test(layout-owner): fix SSH lane CI: no casts, current browser-drop behavior, first-command opt-in for the fault journey
Jinwoo-H added a commit that referenced this pull request Nov 29, 2026
…anaged server (C5-L310) (#52238)

* test(layout-owner): run the SSH Docker orcad specs in the switch-on lane

Restores the ssh-orcad journeys (cut 11-21) into the layout-owner suite, passes the
server setting to the Docker host's orcad through sshd, and checks the orcad took it.

* ci(layout-owner): give the SSH lane's orcad template a placeholder phone page

* test(layout-owner): forward app logs from restart launches

* ci(layout-owner): start the SSH lane as soon as the window build is uploaded

* ci(layout-owner): build the orcad template while the window build runs

* test(layout-owner): print the host server's files when an SSH spec fails

* test(layout-owner): list the host slot and processes on SSH spec failure

* ci: retrigger the layout-owner lane

* fix(orcad): an SSH host launch no longer deletes its own PID file

The nohup launch backgrounds its whole && chain, so the PID removal added in
#51342 ran in the background and could delete the PID file the foreground had
just written. The host's server then read as unverifiable and connect failed.
Remove the old PID before the chain instead.

* test(layout-owner): mark the SSH lane's known switch-on failures (C5) and both-mode drift

* test(layout-owner): fit two SSH specs to today's close dialog copy and setup-script prompt

* ci: rerun the layout-owner lane

* fix(layout-owner): an unsaved editor draft survives conversion to a managed server (C5-L310)

A server's frames name its files by the server-owned id. A window file restored from before the
server (no owner yet) was replaced by the frame's file under that id, leaving its draft under the
old id, so the editor showed the disk text. Before a server workspace gates to frames, the window
now re-owns such files through the existing restored-owner migration (drafts, buffers and the save
gate move with them), holding the gate while the server's worktree route is still unknown.

* fix(layout-owner): route restored editor re-owns by the gated server, not focus

* fix(layout-owner): restored-editor re-owns keep shared records saveable, coalesce, and cover SSH-era files

- The re-own clears the pending-owner pause on every view of the shared record, not only the moved one,
  so a sibling workspace's view stays saveable and a shared draft rejoins instead of splitting.
- Concurrent re-owns of one file (editor load and server gate) share one migration instead of the second
  reading as stale and holding the workspace on the mirror.
- The gate re-asks when folder workspaces change, and when a held workspace's open files change.
- Files opened over the converted SSH host's relay route are re-owned too, as the switch-off mirror keeps them.
Jinwoo-H added a commit that referenced this pull request Nov 29, 2026
…ch its shell (C5-L312) (#52260)

* test(layout-owner): run the SSH Docker orcad specs in the switch-on lane

Restores the ssh-orcad journeys (cut 11-21) into the layout-owner suite, passes the
server setting to the Docker host's orcad through sshd, and checks the orcad took it.

* ci(layout-owner): give the SSH lane's orcad template a placeholder phone page

* test(layout-owner): forward app logs from restart launches

* ci(layout-owner): start the SSH lane as soon as the window build is uploaded

* ci(layout-owner): build the orcad template while the window build runs

* test(layout-owner): print the host server's files when an SSH spec fails

* test(layout-owner): list the host slot and processes on SSH spec failure

* ci: retrigger the layout-owner lane

* fix(orcad): an SSH host launch no longer deletes its own PID file

The nohup launch backgrounds its whole && chain, so the PID removal added in
#51342 ran in the background and could delete the PID file the foreground had
just written. The host's server then read as unverifiable and connect failed.
Remove the old PID before the chain instead.

* test(layout-owner): mark the SSH lane's known switch-on failures (C5) and both-mode drift

* test(layout-owner): fit two SSH specs to today's close dialog copy and setup-script prompt

* ci: rerun the layout-owner lane

* fix(layout-owner): keys typed into a new terminal before it binds reach its shell (C5-L312)

A new server tab is drawn from the server's layout frame before session.tabs gives the
desktop its handle. The pane mounted unbound, created its own terminal and dropped the
typed keys; it now waits as starting and attaches the server's terminal with the keys held.
A local pane main starts now holds pre-bind keys too, since main sends any startup work
before the pane attaches. A terminal created without a target group in a frame-drawn
workspace is activated, as the mirror's focus intent did.

Removes the C5-L312 expected-fail marks.

* test(layout-owner): mark the pre-bind typing race on the page without casts

* test(layout-owner): print a managed pane's connect verdicts and bindings when its text never shows

* test(layout-owner): record a new managed pane's state on its first mounted frame

* fix(layout-owner): a pane whose start ended before its first connect attaches the terminal main bound

On a slow host the server pane's binding lands between the pane's mount and its deferred connect.
The connect chose from the mount-time bindings and started a fresh terminal, dropping the keys typed
into the pane; it now adopts the binding main published first, as the start wait already does.

* test(layout-owner): wait for the managed Open in Terminal tab to come to the front before typing

* fix(layout-owner): keep a server pane's own sleeping status while its handle is unknown; review fixes

* fix(layout-owner): a server pane waits for its handle at most 5 s, and a slept terminal's pane is marked sleeping

A bound server pane without a handle waits as starting so typed keys are held, but session.tabs lists a
slept or exited terminal without a handle too; the wait is now bounded, after which the pane is drawn
unbound as before. The server also marks a pane sleeping when the workspace sleep commits its terminal.
CI's switch-on lane now runs both first-keys specs.

* test(layout-owner): a slept server terminal's pane shows as sleeping inside the handle wait

* fix(terminal): showing or typing into a slept server pane wakes it, and keys typed during the wake reach the woken terminal

* fix(terminal): keys typed while main wakes a slept local pane wait for its reattach instead of being dropped

* test(layout-owner): first-keys specs no longer depend on CI timing; the slept-pane sleep retries a liveness read still under way

* fix(terminal): held keys follow a pane only into the terminal its slept one wakes into, never a replacement

* fix(terminal): a server pane's wake ends when its terminal binds, retries once per gesture, and an attach settles its pre-bind typing so later keys are never swallowed

* test(terminal): wake-input test reads the activation intent through a type guard, not a cast
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.

[Bug]: WSL host update gets stuck when .orcad-pid and .orcad-readiness are empty

1 participant