Skip to content

fix(sidebar): recover the runtime host disconnected glyph - #16518

Open
ASDFGHoney wants to merge 8 commits into
stablyai:mainfrom
ASDFGHoney:asdfghoney/fix-runtime-host-disconnected-glyph
Open

ASDFGHoney wants to merge 8 commits into
stablyai:mainfrom
ASDFGHoney:asdfghoney/fix-runtime-host-disconnected-glyph

Conversation

@ASDFGHoney

@ASDFGHoney ASDFGHoney commented Aug 26, 2026 •

Copy link
Copy Markdown

ELI5

Orca remembered "I couldn't reach that server" from the moment it started up, and then never checked again. So if your remote Mac happened to be asleep when Orca launched, its workspaces stayed greyed out with a red "disconnected" icon for the rest of the day — even while you were happily running agents and terminals on that exact server.

This makes Orca ask again: whenever it successfully talks to a server it had written off, and on a slow retry timer otherwise. It never assumes the server is back — it just re-asks the question and believes the answer.

What Changed

The recovery loop. New runtime-status-recovery-probe.ts re-runs the existing
refreshRuntimeEnvironmentStatus (a real status.get) for environments recorded unreachable,
on two triggers:

  • Answered traffic. callRuntimeRpc is the renderer's single remote-RPC chokepoint. A
    successful response for an environment whose entry is null schedules one probe; every other
    call is a no-op, and a burst collapses to one in-flight probe per environment.
  • Per-host backoff. Entries still null are re-probed at 5s doubling to a 60s cap, each host
    on its own clock. online and system-resume collapse the backoff, alongside the shared-control
    and pane-recovery backoffs already advanced there.

The port carries a status-map subscription because the probe starts with the app shell, before
boot hydration has recorded anything — without it an empty map at start leaves it idle for good.

The sidebar verdict. use-worktree-card-foundation.ts and NoticeHostGlyph.tsx now use the
shared runtimeHostConnectionState derivation the status bar and Settings › Available Hosts
already use, instead of raw truthiness. runtimeHostConnectionStateForEntry(entry) +
isDisconnectedRuntimeHostState replace the { hasStatusEntry, status } assembly at all four
call sites, and the recovery loop's candidate list reads the same two helpers — a host the
sidebar paints red is by construction a host the probe retries.

Why

runtimeStatusByEnvironmentId was written only by explicit probes: boot hydration, the status-bar
host dropdown, the settings pane, and the connect/disconnect actions. Nothing fed a transport that
recovered on its own back into it, and settings.ts:191 deliberately treats a recorded null as
covered ("A recorded null still means the host was checked"), so the coverage re-probe skipped it too.

It was also self-reinforcing: getRuntimeClientEventEnvironmentIds subscribes client events only
for environments whose status is truthy, so a non-active environment stuck on null never got the
subscription that could have reported its own reconnect. onReplayedAfterReconnect does not
cover the boot case either — replays are tagged only once everReady is true.

Why re-probe rather than infer. These surfaces read the whole RuntimeStatus — capabilities,
remoteControl, workspace-window availability — so "we exchanged a message, therefore connected"
would be its own lie. Both triggers only ask the existing probe to run again and let its answer
stand. This is the live / unverifiable / exited rule from
docs/reference/ssh-execution-boundary.md, applied in both directions: the old behaviour asserted
exited on unverifiable evidence and never revisited it; the fix must not overcorrect into
asserting live.

A manually disconnected environment is unaffected — runtimeEnvironments:getStatus short-circuits
to ok: false locally for it, so the re-probe re-confirms null without touching the network.

On the sidebar side, runtimeHostConnectionState already separated "no entry ⇒ checking" from
"entry with status: null ⇒ disconnected". Reading truthiness collapsed those, so every remote
card was painted destructive between launch and the first probe. (reconnecting hosts were not
affected — truthiness returns false whenever status is truthy. #16516 said otherwise and has
been corrected.)

Adopting the shared derivation does change one case deliberately: a host with
remoteControl.state === 'closed' and a lastError has a truthy status, so the old sidebar drew
it normally while the status bar and Settings already called it disconnected. The sidebar was the
outlier, and a control channel that closed with an error is the host's own report rather than
silence, so ssh-execution-boundary.md does not argue for softening it. It is not a
red-and-forgotten state either: the same derivation now feeds the recovery loop's candidate list,
so that host is re-probed like any other.

No wire change: no new RPC params, stream frames, or published content, so mixed client/host
versions are unaffected. Folder workspaces and git worktrees reach the glyph through the same
repo executionHostId, so both are covered by the same path.

Linked Issue

Fixes #16516

Visual Proof

Captured by two E2E specs in tests/e2e/sidebar-runtime-host-disconnected-glyph.spec.ts.
Artifacts land in test-results/…-electron-headless/.

Spec 1 — the rendered verdict. Seeds each recorded state directly and screenshots the same
sidebar card, so it shows what the card draws for a given store entry. It does not exercise the
recovery loop, and is not evidence about it.

Recorded state Artifact Before this PR After
No entry (host not probed yet) runtime-host-glyph-before-probe.png red ServerOff, card at opacity-60 plain Server glyph, full opacity
status: null (probe said unreachable) runtime-host-glyph-disconnected.png red ServerOff, dimmed unchanged — red ServerOff, dimmed
Truthy status (probe said reachable) runtime-host-glyph-recovered.png plain Server glyph unchanged

The middle row is the deliberate no-change case: a host a probe actually reported unreachable must
still read disconnected.

Spec 2 — the loop, not a store write. Seeds a host whose control channel closed with an error,
stubs only the probe's network leg, then fires online and touches nothing else. The scheduler,
its candidate list, the real setRuntimeEnvironmentStatus publication and the card's selectors all
run; the app decides what to probe and when.

Step Artifact Result
remoteControl: closed + lastError recorded runtime-host-glyph-control-channel-closed.png red ServerOff, dimmed (before this PR: plain Server)
online fires, loop probes, host answers runtime-host-glyph-loop-recovered.png plain Server glyph, full opacity

