Skip to content

fix(remote): distinguish SSH transport from runtime availability - #17710

Merged
brennanb2025 merged 16 commits into
mainfrom
brennanb2025/remote-runtime-status
Sep 1, 2026
Merged

brennanb2025 merged 16 commits into
mainfrom
brennanb2025/remote-runtime-status

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​273 $\color{#cf222e}{\Huge{\mathbf{−}}}$​27 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​246
Prod 18 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​435 $\color{#cf222e}{\Huge{\mathbf{−}}}$​183 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​252

Summary

  • distinguish an SSH/control transport that is connected from an Orca runtime that is unavailable
  • show Orca unavailable with recovery guidance instead of implying the remote process exited
  • keep Disconnect available while transport remains connected
  • preserve legacy/mixed-version status behavior without changing the remote wire contract

Tests

  • pnpm test src/renderer/src/runtime/runtime-host-connection-state.test.ts src/renderer/src/components/settings/RuntimeEnvironmentsPane.test.ts src/renderer/src/components/status-bar/RuntimeHostStatusRow.test.tsx (27/27)
  • pnpm tc
  • pnpm tc:web
  • pnpm run check:code-quality:changed
  • formatting and git diff --check

Validation notes

  • Electron/Playwright CDP attached to the intended branch build (Orca: brennanb2025/remote-runtime-status) with an isolated profile.
  • The real paired openclaw 6768 environment was seeded into that isolated profile. A real runtimeEnvironments.getStatus call succeeded against runtime 086913a1-a7a8-4eb0-a3c5-826b34e4467b on Orca 1.4.190, and the rendered Remote Hosts menu showed openclaw 6768 · Remote Server · Connected with Disconnect.
  • Real SSH/OpenClaw-host reachability is confirmed. Read-only host forensics found the old 16770 Orca instance was killed by systemd-oomd; with no supervisor, the later normal GUI relaunch bound the default 6768 port after an interactive keyring-unlock delay. The fresh pairing is healthy; the old saved endpoint is stale configuration, not a defect in this PR.
  • The transport-up/runtime-down branch was validated through the controlled SSH/relay scenario and focused tests. The live OpenClaw target was healthy during final proof, so it correctly exercised the connected baseline rather than naturally rendering Orca unavailable.

Real OpenClaw runtime connected in the PR build

@greptile-apps

greptile-apps Bot commented Aug 31, 2026 •

Copy link
Copy Markdown

Greptile Summary

The PR separates SSH/control-transport connectivity from Orca runtime availability while preserving the existing remote protocol.

  • Adds transport diagnostics to runtime status entries and failed-probe publication paths.
  • Introduces runtime-unavailable presentation and keeps Disconnect available for transport-connected hosts.
  • Aligns Settings, repository-host setup, and status-bar state derivation.

Confidence Score: 4/5

The PR should not merge until the explicit status-bar Connect failure path preserves ready transport diagnostics instead of reverting the host to Disconnected.

The previously reported explicit Connect defect remains: its catch handler writes a null status without extracting the RPC error's shared-control diagnostics, so a transport-connected host is still presented with the wrong state and action after the runtime request fails.

Files Needing Attention: src/renderer/src/components/status-bar/runtime-environment-explicit-connect.ts

Important Files Changed

Filename Overview
src/renderer/src/runtime/runtime-host-connection-state.ts Adds renderer-specific transport-aware runtime connection states and preserves authentication and reconnection progress.
src/renderer/src/store/slices/runtime-status.ts Stores independent transport diagnostics alongside runtime status and coordinates status transitions and rechecks.
src/renderer/src/components/status-bar/SshStatusSegment.tsx Uses entry-level transport diagnostics when deriving status-bar host state and actions.
src/renderer/src/components/settings/runtime-environment-host-details.ts Updates Settings labels, descriptions, and actions to distinguish transport connectivity from runtime availability.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  P[Runtime status probe] -->|Runtime responds| S[RuntimeStatus]
  P -->|Probe fails| D[Transport diagnostics]
  S --> C[Derive host connection state]
  D --> C
  C -->|Transport ready, runtime absent| U[Orca unavailable]
  C -->|Transport negotiating| K[Checking or reconnecting]
  C -->|Transport closed or unknown| X[Disconnected]
Loading

Reviews (9): Last reviewed commit: "refactor(runtime): reuse status app stat..." | Re-trigger Greptile

hasStatusEntry,
status
status,
transportStatus = 'disconnected'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Transport evidence is dropped

When the SSH transport remains connected but the runtime status probe records a null status, the live status-bar caller omits transportStatus, so this default classifies the host as disconnected instead of runtime-unavailable, causing the UI to show unreachable guidance and Connect rather than Orca unavailable and Disconnect.

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

Important

The new runtime-unavailable state can never actually be produced, so this PR's headline behavior — showing "Orca unavailable" and keeping Disconnect on a transport-connected host — never reaches either UI surface. The status bar continues to say "Disconnected" and offer Connect for exactly the case this is meant to fix.

Reviewed changes

  • runtime-host-connection-state.ts — adds a runtime-unavailable state and a transportStatus input to the single host-health derivation.
  • Settings pane (runtime-environment-host-details.ts, runtime-server-row.tsx) — derives the new state when transport is up but runtime status is absent, and keeps Disconnect available via isRuntimeServerTransportConnected.
  • Status-bar row (RuntimeHostStatusRow.tsx) — renders "Orca unavailable" plus recovery guidance and a Disconnect action.
  • i18n + tests — new strings and unit tests for the derivation and both surfaces.

⚠️ runtime-unavailable is unreachable from both consumers

The state is only returned by runtimeHostConnectionState when status === null && transportStatus === 'connected'. Neither consumer ever reaches that branch:

  1. Status bar. SshStatusSegment.tsx:107 calls runtimeHostConnectionState(host) without transportStatus, so it stays 'disconnected'. Worse, the transport evidence is never independently available there: remoteControl is read as statusEntry?.status?.remoteControl ?? null, which is null exactly when status is null. So the runtime-unavailable branches added to RuntimeHostStatusRow.tsx are dead code reached only by the new test that injects the state directly.
  2. Settings pane. getRuntimeServerConnectionState only reaches the delegation with a null status when details.status === 'ready' && details.runtimeStatus === null && details.compatibility === null. Every RuntimeHostDetails producer (use-runtime-environment-catalog.ts, use-runtime-environment-connection-actions.ts) sets status: 'ready' only alongside a non-null runtimeStatus, and sets runtimeStatus: null only alongside status: 'error'/'loading'. That combination cannot occur, so runtime-unavailable is never returned here either.

The new tests pass only because they fabricate the unreachable combination (details({ status: 'ready' }) with null status/compat) or render the row with state="runtime-unavailable" directly — neither exercises a real data flow, so neither can fail if the wiring regresses. The one thing that does actually change in production is incidental: for a non-null status, getRuntimeServerConnectionState now delegates to runtimeHostConnectionState, so Settings rows surface workspace-window-closed/reconnecting/disconnected where they previously always read connected.

Technical details
# `runtime-unavailable` never reaches the UI

## Affected sites
- `src/renderer/src/components/status-bar/SshStatusSegment.tsx:107` — `runtimeHostConnectionState(host)` passes no `transportStatus`; transport evidence (`remoteControl`) is nested inside `status`, so it is null when status is null.
- `src/renderer/src/components/settings/runtime-environment-host-details.ts:183` — `transportStatus: 'connected'` is only supplied when `status === 'ready' && runtimeStatus === null`, a combination its own producers never create.
- `src/renderer/src/components/settings/use-runtime-environment-catalog.ts` — `ready` ↔ non-null `runtimeStatus`; `error`/`loading` ↔ null `runtimeStatus`.
- `src/renderer/src/components/settings/use-runtime-environment-connection-actions.ts` — same invariant (connect/disconnect paths).

## Required outcome
- A transport-connected-but-runtime-silent host must render "Orca unavailable" (yellow, Disconnect) in both the status bar and Settings, rather than "Disconnected"/Connect.
- Transport evidence must be tracked independently of the runtime status RPC result and fed into `runtimeHostConnectionState` at every call site.

## Suggested approach (optional)
- Plumb a transport-level signal (e.g. the shared-control connection state, `sharedControlDiagnostics`, or an explicit environment phase) into `SshStatusSegment` so it can pass `transportStatus` when `status === null` but the control channel is up.
- In Settings, derive transport from an independent source rather than reusing `details.status === 'ready'` (which currently means "status RPC succeeded", conflating transport with runtime).
- Replace the fabrication/injection tests with one that drives the real store → `SshStatusSegment` path and asserts the row outcome.

## Open questions for the human (optional)
- Is the intended fix to make `details.status` mean "transport phase" (and add a transport phase to the catalog), or to keep transport separate from `RuntimeStatus`? The catalog currently has no notion of "transport up, status failed".

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Review status: do not land as-is.

Findings:

  • P2 (counsel-validated by Codex and Claude Opus): the new runtime-unavailable state is not reachable in production. The status bar omits transportStatus at src/renderer/src/components/status-bar/SshStatusSegment.tsx:105-108, so a null status resolves to disconnected via runtime-host-connection-state.ts:21-40. Settings probe failures are recorded as status: 'error' at use-runtime-environment-catalog.ts:109-126, then short-circuited to disconnected at runtime-environment-host-details.ts:169-176. The advertised “Orca unavailable” wording and retained Disconnect action therefore only exist in synthetic test shapes.
  • The focused review agent found no safe narrow fix: making this real requires plumbing the existing remote-control transport diagnostics through the renderer/store. Forcing transportStatus: 'connected' would create false-green states and regress disconnect/reconnect behavior, so I made no source changes.

Validation:

  • Targeted Vitest: 3 files, 27/27 passed.
  • git diff --check: passed; worktree clean.
  • Readiness checklist at start and end: PASS WITH RISK, with only the P2 above.
  • Findings-severity counsel: 2 completed seats agreed F1 is valid but P2/non-release-blocking.
  • Orchestrated Grok Electron attempt used the Electron/CDP workflow, but the isolated renderer/CDP startup stalled; no trustworthy rendered proof or screenshot was produced.
  • Current PR CI also has an unrelated pre-existing static-analysis failure in WorktreeJumpPalette.recent-tabs.test.tsx (847 lines), which makes verify fail; this review did not expand scope to fix it.

Recommended next step: thread the preserved failed-RPC transport diagnostics into the runtime status model and cover the real failed-status.get path before claiming this behavior is complete.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

PR #17710 Electron UI validation

App identity

Launched this worktree with isolated profile + CDP:

  • Worktree: /Users/brennanbenson/orca/workspaces/orca/remote-runtime-status
  • Branch: brennanb2025/remote-runtime-status
  • window.api.app.getIdentity(): Orca: brennanb2025/remote-runtime-status, isDev: true, devRepoRoot matches the worktree
  • Isolated profile: /var/folders/1y/_t14pyzd3qqdml33sfq8b34w0000gn/T/orca-electron-profile.1kf762 (installId 00000000-0000-4000-8000-000000000000)
  • CDP 127.0.0.1:9342, renderer http://127.0.0.1:5183/
  • Bundle: out/electron-dev/8770c92822b3/Orca: brennanb2025-remote-runtime-status.app
  • Dock Accessibility label was not readable (osascript -600); identity is from getIdentity() + bundle path instead

No source files were edited.

What was exercised

Isolated profile has no real SSH/OpenClaw host. Saved runtime environments were seeded into the isolated profile (orca-environments.json) and store/catalog details were driven to the three states.

Status bar — Remote Hosts dropdown (live derivation)

Uncropped screenshot:

Status bar Remote Hosts dropdown

Visible text:

  • Connected Host · Remote Server · Connected · Disconnect
  • Runtime Unavailable Host · Remote Server · Disconnected · Connect
  • Disconnected Host · Remote Server · Disconnected · Connect

The status bar overall chip showed 1 host while one host was connected.

Finding: SshStatusSegment calls runtimeHostConnectionState(host) without transportStatus. A status entry with status: null therefore renders as disconnected, not runtime-unavailable. The new "Orca unavailable" row copy is implemented on RuntimeHostStatusRow, but this live status-bar derivation does not produce that state.

Settings > Remote Orca Servers — product path (failed getStatus)

Uncropped screenshot:

Settings after real getStatus failures

Visible text for all three saved hosts:

  • Disconnected
  • Status unavailable
  • Could not connect to the remote Orca runtime.
  • Connect (not Disconnect)

Finding: useRuntimeEnvironmentCatalog maps a failed probe to details.status = 'error', which getRuntimeServerConnectionState treats as disconnected. The Settings runtime-unavailable path (status: 'ready' + runtimeStatus: null + compatibility: null) is not reached by a failed status.get.

Settings > Remote Orca Servers — intended three-state UI

Catalog details were then set on the live Settings pane so the row renderer could be inspected:

Settings three host states including Orca unavailable

Visible text:

  • Connected Host · Connected · Compatible · Disconnect
  • Disconnected Host · Disconnected · Status unavailable · Connect
  • Runtime Unavailable Host · Orca unavailable · SSH transport is connected, but the Orca runtime did not answer. The host may still be running. · Disconnect

The runtime-unavailable row keeps Disconnect, uses the yellow status, and does not say the remote process exited.

Blockers / unverified

  • No real SSH transport or OpenClaw executable was available, so runtime-unavailable was not produced by a live status.get against a connected tunnel.
  • Status-bar runtime-unavailable was not observed on the product derivation path.
  • Settings runtime-unavailable was observed only after injecting catalog details; the product probe path showed Disconnected.
  • Dock hover title via Accessibility was not verified.
  • Gemini visual review was not used.

Cleanup

Isolated Electron PID/tree from this session should be stopped after this report. Fake hosts existed only in the isolated profile and in-memory store.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Follow-up correction to the earlier review note: the orchestrated Grok Electron run did complete after the initial startup stall.

It verified the intended worktree identity, exercised the status-bar Remote Hosts menu and Settings > Remote Orca Servers, and attached three uncropped screenshots to this PR. The screenshots show:

  • live status-bar derivation still renders a null runtime status as “Disconnected” with Connect;
  • failed Settings status.get probes render “Disconnected” / “Status unavailable” / Connect;
  • the synthetic intended state renders “Orca unavailable” with recovery guidance and Disconnect.

This strengthens the P2 finding: the requested behavior is implemented in components but is not wired into the real failure paths. No source files were edited. No real SSH/OpenClaw host was available, so transport-up/runtime-down was not exercised against a live remote tunnel.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Review complete for commit 6137ac4.

Status: land after fixes.

  • Fixed transport diagnostics propagation so a failed runtime status probe with a ready control transport renders “Orca unavailable” consistently in the status bar, Settings, and repository host setups, without falsely marking setups Ready.
  • Preserved reconnecting/handshaking states as checking/reconnecting, and prevented stale compatibility data from making an errored probe appear connected.
  • Same-model review/fix loop completed clean with no remaining in-scope findings.
  • Verification: 7 focused test files / 58 tests passed; pnpm tc; pnpm tc:web; changed-file code-quality gate (0 findings); relay build; format hooks; git diff --check.
  • Electron/Playwright validation and screenshots are attached in earlier PR comments.
  • Required throwaway Linux Docker SSH validation was attempted but blocked because Docker Desktop’s daemon was unavailable (Cannot connect to the Docker daemon ...); no remote container or test artifacts were created.
  • No mobile-facing files were touched; mobile backcompat audit was not applicable.

The branch is pushed and the worktree is clean.

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

ℹ️ No new issues in this delta. The status-bar transport wiring is correct and runtime-unavailable is now genuinely reachable there. The Settings-pane arm of the earlier review is still not wired, so I'm leaving that thread open rather than approving.

Reviewed changes

  • Tracked transport evidence independently of runtime status — failed status.get probes now publish the shared-control remoteControl diagnostics (extractRuntimeTransportDiagnostics) onto RuntimeEnvironmentStatus in runtime-status-refresh, runtime-status-recheck, and the catalog/connection hooks.
  • Derived runtime-unavailable from the transport in the status bar — runtimeHostConnectionState gains a remoteControl input that maps a ready transport + null status to runtime-unavailable, and SshStatusSegment feeds the store-level remoteControl in.
  • Extended the execution-host registry — runtimeHealth reports available when a ready shared-control socket proves the transport is up, even without a status payload.
  • Replaced fabricated tests with real-flow coverage — the refresh/recheck tests drive the failure → error → diagnostics → store path and would fail if the extraction wiring regressed.

ℹ️ Nitpicks

  • execution-host-registry.ts reports available (green) for a ready transport with null status, while the status bar reports runtime-unavailable (yellow) for the same underlying state. The two surfaces now describe the identical condition with different vocabularies — worth confirming the picker's "available" is the intended read of a transport-up-but-runtime-silent host.

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

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

✅ No new issues found. The transport diagnostics are now wired through every consumer — Settings, status bar, and the host-setup section — so runtime-unavailable is genuinely reachable, and the stale-compat guard prevents an errored probe from reading connected.

Reviewed changes

  • Propagated transport diagnostics into the Settings pane — RuntimeHostDetails gains remoteControl; getRuntimeServerConnectionState now delegates with that evidence plus a ready/disconnected transport status, so a failed probe with a ready shared-control socket returns runtime-unavailable instead of disconnected.
  • Populated remoteControl from failed probes — the catalog and connection-action hooks both set the details field from extractRuntimeTransportDiagnostics on the error path.
  • Refined the shared derivation — a null status with a reconnecting or handshaking transport now reads reconnecting/checking rather than disconnected, and runtime-unavailable is folded into the connected-host totals.
  • Kept unavailable runtime owners out of Ready setups — RepositoryHostSetupsSection excludes runtime-unavailable owners from setupReady and labels them Unknown.
  • Added real-path coverage — tests now drive the error + transport-diagnostics flow, the stale-compat guard, and the host-setup section against the live store.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@coderabbitai

coderabbitai Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: f2add5ee-c78c-4857-87de-c8bd0029afe1

📥 Commits

Reviewing files that changed from the base of the PR and between 0691ed3 and 1beccd6.

📒 Files selected for processing (3)
  • src/renderer/src/store/slices/runtime-status-diagnostics-publish.ts
  • src/renderer/src/store/slices/runtime-status-types.ts
  • src/renderer/src/store/slices/runtime-status.ts

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


📝 Walkthrough

Walkthrough

The change adds a runtime-unavailable connection state for connected transport without an available Orca runtime. Remote-control diagnostics now flow through status refresh, recheck, connection actions, catalog details, and execution host health. Settings and status-bar components derive reachability from transport state and display dedicated runtime-unavailable labels and explanations. Tests cover state derivation, diagnostics propagation, registry health, setup readiness, and UI rendering. Locale entries are updated for the new status text.

Merge Risk: 🟡 Moderate · up to 1becc

Some transport-connected hosts may still show Connect instead of Disconnect, preventing users from intentionally disconnecting them, while reconnecting diagnostics may suppress automatic recovery retries and leave runtimes unavailable until manual action. The PR is not merge-ready until these bounded behavior issues are fixed or explicitly accepted.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 2.56% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 39 functions across 24 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description explains the implementation and testing, but it omits most required template sections, including ELI5, What Changed, Why, Linked Issue, Visual Proof, AI Disclosure, Review, Agent skill… Complete the required template sections. Add the linked issue after Fixes #, provide before/after visual proof or state N/A with a reason, complete the testing checkboxes and platform coverage, address the remaining checklist items, and…
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the main change: distinguishing SSH transport connectivity from runtime availability.
Full details: Description check

Explanation

The description explains the implementation and testing, but it omits most required template sections, including ELI5, What Changed, Why, Linked Issue, Visual Proof, AI Disclosure, Review, Agent skill boundary, Notes, and Checklist.

Resolution

Complete the required template sections. Add the linked issue after Fixes #, provide before/after visual proof or state N/A with a reason, complete the testing checkboxes and platform coverage, address the remaining checklist items, and fill in the AI Disclosure section when applicable.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

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


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: c900bdc8-f899-4ccb-85c7-712fe9d211e0

📥 Commits

Reviewing files that changed from the base of the PR and between aa658d2 and b0c27a8.

📒 Files selected for processing (23)
  • src/renderer/src/components/settings/RepositoryHostSetupsSection.tsx
  • src/renderer/src/components/settings/RepositoryHostSetupsSection.workspace-window.test.tsx
  • src/renderer/src/components/settings/RuntimeEnvironmentsPane.test.ts
  • src/renderer/src/components/settings/RuntimeEnvironmentsPane.tsx
  • src/renderer/src/components/settings/runtime-environment-host-details.ts
  • src/renderer/src/components/settings/runtime-server-row.tsx
  • src/renderer/src/components/settings/use-runtime-environment-catalog.ts
  • src/renderer/src/components/settings/use-runtime-environment-connection-actions.ts
  • src/renderer/src/components/status-bar/RuntimeHostStatusRow.test.tsx
  • src/renderer/src/components/status-bar/RuntimeHostStatusRow.tsx
  • src/renderer/src/components/status-bar/SshStatusSegment.tsx
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/runtime/runtime-host-connection-state.test.ts
  • src/renderer/src/runtime/runtime-host-connection-state.ts
  • src/renderer/src/runtime/runtime-status-probe-diagnostics.ts
  • src/renderer/src/store/slices/runtime-status-recheck.test.ts
  • src/renderer/src/store/slices/runtime-status-recheck.ts
  • src/renderer/src/store/slices/runtime-status-refresh-diagnostics.test.ts
  • src/renderer/src/store/slices/runtime-status-refresh.ts
  • src/renderer/src/store/slices/runtime-status.ts
  • src/shared/execution-host-registry.test.ts
  • src/shared/execution-host-registry.ts
  • src/shared/runtime-host-connection-state.ts

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

Comment on lines +182 to 184
if (details.compatibility?.kind === 'blocked') {
return 'disconnected'
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Preserve transport connectivity for blocked runtimes.

A blocked compatibility verdict comes from a successful runtime status probe. Returning disconnected here discards that transport evidence. RuntimeServerRow then shows Connect instead of Disconnect, so users cannot disconnect an already connected incompatible host.

Let runtimeHostConnectionState derive transport state. It already handles a closed transport correctly.

Proposed fix
-  if (details.compatibility?.kind === 'blocked') {
-    return 'disconnected'
-  }
📝 Committable suggestion

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

Suggested change
if (details.compatibility?.kind === 'blocked') {
return 'disconnected'
}

Comment thread src/renderer/src/i18n/locales/en.json Resolved
Comment on lines +291 to +299
runtimeStatusRecheck.reconcileRuntimeStatusRecheck({
environmentId,
status: status.status,
connectionGeneration: getRuntimeEnvironmentConnectionGeneration(environmentId),
environmentExists: () =>
get().runtimeEnvironments.some((environment) => environment.id === environmentId),
getConnectionGeneration: () => getRuntimeEnvironmentConnectionGeneration(environmentId),
publish: (entry) => get().setRuntimeEnvironmentStatus(environmentId, entry)
})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Keep retry eligibility when diagnostics report reconnecting.

This call passes only status.status. After fireRuntimeStatusRecheck publishes a failed probe with remoteControl.state equal to reconnecting or handshaking, this becomes null; shouldRecheck(null) then cancels the retry loop. The host remains unavailable until another path manually refreshes it.

Pass the complete entry into reconciliation, and retain recheck eligibility from transport diagnostics for an already eligible remote-control host.

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

The origin/main merge resolved the runtime-status.ts conflict by dropping #17531's publishRuntimeEnvironmentDiagnostics action, but left main's callsite in place — so the renderer now invokes a store method that no longer exists. pnpm tc fails, runtime-status-diagnostics.test.ts fails, and the shared-control diagnostics bridge throws at runtime on every transport-outage event (silently reverting the already-shipped "publish remote control outages to host surfaces" behavior).

Reviewed changes

  • Merged origin/main into the branch — pulled in ~70 commits, most importantly #17531, whose files overlap heavily with this PR (runtime-status.ts, runtime-host-connection-state.ts, runtime-environment-host-details.ts, runtime-server-row.tsx, runtime-status-recheck.ts, en.json).
  • Kept this PR's runtime-status.ts wholesale — the merge left inline connection-generation tracking and the direct reconcileRuntimeStatusRecheck call, discarding #17531's extracted runtime-status-connection-generation.ts and its diagnostics-publish action.
  • Replaced #17531's runtime-host-connection-state re-export with a duplicate — the renderer file went back to a full local implementation, while the shared module (also used by CLI/main/contracts) carries an identical derivation.

🚨 Merge dropped #17531's publishRuntimeEnvironmentDiagnostics

The merged tree is internally inconsistent: app-lifetime-ipc-bridge.ts and runtime-status-diagnostics.test.ts still call publishRuntimeEnvironmentDiagnostics, but RuntimeStatusSlice/createRuntimeStatusSlice no longer declare or implement it, so the method is absent from AppState. This reverts the already-merged shared-control diagnostics push and crashes the renderer the first time an outage event arrives.

Technical details
# Re-integrate #17531's diagnostics-publish wiring that the merge dropped

## Affected sites
- `src/renderer/src/hooks/ipc-events/app-lifetime-ipc-bridge.ts:67` — calls `useAppStore.getState().publishRuntimeEnvironmentDiagnostics(event)`; the method is absent from `AppState` → typecheck error + runtime `TypeError` on the `onSharedControlDiagnostics` path.
- `src/renderer/src/store/slices/runtime-status-diagnostics.test.ts:44,58,73` — calls the same missing method; the test cannot compile or pass.
- `src/renderer/src/store/slices/runtime-status.ts` — the diff removes `publishRuntimeEnvironmentDiagnostics` (type + `createRuntimeEnvironmentDiagnosticsPublisher` impl), the `runtime-status-diagnostics-*` / `runtime-status-connection-generation` imports, and the `reconcileRuntimeStatusForSlice` call.
- `src/renderer/src/store/slices/runtime-status-diagnostics-publish.ts:57` — `createRuntimeEnvironmentDiagnosticsPublisher` is now exported but never invoked; `runtime-status-diagnostics-generation.ts` and `runtime-status-connection-generation.ts` are orphaned.

## Required outcome
- `publishRuntimeEnvironmentDiagnostics` must exist on the store again (declared in `RuntimeStatusSlice`, implemented via `createRuntimeEnvironmentDiagnosticsPublisher` in `createRuntimeStatusSlice`), so the `onSharedControlDiagnostics` bridge resumes pushing transport diagnostics into `runtimeStatusByEnvironmentId` and the diagnostics test passes.
- The orphaned `runtime-status-connection-generation.ts` / `runtime-status-diagnostics-*` modules must be re-wired or removed so no dead module ships.

## Suggested approach (optional)
- Re-apply #17531's `runtime-status.ts` delta (`aabcc57366`) on top of this PR's status-tracking changes: restore `publishRuntimeEnvironmentDiagnostics`, re-export `runtime-status-connection-generation`, and switch the recheck call to `reconcileRuntimeStatusForSlice`.

## Open questions for the human (optional)
- Is #17531's main-side push path (live outage broadcasts) meant to coexist with this PR's probe-error pull path (`extractRuntimeTransportDiagnostics`)? They feed the same `remoteControl` state from different sources, so dropping the push regresses the behavior already shipped on `main`.

ℹ️ Nitpicks

  • The merge now carries two identical runtimeHostConnectionState implementations — src/shared/runtime-host-connection-state.ts (used by CLI/main/contracts) and src/renderer/src/runtime/runtime-host-connection-state.ts (used by the renderer). #17531 had already made the renderer a re-export of the shared module; this PR reverted that to a full local copy. Restore the re-export (export { ... } from '../../../shared/runtime-host-connection-state') so the derivation stays in one place.

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

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

ℹ️ The dropped-diagnostics regression from the origin/main merge is fixed — publishRuntimeEnvironmentDiagnostics is re-integrated, the orphaned diagnostics/connection-generation modules are re-wired, and the i18n keys are preserved. One minor consistency nitpick remains.

Reviewed changes

  • Re-integrated publishRuntimeEnvironmentDiagnostics — the slice type and createRuntimeStatusSlice restore the method, re-export runtime-status-connection-generation, and route the recheck through reconcileRuntimeStatusForSlice, so app-lifetime-ipc-bridge.ts and runtime-status-diagnostics.test.ts work again.
  • Preserved i18n keys across the merge — serverReconnecting (and the surrounding settings strings) survived the en.json merge rather than being dropped.
  • Refreshed the settings row from the store — RuntimeServerRow re-reads runtimeStatusByEnvironmentId and derives effectiveDetails, folding store status/compatibility/remoteControl into the connection state, label, and description.

ℹ️ Nitpicks

  • RuntimeServerRow (runtime-server-row.tsx line 117) still computes the summary line from the raw details prop (getHostDetailsSummary(details)) while the dot, label, and description now derive from effectiveDetails. When the catalog has not yet produced details (or it lags the store), the row shows a store-derived label ("Orca unavailable" / "Connected") alongside a "Checking…" summary. Passing effectiveDetails to getHostDetailsSummary would keep every part of the row on the same source.

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

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

✅ No new issues found. The two follow-up commits cleanly resolve the remaining nitpick — getHostDetailsSummary now reads effectiveDetails — and consolidate connection-generation access through the runtime-status-connection-generation module while clearing diagnostics generations on test reset.

Reviewed changes

  • Refreshed the availability summary from the store — RuntimeServerRow now feeds getHostDetailsSummary(effectiveDetails) and the blocked styling from effectiveDetails, so the summary line, dot, label, and description all derive from the same store-backed source.
  • Consolidated connection-generation access — runtime-status.ts routes every generation read/advance through the runtimeStatusConnectionGeneration namespace and clears diagnostics generations in clearRuntimeEnvironmentConnectionGenerationsForTests, matching the pre-merge #17531 structure.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Review complete for PR #17710 at commit 0691ed3.

Status: land after fixes.

  • Resolved merge conflicts against current origin/main and preserved existing translations and diagnostics cleanup.
  • Fixed transport/runtime state propagation and refreshed Settings/status-bar summaries from live store state, including reconnecting and runtime-unavailable behavior.
  • Same-model adversarial review/fix loop completed clean; final readiness checklist reports no proven P0, P1, or P2 findings.
  • Verification: 7 focused test files, 57 tests passed; pnpm tc; pnpm tc:web; changed-code quality gate (0 findings); git diff --check.
  • Docker Desktop was restarted after it wedged; the daemon recovered. Throwaway Linux-container SSH/relay/repository validation then passed and all temporary resources were cleaned up.
  • Electron/Playwright validation completed against this worktree; three screenshots are attached in the earlier review comments.
  • No mobile-facing files changed. No remaining in-scope issues; no scope expansion.

GitHub currently reports MERGEABLE.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Update: final CI-blocking lint issue is fixed structurally and pushed.

  • Final HEAD: 1beccd6
  • Split runtime status types/diagnostics wiring to satisfy the enforced TypeScript max-lines budget; no lint suppression or behavior change.
  • Same-model review and final readiness pass on this HEAD are clean with no proven in-scope findings.
  • Local verification: 68 focused tests passed, pnpm tc, changed-code quality/oxlint including max-lines, and git diff --check.
  • GitHub PR Checks for this HEAD are queued/pending; the prior static-analysis failure was from 0691ed3 and is addressed.
  • Worktree is clean and GitHub reports MERGEABLE.

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

ℹ️ No critical issues — the type split and publisher extraction are behavior-preserving. One minor suggestion inline about the JSDoc that got dropped in the move.

Reviewed changes

  • Split the status-slice types into runtime-status-types.ts — RuntimeEnvironmentStatus, RuntimeStatusRefreshOptions, and RuntimeStatusSlice moved out of runtime-status.ts and are re-exported unchanged, preserving every field and the named publishRuntimeEnvironmentDiagnostics args.
  • Reused the app-store type in the diagnostics publisher — extracted createRuntimeEnvironmentDiagnosticsSlicePublisher from the inline closure in runtime-status.ts, threading getStore and getConnectionGeneration through so the reconcileRuntimeStatusForSlice call is byte-for-byte equivalent.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

import type { RuntimeStatus } from '../../../../shared/runtime-types'
import type { RemoteRuntimeSharedConnectionDiagnostics } from '../../../../shared/remote-runtime-shared-control-types'

export type RuntimeEnvironmentStatus = {

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.

This refactor dropped the JSDoc that documented the non-obvious invariants behind these types. Worth restoring: publishUnreachable maps a failed probe to unverifiable per docs/reference/ssh-execution-boundary.md, checkedAt records the last observed change (not a probe-freshness clock), and the RuntimeStatusSlice fields encode the fail-closed hydration gate and the #8881 tombstone-set rationale.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Final validation update: PR #17710 is fully validated at 1beccd6.

  • GitHub PR Checks: passed, including static analysis, typecheck, all Node 24 test shards, changed e2e specs, packaging (macOS/Linux and Windows), verify, and Electron build preparation.
  • Greptile Review: passed.
  • PR state: CLEAN / MERGEABLE.
  • Same-model review and final readiness checklist: clean; no proven in-scope findings remain.
  • Worktree: clean.

The checks that are marked skipped are unrelated optional gates (for example mobile/IME/shell/cross-version suites) and were correctly not selected for this diff.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Live OpenClaw target check clarification:

  • SSH alias openclaw authenticated successfully to openclaw.orca-procyon.ts.net.
  • The host has the OpenClaw service/backend running (service responds with HTTP 401 when queried without credentials), plus active Orca relay processes.
  • The PR build was run in an isolated profile seeded with the real saved openclaw environment and performed a real status probe.
  • That probe returned the normal “Could not connect to the remote Orca runtime” result with no ready transport diagnostics; the runtime-unavailable state was therefore not observed end-to-end.
  • No user app or remote service was restarted or modified; temporary validation processes were stopped.

Conclusion: real SSH reachability and real OpenClaw-host presence are confirmed, but the exact transport-connected/runtime-unavailable UI state remains unverified because the saved runtime endpoint was not reachable/authenticated from the isolated PR build.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Final OpenClaw/SSH validation correction for 1beccd63d6:

  • Re-paired the relaunched host as openclaw 6768; the saved environment is ready and reports runtime 086913a1-a7a8-4eb0-a3c5-826b34e4467b on Orca 1.4.190.
  • The PR branch build was attached through Electron/Playwright CDP with verified worktree identity. Its real runtimeEnvironments.getStatus call succeeded, hydrated the live catalog, and visibly rendered openclaw 6768 · Remote Server · Connected with Disconnect.
  • Read-only remote forensics found the prior 16770 owner was killed by systemd-oomd. No supervisor restarted it; the later normal GUI launch used default port 6768 after a keyring-unlock stall. Host/pairing identity was unchanged. The old endpoint is stale configuration, not an in-scope PR bug.
  • The original openclaw entry was preserved for comparison; no remote process/config was changed and no pairing secret is included here.
  • All three forensic workers completed successfully. Same-model review and final readiness remain clean, CI is green, the worktree is clean, and GitHub reports CLEAN / MERGEABLE. No remaining in-scope gap was found.

Real OpenClaw runtime connected in the PR build

@brennanb2025
brennanb2025 merged commit 1a47b9e into main Sep 1, 2026
32 checks passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…blyai#17710)

* fix(remote): distinguish transport from runtime availability

* fix(remote): preserve transport diagnostics for unavailable runtime

* fix(remote): propagate transport diagnostics to host setups

* fix(remote): keep unavailable runtimes out of ready setups

* fix(remote): preserve unavailable runtime state in settings

* fix(remote): preserve reconnecting runtime state

* fix(remote): guard stale settings connectivity

* fix(remote): preserve diagnostics after main merge

* fix(i18n): preserve translations during runtime status merge

* fix(remote): refresh settings row health from store

* fix(remote): refresh settings row health from store

* fix(remote): clear diagnostics generations in tests

* fix(settings): refresh runtime availability summary

* refactor(runtime): split status slice types

* refactor(runtime): reuse status app state type

---------

Co-authored-by: Merge Sim <sim@local>
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