This is the spec that demonstrates the unreachable state is no longer terminal. It fails against
the pre-fix candidate list (entry.status === null), which never enumerates this host: the card
stays red and svg.lucide-server is never found.

Testing

Tested on macOS 26.5.2, against a paired remote macOS Orca server (ws://…:6768) and locally.
Not exercised on Linux or Windows; the change is renderer-only with no platform-dependent paths.

  • both E2E specs pass (electron-headless, --workers=1): 2 passed in 32.7s
  • unit suites for the touched areas: 1035 files, 8490 tests passed
    (src/renderer/src/{runtime,components/sidebar,store/slices,hooks,components/settings,components/status-bar}/)
  • pnpm tc clean
  • oxlint and oxfmt clean on changed files
  • every new test was confirmed red against the pre-fix source hunk before being kept

Pre-existing failures confirmed unrelated by re-running them on origin/main @ cac5388545,
where they fail identically: worktree-jump-palette-filter.spec.ts (2) and
sidebar-agent-row-identity.spec.ts (1). pnpm run typecheck:e2e is also already red on main
(237 errors across 86 files); the new spec contributes none.

Manual reproduction of the original defect: put the paired host to sleep, launch Orca, wake the
host, then use the remote workspace. Before this PR the card stayed red until the status-bar host
dropdown was opened; after, the first answered request clears it.

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

AI Disclosure

Claude Opus 5 via Claude Code, under review.

Review

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • Security — no new network surface; the probe reuses the existing authenticated
    status.get path and adds no data to it.
  • Cross-platform — renderer-only, no platform branches, no path handling.
  • Remote/SSH — the central concern here; see the ssh-execution-boundary reasoning above.
    SSH host chips are untouched.
  • Mobile — untouched; the changed modules are Electron-renderer only.
  • Backwards compatibility — no wire, schema, or persisted-state change.
  • Performance — the reachability hook is one Map.get on the hot RPC path and returns
    immediately unless the entry is null. The backoff timer only exists while some host is
    recorded unreachable, and self-cancels when none is.

Checklist

  • This PR is small and focused
  • I explained what changed and why (including ELI5)
  • 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 Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Review 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: Pro Plus

Run ID: 41d2bfd0-09a0-4969-938e-e1aaccc3e592

📥 Commits

Reviewing files that changed from the base of the PR and between 4f54271 and dbc357d.

📒 Files selected for processing (2)
  • src/renderer/src/runtime/runtime-status-recovery-probe.test.ts
  • src/renderer/src/runtime/runtime-status-recovery-probe.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.


📝 Walkthrough

Walkthrough

Runtime host status derivation now distinguishes disconnected hosts from unprobed and reconnecting hosts. UI surfaces use shared entry-based state helpers. Runtime status refreshes return reachable, unreachable, or superseded outcomes. Recovery probes target disconnected environments with backoff and retry scheduling. Successful remote runtime RPC calls report reachability. Tests cover state rendering, refresh outcomes, recovery behavior, RPC feedback, and end-to-end recovery.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 27.78% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 36 functions across 19 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the primary change: recovering the disconnected runtime host glyph in the sidebar.
Description check ✅ Passed The description is complete and aligned with the repository template. It explains the problem, implementation, rationale, linked issue, visual proof, testing, AI use, review considerations, and checkl…
Linked Issues check ✅ Passed The changes satisfy issue #16516. They re-probe disconnected environments, preserve unreachable results, distinguish unprobed and disconnected sidebar states, recover hosts excluded from client-event …
Out of Scope Changes check ✅ Passed The production changes, shared helpers, recovery logic, and tests are directly related to runtime host recovery and sidebar disconnected-state rendering. No unrelated code or platform-specific changes…
Full details: Description check

Explanation

The description is complete and aligned with the repository template. It explains the problem, implementation, rationale, linked issue, visual proof, testing, AI use, review considerations, and checklist status.

Full details: Linked Issues check

Explanation

The changes satisfy issue #16516. They re-probe disconnected environments, preserve unreachable results, distinguish unprobed and disconnected sidebar states, recover hosts excluded from client-event subscriptions, and add relevant unit and E2E coverage.

Full details: Out of Scope Changes check

Explanation

The production changes, shared helpers, recovery logic, and tests are directly related to runtime host recovery and sidebar disconnected-state rendering. No unrelated code or platform-specific changes are evident.


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: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 69940146-ca92-4e60-b1b8-221a222c57ca

📥 Commits

Reviewing files that changed from the base of the PR and between 76f7e78 and 817bab7cf37d5e910af29bad31c4ed2d6b058565.

📒 Files selected for processing (12)
  • src/renderer/src/components/sidebar/NoticeHostGlyph.test.tsx
  • src/renderer/src/components/sidebar/NoticeHostGlyph.tsx
  • src/renderer/src/components/sidebar/WorktreeCard.ssh-reconnect-prompt.test.tsx
  • src/renderer/src/components/sidebar/use-worktree-card-foundation.ts
  • src/renderer/src/components/sidebar/worktree-card-runtime-host-state.test.ts
  • src/renderer/src/runtime/runtime-rpc-client.ts
  • src/renderer/src/runtime/runtime-status-recovery-probe.test.ts
  • src/renderer/src/runtime/runtime-status-recovery-probe.ts
  • src/renderer/src/runtime/runtime-status-recovery-rpc-feedback.test.ts
  • src/renderer/src/runtime/use-remote-runtime-recovery-triggers.test.ts
  • src/renderer/src/runtime/use-remote-runtime-recovery-triggers.ts
  • tests/e2e/sidebar-runtime-host-disconnected-glyph.spec.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.

ASDFGHoney and others added 2 commits August 26, 2026 10:40
`runtimeStatusByEnvironmentId` was written only by explicit probes — boot
hydration, the status-bar host dropdown, the settings pane, and the
connect/disconnect actions. Nothing fed a transport that recovered on its own
back into it, so a boot probe that failed (host asleep, network not up yet)
pinned a live remote server to a red ServerOff glyph and an opacity-60 card for
the rest of the session, while its mirroring, agents and terminals kept working
over the same connection.

The state was self-reinforcing: `getRuntimeClientEventEnvironmentIds` subscribes
client events only for environments whose status is truthy, so a non-active
environment stuck on `null` never got the subscription that could have reported
its own reconnect.

Add a recovery probe with two triggers, both of which only ask
`refreshRuntimeEnvironmentStatus` to run the real `status.get` again:

- an answered remote request is evidence the host is reachable, so a stale
  entry gets re-probed on the next call through `callRuntimeRpc`
- entries still recorded unreachable are re-probed on a per-host backoff
  (5s doubling to 60s), collapsed on `online`/system-resume alongside the
  shared-control and pane recovery backoffs

Neither trigger decides reachability itself: consumers read the whole
`RuntimeStatus`, and per docs/reference/ssh-execution-boundary.md loss of
contact is never evidence of death in either direction. A manually
disconnected host still answers `ok: false` locally, so it stays disconnected.

The sidebar also judged the glyph on raw truthiness instead of the shared
`runtimeHostConnectionState`, painting "disconnected" over hosts that had
simply not been probed yet. Both sidebar surfaces now use the derivation, so
only its 'disconnected' verdict earns the destructive glyph and the dim.

Fixes stablyai#16516

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The unprobed-vs-unreachable split happens in the selector that feeds the
worktree card's render, so a store-slice test cannot see the glyph and the
dim it produces. Seed a runtime-host workspace, drive the recorded probe
result, and assert on the rendered card across all three states.
@ASDFGHoney
ASDFGHoney force-pushed the asdfghoney/fix-runtime-host-disconnected-glyph branch from 817bab7 to 586ed72 Compare August 26, 2026 01:40
The sweep deferred re-arming to the probe's own `finally`, so a refresh that
never settled — a wedged IPC round trip — ended the recovery loop for every
other host, not just its own. A host whose backoff came due afterwards was
never re-probed.

Re-arm on every sweep instead. A probe in flight contributes a pending guard
rather than its stored deadline, which is already in the past: scheduling
against that deadline would spin, and skipping the schedule is what stranded
the other hosts.

Reported by CodeRabbit on stablyai#16518.
@ASDFGHoney

ASDFGHoney commented Aug 26, 2026 •

Copy link
Copy Markdown
Author

Code review — two axes: Standards / Spec

Fixed point: origin/main @ 91a500712c (this PR's merge-base) · 2 commits (6ec2648b7f, 472b387fe5) · 12 files, +982/−13
Spec source: #16516

The two axes ran independently. They are reported side by side, unmerged and unranked against each other, so neither masks the other.


Standards

A. Documented-standard violations

1. AGENTS.md › Reuse Before Reimplementing — the same block, copy-pasted
src/renderer/src/components/sidebar/NoticeHostGlyph.tsx:36-43 and src/renderer/src/components/sidebar/use-worktree-card-foundation.ts:185-192 are effectively identical, comment included. On top of that, the { hasStatusEntry: Boolean(entry), status: entry?.status } assembly now appears in four places counting the existing RepositoryHostSetupsSection.tsx:230 / SshStatusSegment.tsx:99. src/renderer/src/runtime/runtime-host-connection-state.ts already houses a predicate helper (isConnectedRuntimeHostState), so the extension point exists — folding this into runtimeHostConnectionStateForEntry(entry) + isDisconnectedRuntimeHostState would be better. (Duplicated Code + Data Clump)

2. A third encoding of the same predicate, already out of step with the derivation
src/renderer/src/runtime/use-remote-runtime-recovery-triggers.ts:8-9, 19-22 re-implements "disconnected" directly as entry.status === null. But runtimeHostConnectionState also judges a host with remoteControl.state === 'closed' && lastError as disconnected. So the glyph paints red while the recovery probe never picks that host up. This is the standards breach already showing as behavioural drift, which ranks it above #1.

3. Duplication inside the port
In the same file, isRuntimeEnvironmentUnverified and listUnverifiedRuntimeEnvironmentIds each filter on entry.status === null. The former is derivable from the latter, so the port surface could shrink to three.

B. Judgement calls (smell baseline)

4. Mysterious Name / vocabulary collision — docs/reference/ssh-execution-boundary.md fixes the vocabulary at live / unverifiable / exited and forbids synonyms. The unverified in isRuntimeEnvironmentUnverified, listUnverifiedRuntimeEnvironmentIds, and RuntimeStatusRecoveryPort is a near-synonym of that reserved term while actually meaning the derivation's disconnected verdict. One condition, three names.

5. Possible Speculative Generality / Middle Man — RuntimeStatusRecoveryPort is a four-method port with exactly one production implementation; the rest are test doubles.

6. Hot path — src/renderer/src/runtime/runtime-rpc-client.ts:95-99 runs a getState() plus a Map lookup on every successful environment RPC, and the new useAppStore.subscribe fires on every store publication. Individually cheap, but docs/reference/renderer-agent-status-performance.md budgets listener fan-out explicitly, so it is worth noting.

7. Divergence from a neighbouring convention — remote-runtime-pty-recovery-state.ts attaches timer.unref?.(); the setTimeout in src/renderer/src/runtime/runtime-status-recovery-probe.ts does not.

8. Comments — the three-line // Why: comment from #1 is duplicated across both files. AGENTS.md asks for "1 LINE if possible", and extracting the helper collapses it to one site naturally.

Checked, not violations

The e2e spec honours tests/e2e/AGENTS.md › "E2E Assertions Must Target the DOM, Not the Store" (the store is used for seeding only). No max-lines disable, no new .d.ts, no wire-format change (so remote-wire-compatibility.md does not apply), no new STYLEGUIDE tokens, no platform branches, and as never in tests is an idiom used repo-wide.


Spec (against #16516)

The two core requirements are genuinely met. After a boot probe records status: null, startRuntimeStatusRecoveryProbe re-runs the real status.get on a 5s→60s backoff (runtime-status-recovery-probe.ts:59-115), and the sidebar now uses runtimeHostConnectionState. The "we exchanged a message, therefore connected" would be its own lie constraint holds too — both triggers only ask the probe to run and let its answer stand.

(a) Missing or partial

  • Issue: "getRuntimeClientEventEnvironmentIds … subscribes client events only for environments whose status is truthy … So a non-active environment stuck on null gets no client-event subscription" — runtime-environment-subscription-selection.ts:24 is unchanged. It does resolve once a re-probe succeeds and the status turns truthy, but the self-reinforcing loop itself remains while probes keep failing.
  • Issue: "settings.ts:193 deliberately treats a recorded null as covered" — untouched. The new probe routes around it, so there is no functional impact.

(b) Not asked for

  • Adopting the shared derivation creates cases where red spreads: a host with remoteControl.state === 'closed' && lastError has a truthy status, so the old code showed a normal glyph; it now gets ServerOff + opacity-60. The issue only asks for the opposite direction ("every remote card is painted with the destructive glyph between app start and the first probe").
  • Wiring retryRuntimeStatusRecoveryProbesNow into online/system-resume is outside the issue, though it is consistent with the existing backoff group.
  • Note: the issue's claim that "reconnecting hosts are painted as down as well" is not accurate (the old code returns false whenever status is truthy). The new code does not change that behaviour either.

(c) Implemented but looks wrong

  1. The traffic trigger defeats the backoff entirely — noteRuntimeEnvironmentReachable (runtime-status-recovery-probe.ts:139-147) calls backoffByEnvironment.delete and then probe() immediately. For a host whose RPCs succeed while status.get keeps failing (e.g. the revision mismatch at runtime-status-refresh.ts:17-19, which returns false without publishing), the only guard is the single in-flight limit — there is no minimum interval, so probes repeat back-to-back indefinitely. This contradicts the "per-host backoff" claim in the description.
  2. A duplicate status.get on the same call path — ensureRuntimeEnvironmentCompatible (runtime-rpc-client.ts:103-136) already receives the full RuntimeStatus and never publishes it to the store. Feeding that result into setRuntimeEnvironmentStatus would save a round trip and recover immediately.
  3. A revision mismatch is counted via recordProbeFailure — that is not a reachability failure, yet it grows the backoff.
  4. refreshRuntimeEnvironmentStatus is called without optional chaining (use-remote-runtime-recovery-triggers.ts:23) — it throws in a minimal store assembly that omits this slice.
  5. The E2E does not exercise the recovery loop — tests/e2e/sidebar-runtime-host-disconnected-glyph.spec.ts:93-128 writes state directly via store.setState. The "Visual Proof" table's third row ("unreachable state was terminal for the session") is a claim this spec cannot demonstrate. The recovery loop is covered by unit tests only.

Summary — Standards: 8 findings (3 hard / 5 judgement calls); worst is #2 — use-remote-runtime-recovery-triggers.ts re-implements runtimeHostConnectionState, and the "red glyph the recovery probe never picks up" drift already exists. Spec: 9 findings (a 2 / b 2 + 1 note / c 5); worst is (c)1 — the traffic trigger clears the backoff, so a host whose status.get keeps failing gets back-to-back probes forever.

Both worst findings sit in the same pair of files (use-remote-runtime-recovery-triggers.ts + runtime-status-recovery-probe.ts), so they look addressable together.

Two-axis review by Claude Opus 5 (Claude Code) — Standards and Spec run as independent sub-agents.

@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: Pro Plus

Run ID: e6c3735f-e457-4f9e-a8d8-5ddc6e706856

📥 Commits

Reviewing files that changed from the base of the PR and between 817bab7cf37d5e910af29bad31c4ed2d6b058565 and fffa301.

📒 Files selected for processing (2)
  • src/renderer/src/runtime/runtime-status-recovery-probe.test.ts
  • src/renderer/src/runtime/runtime-status-recovery-probe.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 4 remain after this review.

`noteRuntimeEnvironmentReachable` dropped the backoff entry before every
probe, so a host that answers requests while its `status.get` keeps failing
was re-probed once per RPC — 21 probes for 20 requests in the new test.

Gating traffic on the failure deadline instead would regress what this PR
exists to fix: `backoffFor` seeds `nextAttemptAt` 5s out on first sighting,
so the very first traffic probe after a failed boot probe never runs, and at
the 60s cap a host the user is actively working with keeps the red glyph for
another minute (stablyai#16516). That variant fails 8 of these tests, 3 of them
pre-existing.

Traffic gets a floor of its own instead — the sweep's base interval — so it
can never probe faster than the recovery loop already does while still
recovering within 5s however long the outage ran. The backoff entry now
survives a traffic probe, so answered requests no longer reset the sweep's
widening retry budget.

Reported by CodeRabbit on stablyai#16518.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

@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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/renderer/src/runtime/runtime-status-recovery-probe.ts (1)

180-198: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Isolate probe completion from a stopped session.

probe() mutates the global probingEnvironments, backoffByEnvironment, and timer state after refreshRuntimeEnvironmentStatus() settles. A stopped session can clear these structures before an old probe settles, so its completion can clear a new session’s in-flight marker and re-arm a duplicate probe. Guard all completion handlers with a per-session token.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7ea829c9-a6b8-4964-8636-4c0b5867c358

📥 Commits

Reviewing files that changed from the base of the PR and between fffa301 and 3e349bc.

📒 Files selected for processing (3)
  • src/renderer/src/runtime/runtime-status-recovery-probe.test.ts
  • src/renderer/src/runtime/runtime-status-recovery-probe.ts
  • src/renderer/src/runtime/runtime-status-recovery-rpc-feedback.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review.

ASDFGHoney and others added 2 commits August 26, 2026 11:30
`{ hasStatusEntry: Boolean(entry), status: entry?.status }` was re-assembled at four
call sites, two of them with the same three-line comment. Re-assembling the argument
per surface is how the sidebar drifted into its own predicate in the first place, so
`runtimeHostConnectionStateForEntry` takes the store entry directly and
`isDisconnectedRuntimeHostState` names the verdict the glyph and the recovery loop
must share.

Deliberate, and now pinned by a test: a host with `remoteControl.state === 'closed'`
and a `lastError` keeps reading disconnected in the sidebar. The status bar and
Settings > Available Hosts already called it that; the sidebar was the outlier, and
that channel closing with an error is the host's own report, not silence.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
`use-remote-runtime-recovery-triggers.ts` encoded "disconnected" as
`entry.status === null`, but `runtimeHostConnectionState` also returns 'disconnected'
for `remoteControl.state === 'closed' && lastError`, where `status` is truthy. Such a
host got the red glyph and the dimmed card while the recovery probe never considered
it a candidate, so its red state was terminal for the session — the exact defect
stablyai#16516 is about, reintroduced one derivation over. Both the port predicate and its
candidate list now come from the shared derivation.

Once the candidate set includes hosts with a truthy status, a successful `status.get`
stops being proof of recovery: such a host would clear its backoff on every probe and
be re-probed at the base interval forever. The probe therefore re-reads the verdict
after the refresh instead of trusting the RPC's own answer.

A revision mismatch is also not a reachability failure. `refreshRuntimeEnvironmentStatus`
returned `false` without publishing when a same-id re-pair retired the answer in
flight, and the probe charged that against the new pairing's retry budget.
`refreshRuntimeEnvironmentStatusOutcome` reports 'reachable' / 'unreachable' /
'superseded'; the boolean action is now its projection, so every existing caller —
`runtime-environment-disconnect-toast.ts` included — is untouched.

Also: optional-chain the slice lookup, the way `retainRuntimeDetectedAgents?.()`
already does for minimal store assemblies, and `unref()` the sweep timer to match
`remote-runtime-pty-recovery-state.ts`.

The E2E gains a second spec that drives the loop rather than writing the status map:
it seeds a closed-control-channel host, stubs only the probe's network leg, and fires
`online`. The app decides what to probe and when. It fails against the old predicate.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ASDFGHoney

Copy link
Copy Markdown
Author

Thanks — this was a good review. Worked through both axes finding by finding.

Re-verified against 4f54271129, not the reviewed base. The review ran on 6ec2648b7f / 472b387fe5; two commits had already landed on top. Everything below was re-checked against current HEAD before acting.

Two new commits: bb87b6ea71 (the shared derivation) and 4f54271129 (the recovery loop).


Standards

#2 — a third encoding of the predicate · fixed (4f54271129)

Confirmed live, and worse than "already out of step": it was the same defect this PR exists to fix, reintroduced one derivation over. A host with remoteControl.state === 'closed' && lastError has a truthy status, so runtimeHostConnectionState returns disconnected → red glyph + opacity-60, while entry.status === null excluded it from listUnverifiedRuntimeEnvironmentIds → the probe never enumerated it → the red state was terminal for the session.

Both the port predicate and the candidate list now come from runtimeHostConnectionStateForEntry + isDisconnectedRuntimeHostState.

One consequence that had to be handled with it: once the candidate set can contain hosts with a truthy status, a successful status.get stops being proof of recovery. Trusting the RPC's boolean would clear the backoff on every probe while the host stayed disconnected — a 5s poll loop forever. probe() now re-reads the verdict after the refresh instead:

if (active.isRuntimeEnvironmentDisconnected(environmentId)) {
  recordUnrecoveredProbe(environmentId)   // widen — the answer arrived, recovery did not
} else {
  backoffByEnvironment.delete(environmentId)
}

Regression tests, both confirmed red against the pre-fix hunk:

  • use-remote-runtime-recovery-triggers.test.ts › re-probes a host whose control channel closed with an error
  • runtime-status-recovery-probe.test.ts › keeps widening the backoff for a host that answers but still reads disconnected
  • plus a new E2E that fails on the old predicate (see (c)5)

#1 + #8 — duplication and the duplicated comment · fixed (bb87b6ea71)

Took the suggested shape. runtime-host-connection-state.ts now exports runtimeHostConnectionStateForEntry(entry) and isDisconnectedRuntimeHostState(state) next to the existing isConnectedRuntimeHostState. All four call sites updated, not just the two new ones — NoticeHostGlyph.tsx, use-worktree-card-foundation.ts, RepositoryHostSetupsSection.tsx:230, SshStatusSegment.tsx:99. The last one collapsed a two-pass map(...).map(...) into one, and hasStatusEntry is gone from the row object entirely. The three-line comment collapsed to one site and one line, as predicted.

#7 — unref() · fixed (4f54271129)

nextSweep.unref?.(), matching remote-runtime-pty-recovery-state.ts:101,200.

#4 — unverified collides with the reserved vocabulary · fixed (4f54271129)

Right on both counts: it was a near-synonym of unverifiable from ssh-execution-boundary.md, and it actually meant the derivation's disconnected. Renamed to match the derivation — isRuntimeEnvironmentDisconnected, listDisconnectedRuntimeEnvironmentIds, stillDisconnected — so the port, the glyph and the docs' vocabulary no longer overlap by accident.

#3 — shrink the port to three · declined, with evidence

isRuntimeEnvironmentUnverified is derivable from the list, but the derivation is not free on the path it runs on, and it is the same path #6 is about. noteRuntimeEnvironmentReachable runs on every successful environment RPC:

shape per-RPC cost
predicate (kept) getState() + Map.get + ≤5 comparisons — O(1), zero allocations
derived from the list [...map].filter().map() — O(total environments), 3 allocations

Shrinking the surface by one method would put an array build and two intermediate arrays on the hot path to save a four-line method. The predicate is also now load-bearing a second time — probe() re-reads it to decide whether recovery actually happened (see #2) — so it is no longer a pure projection of the list.

#5 — four-method port with one production impl · kept, cycle proven

Not speculative generality: the port is what keeps the cycle open. Concretely, on HEAD —

@/store  →  store/slices/runtime-status.ts:9  (imports clearRuntimeCompatibilityCache
         →  @/runtime/runtime-rpc-client)
runtime-rpc-client.ts:10  →  ./runtime-status-recovery-probe

so a @/store import inside runtime-status-recovery-probe.ts closes store → runtime-status → runtime-rpc-client → recovery-probe → store. The test doubles are a side benefit, not the reason. Left at four methods (see #3 for why the fourth stays).

#6 — hot path · checked, within budget; reasoned, not benchmarked

Two additions, measured against docs/reference/renderer-agent-status-performance.md's own model (burst work ≈ status events × store listeners × selector work):

  1. Per-RPC. getState() is a closure property read; Map.get is O(1); runtimeHostConnectionStateForEntry is Boolean(entry) plus at most three field reads plus isRuntimeWorkspaceWindowClosed (two comparisons, runtime-workspace-window-availability.ts:9-14). No allocation, no iteration — same order as the entry.status === null it replaced, a handful more comparisons. Not on the agent-status burst path at all.
  2. The subscription. One additional Zustand listener whose whole body is a reference comparison on state.runtimeStatusByEnvironmentId, with an early return. It does no selector work, so it contributes to the listeners term only. Against the doc's pinned censuses — 1,218 listeners for the 100-worktree fixture without agents, 1,618 with 100 agent rows, 8,518 / 9,279 on the pre-design baseline — that is one listener out of ≥1,218, i.e. ≤0.08%, and it is a single app-shell subscription, not per-card, so none of the per-surface budgets in the doc's table move.

What I did not do: run pnpm bench:idle-cpu. That harness wants a built Electron runtime and a quiet machine to produce numbers comparable to the doc's baseline, and a noisy run would be worse than no number. The reasoning above is from the doc's model and its own pinned figures; if you want the harness run before merge, say so and I will.


Spec

(c)1 — the traffic trigger defeats the backoff · already fixed in 3e349bc3ca

Confirmed for myself rather than taking it on faith. That commit predates the review's fixed point by one, so the review could not see it. noteRuntimeEnvironmentReachable no longer calls backoffByEnvironment.delete; RecoveryBackoff gained trafficProbedAt, and traffic gets its own floor of RECOVERY_PROBE_BASE_DELAY_MS (runtime-status-recovery-probe.ts:189-200). Covered by does not turn RPC frequency into probe frequency after a failed probe and lets traffic probe again once the floor between traffic probes has elapsed. The description's "per-host backoff" claim now holds.

(c)3 — a revision mismatch is not a reachability failure · fixed (4f54271129)

Agreed, and there is a real window even though a same-id re-pair does clear the entry (runtime-status.ts deletes replacedEnvironmentIds from nextStatuses): a probe in flight across the re-pair resolves after the new pairing's own boot probe has recorded status: null, and recordProbeFailure then charged the old pairing's answer to the new host — 10s instead of 5s, compounding per stale in-flight probe.

Signal change, kept minimal and non-breaking:

  • runtime-status-refresh.ts returns RuntimeStatusRefreshOutcome = 'reachable' | 'unreachable' | 'superseded'.
  • The slice exposes refreshRuntimeEnvironmentStatusOutcome; refreshRuntimeEnvironmentStatus is now its one-line projection (=== 'reachable'), so every existing caller is untouched — runtime-environment-disconnect-toast.ts:55, sidebar-worktree-activation.ts, ephemeral-vm-worktree-creation.ts, hydrateRuntimeEnvironmentStatuses, and ~12 E2E helpers all keep reading the boolean.
  • Only the recovery port takes the outcome.

One thing the review's framing missed, worth flagging: "leave the budget alone" cannot be implemented as a bare return. The deadline is already in the past when the probe fires, so rearmSweep computes a 0ms timer and spins — I hit exactly that, 5001 calls in a 5s tick. It re-arms at the current interval without incrementing failures instead (deferProbeWithoutPenalty): nothing learned, nothing charged, no spin.

Tests: runtime-status-recovery-probe.test.ts › does not count a superseded probe against the host (confirmed red pre-fix), and the existing runtime-status.test.ts › drops a stale refresh %s after the same environment id is re-paired now also asserts resolves.toBe('superseded').

(c)4 — missing optional chaining · fixed (4f54271129)

Confirmed it throws. Now refreshRuntimeEnvironmentStatusOutcome?.(environmentId) ?? Promise.resolve('superseded' as const), matching the retainRuntimeDetectedAgents?.() idiom in runtime-status.ts. The superseded fallback is deliberate: a store without the slice never asked the host, so the loop must learn nothing rather than count a failure. Test: survives a store assembly without the runtime-status slice, confirmed red without the ?..

(b)1 — "red spreads" · kept deliberately, and now pinned by tests

This is the one judgement call, so, explicitly: the widening is correct and stays.

The only behavioural expansion is remoteControl.state === 'closed' && lastError. Reasons, in order of weight:

  1. The sidebar was the outlier, not the new behaviour. The status bar (SshStatusSegment → runtimeStatusForOverall → 'disconnected') and Settings › Available Hosts (RepositoryHostSetupsSection → isConnectedRuntimeHostState → false) already called that host disconnected. Three surfaces disagreeing about one host is precisely what runtimeHostConnectionState's own doc comment exists to prevent.
  2. It is not a loss-of-contact inference. ssh-execution-boundary.md forbids reading silence as death. A control channel that transitioned to closed and recorded a lastError is the host's own report — positive evidence, not absence of it. reconnecting and "no entry" stay unverifiable and stay un-red, which is the direction [Bug]: A saved Orca server stays "disconnected" in the sidebar for the whole session after one failed boot probe #16516 asked for.
  3. Narrowing it would mean writing a fourth private predicate — the exact drift Fix Ctrl+Backspace not deleting word in terminal #2 flags — and it would have to live in the sidebar only.
  4. It is no longer red-and-forgotten. Before, that host had a red glyph in two surfaces and no retry anywhere. Now the same derivation feeds the recovery loop, so it is re-probed like every other disconnected host. Most of the discomfort in "red spreads" was really "red is terminal", and Fix Ctrl+Backspace not deleting word in terminal #2 removed that.

Pinned in three places so it cannot drift back silently: worktree-card-runtime-host-state.test.ts › still reports a host whose remote control closed with an error, runtime-host-connection-state.test.ts › names the disconnected verdict for the glyph and the recovery loop alike, and E2E spec 2, which renders it.

(c)5 — the PR description overclaims · fixed both ways

You are right that spec 1 cannot demonstrate row 3: it writes store.setState itself, so the recovery is performed by the test.

Rather than only softening the prose, I added a second E2E spec that drives the loop: it seeds a host whose control channel closed with an error, replaces only the probe's network leg (the store's probe action), fires window.dispatchEvent(new Event('online')) — a real production trigger — and touches nothing else. The scheduler, its backoff, the port's candidate list, the real setRuntimeEnvironmentStatus publication and the card's selectors all run; the app decides what to probe and when. It then asserts the DOM recovered and that the loop actually enumerated that environment id.

It is a real regression test: against the pre-fix candidate list it fails with element(s) not found for svg.lucide-server — the card stays red, because the loop never enumerates a closed + lastError host.

The PR body's Visual Proof section is also rewritten: the two specs are now separate tables, spec 1 is labelled as showing the rendered verdict only ("It does not exercise the recovery loop, and is not evidence about it"), and the "was terminal for the session" claim now sits with spec 2, which demonstrates it.

(c)2 — publish the status ensureRuntimeEnvironmentCompatible already holds · declined

Your own caution is the smaller half of the problem, but it is real: getCachedRuntimeCompatibilityCheck returns an entry carrying status + statusCheckedAt under a TTL, so a naive entry.status publish would republish a cached observation as freshly observed — the exact lie this PR exists to prevent. Only the fresh check IIFE (runtime-rpc-client.ts:123-136) has a genuinely fresh result.

Two further reasons it does not pay:

  1. Publishing is not just writing the map. refreshRuntimeEnvironmentStatusOutcome's publish callback also runs ensureBrowserClientHostsForRestoredPages and replayClientHostedBrowserCloseIntents (runtime-status.ts). Feeding setRuntimeEnvironmentStatus directly, as suggested, would recover the glyph while silently skipping the restored-page re-attach and the close-intent replay — a worse bug than the round trip it saves.
  2. It needs the cycle or a fifth port method. runtime-rpc-client.ts cannot import @/store (see Fix PTY listener leak, use local restty with selection support #5), so this would need a fifth method on the port Fix PTY listener leak, use local restty with selection support #5 already calls too big.

And the saving is one round trip, not a recovery: the same call path already triggers a real probe via noteRuntimeEnvironmentReachable, so the host recovers either way.

(a)1 getRuntimeClientEventEnvironmentIds · confirmed, and left untouched

Verified: runtime-environment-subscription-selection.ts:22-27 still gates on state.runtimeStatusByEnvironmentId?.get(id)?.status being truthy, unchanged. The review's "no functional impact" is right — the recovery probe calls window.api.runtimeEnvironments.getStatus directly and never depends on a client-event subscription, so the self-reinforcing loop is broken at the probe, not at the selection. Once a re-probe succeeds the status turns truthy and the subscription follows on the next reconcile.

Deliberately out of scope: subscribing client events for environments believed unreachable widens IPC fan-out on the path renderer-agent-status-performance.md budgets, for hosts that by definition are not answering. That is a separate change with its own perf argument.

(a)2 settings.ts:193 · confirmed, and left untouched

Verified at settings.ts:191-192 — the "A recorded null still means the host was checked" comment gates the all-host boot re-probe on coverage, and the recovery loop is a separate per-host clock that does not consult it. Removing the guard would fire an all-host probe burst on every settings refresh, which is what the guard is there to prevent. No impact.

(b) note — the issue's reconnecting claim · agreed, and corrected at the source

You are right: !entry?.status returns false whenever status is truthy, so a re-attaching host already drew a normal glyph. I wrote that sentence in #16516 and it was wrong. Corrected in the issue body, and the same claim removed from this PR's description.

(b) — online / system-resume wiring

Noted as outside the issue and left as is — it sits with the shared-control and pane-recovery backoffs already advanced in the same handler, and E2E spec 2 now uses it as its trigger.


Verification

All on 4f54271129:

  • pnpm tc — clean
  • pnpm test src/renderer/src/{runtime,components/sidebar,store/slices,hooks,components/settings,components/status-bar}/ — 1035 files, 8490 tests passed
  • oxlint --format=stylish on all 16 changed files — clean (exit 0; sanity-checked against a seeded no-debugger violation so a silent no-op could not pass for a clean run)
  • pnpm exec electron-vite build --mode e2e then SKIP_BUILD=1 playwright test tests/e2e/sidebar-runtime-host-disconnected-glyph.spec.ts --project=electron-headless --workers=1 — 2 passed (32.7s)

Every new test was confirmed red against the pre-fix source hunk before being kept — revert, run, restore:

test pre-fix result
re-probes a host whose control channel closed with an error ✗ 1 failed | 5 passed
survives a store assembly without the runtime-status slice ✗ 1 failed | 5 passed
keeps widening the backoff for a host that answers but still reads disconnected ✗ 2 failed | 16 passed
does not count a superseded probe against the host ✗ (same run)
E2E recovers a red card through the recovery loop, not a store write ✗ element(s) not found for svg.lucide-server

Known-red and unrelated (identical on origin/main): pnpm run typecheck:e2e (237 errors), worktree-jump-palette-filter.spec.ts, sidebar-agent-row-identity.spec.ts.

Not done

  • No bench:idle-cpu run for Fix MaxListenersExceededWarning with singleton PTY dispatcher #6 — reasoned from the doc's model and pinned censuses instead, see above.
  • CodeRabbit's 80% docstring threshold stays declined: AGENTS.md asks for concise, non-obvious, "WHY not HOW" comments, one line where possible, and padding files to hit a coverage number is directly opposed to that.

Addressed by Claude Opus 5 (Claude Code).

`probe()` writes `backoffByEnvironment`, `probingEnvironments` and the sweep
timer after the refresh settles, but the stop function clears all three. A
probe that outlives its session therefore lands in the next one: its `.finally`
cleared the live session's in-flight marker and re-armed, so the following sweep
opened a second probe for a host already being probed, and its verdict widened
a retry budget it knew nothing about.

React StrictMode makes this the common path, not a corner case — the port is
installed from a `useEffect`, so every dev mount runs start/stop/start.

A generation counter captured at probe start and bumped when the port is
retired makes those completions settle into nothing. The sweep timer and the
recorded-status subscription need no equivalent: neither captures per-session
state, and stop clears the timer and unsubscribes before either can run.

Reported by CodeRabbit on stablyai#16518.
@ASDFGHoney

Copy link
Copy Markdown
Author

CodeRabbit review 5026107015 — "Isolate probe completion from a stopped session" (Major)

Confirmed and fixed in dbc357dd5f.

Reproduced first, both harms

I wrote the tests before touching the source and watched them fail against pre-fix 4f54271129:

× ignores a probe that settles after its session was stopped
  AssertionError: expected [ [Function], [Function], [Function] ] to have a length of 2 but got 3
× does not charge a retired probe against the live retry budget
  AssertionError: expected [ [Function] ] to have a length of 2 but got 1

The exact trace, with startRuntimeStatusRecoveryProbe returning stop and being re-started (what React StrictMode does to the useEffect in use-remote-runtime-recovery-triggers.ts on every dev mount):

  1. Session A probes honey-mac; probingEnvironments = {honey-mac}.
  2. A's stop runs: port = null, timer cleared, backoffByEnvironment.clear(), probingEnvironments.clear().
  3. Session B starts and opens its own probe for honey-mac; the marker is set again — but it is B's.
  4. A's retired probe settles. Its .then writes recordUnrecoveredProbe into B's budget, and its .finally runs probingEnvironments.delete('honey-mac') — clearing the marker of a probe that is still in flight — then rearmSweep().
  5. The re-armed sweep sees the host as not-in-flight and opens a duplicate probe: 3 concurrent refreshes for one host (assertion 1).

The budget harm is separable, which is what assertion 2 pins: when A's probe settles before B's first attempt is due, the stale failure widens B's backoff and pushes B's first real attempt from 5s out to 11s — a host the user is looking at stays red a base interval longer for a verdict about a pairing that no longer exists.

The fix

A module-level generation counter, captured at probe() start and bumped when the port is retired. All three completion handlers bail when the generation moved, so a retired probe writes no backoff, mutates no in-flight marker, and re-arms nothing. The scheduler itself is untouched.

Note the guard also keeps active.isRuntimeEnvironmentDisconnected(...) from being consulted through a retired port — it now only runs while active === port.

The other async completions in the module — no guard needed

I checked both and they are not stale-able, so I did not add tokens there:

  • The sweep setTimeout callback captures no per-session state. It sets timer = null and calls sweep(), which re-reads port and bails on null. Stop calls clearTimeout before it can fire at all.
  • subscribeToRecordedStatusChanges(rearmSweep) — rearmSweep reads only current module globals, and unsubscribe() runs unconditionally on stop, ahead of the port !== next guard.

probe() is the only path that captures per-session state (active) and writes module state after an await, which is exactly where the token now lives.

The bump sits inside the existing if (port !== next) branch, so a stale stop still cannot retire the live session.

Verification

Check Result
pnpm tc clean
pnpm test over runtime/, sidebar/, store/slices/, hooks/, settings/, status-bar/ 1035 files, 8492 tests passed, 100.26s
oxlint --format=stylish on both changed files 0 problems
pnpm exec electron-vite build --mode e2e ✓ built in 4.44s
sidebar-runtime-host-disconnected-glyph.spec.ts (electron-headless, 1 worker) 2 passed (32.1s)
Regression check: source hunk reverted, tests re-run 2 failed as quoted above; restored → 20 passed

Not addressed, deliberately

startRuntimeStatusRecoveryProbe does not bump the generation — only the stop path does. Installing a new port without a preceding stop would still let the previous port's probes settle into the new session, but that ordering is unreachable: the sole caller is a useEffect with [] deps, and React always runs cleanup before re-running the effect. Bumping on install would also strand the in-flight marker of a probe that can no longer clear it, so I left that path alone rather than trading a real hazard for a theoretical one. Happy to close it too if you disagree.

Also still declining the 80% docstring coverage pre-merge check — this repo's AGENTS.md mandates concise, non-obvious, WHY-not-HOW comments, and padding docstrings to hit a percentage conflicts with it directly.

@omarshahine

Copy link
Copy Markdown
Contributor

Heads up: I hit this bug on my own setup and, not realizing how far this PR had gotten, put up #19163 for the same issue before I found it. Sorry for the overlap.

Two servers, neither of them the active environment, app up ~28h, orca status --environment <host> reporting state: ready, reachable: true, connectionState: connected for both, while every sidebar card for those hosts drew the red glyph. Same root cause you diagnosed.

Mine is smaller and written against current main. It extends shouldRecheck in the existing runtime-status-recheck.ts ladder to cover status: null rather than adding a new recovery module, so it does not carry runtime-status-recovery-probe.ts or use-remote-runtime-recovery-triggers.ts. It reaches the same conclusion you did on the sidebar side: both call sites move onto the shared runtimeHostConnectionState derivation.

Worth noting your write-up here still holds up on current main, with one wrinkle: the recheck ladder that has landed since does not help, because shouldRecheck(null) is false. Every route out is gated on the state the host is stuck in.

Happy to close mine in favor of this one if you want to rebase it. Whichever a maintainer prefers is fine by me.

This branch has not been deployed

No deployments
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]: A saved Orca server stays "disconnected" in the sidebar for the whole session after one failed boot probe

3 participants