Skip to content

fix(ui): keep Gateway presentation through reconnects - #174044

Merged
steipete merged 12 commits into
mainfrom
steipete/offline-retain
Oct 17, 2026
Merged

steipete merged 12 commits into
mainfrom
steipete/offline-retain

Conversation

@steipete

@steipete steipete commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: most of the Control UI goes blank or inert on every brief Gateway disconnect.

The Gateway store nulled the handshake (hello) and plugin capabilities on every socket close, so a two-second blip looked like "feature gone / permission denied / Gateway too old" to hundreds of consumers: plugin tabs vanished, Cron showed a missing-read-scope message, About lost the version, Home/Custodian availability flickered. On top of that, the shell made 52 of 57 routes inert the instant the socket dropped (before the 2 s offline grace) under an "Actions are unavailable while the Gateway reconnects" band, blocking reading, scrolling, copying, filtering and local drafting.

User Impact

User impact: a brief disconnect no longer changes what you can see or read. Pages stay interactive while reconnecting; only actions that genuinely need the Gateway are disabled until it is back, and the bottom-left connection status explains the state.

Why This Change Was Made

The store keeps the last accepted handshake and plugin capabilities for the same client through transport loss and replaces them on the next hello. They are cleared exactly where identity or authority is invalidated: credential or Gateway change, stop, retired offline recovery, and any server-sent connect rejection (auth, pairing, protocol, build) — one transient-close predicate now shared with the existing self-profile retention.

Live authority is unchanged: canCallGatewayMethod still requires a connected client, and the Gateway still authorizes every request. A new presentation-only canPresentGatewayMethod backs navigation/panel availability; isHomePanelAvailable drops its private last-access cache (it existed only to paper over the nulled handshake) and Custodian availability moves next to it. The blanket inert band is removed; Cron submit, skill import and worktree mutations are explicitly disabled while disconnected.

Second PR in the offline-first series (after the bottom-left connection status).

Evidence

  • Store-boundary tests: retention through reconnecting/offline, replacement on fresh hello, clearing on auth/pairing/protocol/build rejection, credential/Gateway change, client replacement, stop.
  • Presentation vs live dispatch contract tests; shell test that no route is inert or banded while reconnecting/offline; page tests for disabled offline actions with editable drafts; updated login-gate and native-plugin E2E expectations.
  • Remote Testbox run: UI typecheck passed; focused failures found there are fixed in this branch.
  • Live before (current main, isolated Gateway behind a fault proxy, connection cut while drafting an automation): the draft disappears, the list shows "0 of 0", the page goes inert under the band. After (integrated build of this series, same scenario): the page stays interactive with no band, the draft is kept, Create is disabled with the bottom-left chip explaining why, and on reconnect the draft is still there.
Before (main, offline) After (offline)
before after

@clawsweeper

clawsweeper Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-17T15:18:07.309765Z 8e8b3f3 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui size: L labels Oct 16, 2026

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: af6f69be47

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

(!view().nativeEmbed && view().pageActionsBlocked) ||
(view().mobileNavLayout && view().navDrawerOpen)
}
inert={view().mobileNavLayout && view().navDrawerOpen}

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.

P2 Badge Keep channel setup gated while disconnected

When an authenticated admin's connection enters reconnecting or offline, the retained hello.auth keeps canAdmin true in channels-page.tsx, so the newly interactive page leaves Run Setup enabled. createChannelSetup then passes snapshot.client to the wizard without checking the live phase, and wizard.start immediately rejects with gateway not connected; therefore a brief disconnect now exposes a server-only workflow that can only fail. Gate this action on the live Gateway state before removing the shell fence.

AGENTS.md reference: ui/AGENTS.md:L15-L19

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 6a8c9c9: Setup actions now require a live Gateway connection while channel details remain browsable offline, with regression coverage for disconnect and recovery.

Comment thread ui/src/app/app-shell-view-state.ts Outdated
Comment on lines +118 to +122
const desktopPanelAvailable = canPresentGatewayMethod(
gatewaySnapshot,
"desktop.observe",
"operator.admin",
);

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.

P2 Badge Do not advertise an unusable offline Desktop command

With a retained handshake advertising desktop.observe, this presentation-only check keeps Desktop in the command palette during reconnect/offline. However, ShellPanelOwner.handleDeferredDesktopToggle still calls connected-only isDesktopPanelAvailable, prevents the event, and the palette closes, so selecting the visible command silently does nothing. Either keep this executable command live-only or render it disabled with an explicit reconnect outcome.

AGENTS.md reference: AGENTS.md:L79-L83

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 6a8c9c9: The Desktop command now uses the same live availability check as the panel opener so it cannot be selected while offline.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 16, 2026
@clawsweeper

clawsweeper Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR retains Gateway presentation metadata during disconnects and replaces page-wide interaction blocking with individual action guards.

Example: An administrator loses the Gateway connection for two seconds while viewing Automations.

  • Before: The handshake disappears and the page becomes inert under a reconnect notice.
  • After: Capabilities remain visible and local controls stay interactive while Gateway-backed submission is disabled.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The product direction is worthwhile, but concrete reconnect regressions and directly attributable test failures prevent a clean verdict.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🦪 silver shellfish (2/6) 6 actionable review findings remain.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Brief Gateway disconnects hide available capabilities and prevent users from reading or editing otherwise local page content.
Reason: The maintainer-authored direction addresses an observable current-main problem without adding configuration or public APIs.

Merge readiness

⛔ Needs changes before merge - 6 items remain

Keep open for focused repair: this maintainer-directed change is useful, but it introduces offline interaction regressions and leaves affected tests failing.

Priority: P2
Reviewed head: af6f69be47b745daa27bc4a0b7a4d58182986a13

Before merge

  • Preserve Cron drafts entered while reconnecting (P2) - Removing the outlet fence now lets an administrator open New task and enter an automation draft while reconnecting. When the same client reconnects, createGatewayConnectionLifecycle.transition returns true and cron-page-state.ts calls resetGatewayState, replacing the entire CronState and discarding that draft. The added test stops before reconnection and misses this loss. Preserve local editor state across same-identity transport recovery while still retiring requests and clearing state on identity changes.
  • Gate channel setup on the live Gateway connection (P2) - After an authenticated administrator disconnects, the retained auth keeps ChannelsProps.canAdmin true and the newly interactive Run Setup button enabled. createChannelSetup passes snapshot.client directly to wizard.start without checking the connection phase, so clicking it opens a workflow that immediately fails with 'gateway not connected'. Disable the server-backed setup action while disconnected while leaving local channel content usable.
  • Keep the Desktop palette command consistent with its dispatcher (P2) - With a retained admin handshake advertising desktop.observe, this presentation check keeps Desktop executable in the command palette while offline. On a non-session route such as Logs, ShellPanelOwner.handleDeferredDesktopToggle rejects it through connected-only isDesktopPanelAvailable, while the palette closes unconditionally. Selecting the visible command therefore silently does nothing. Keep this executable command live-only or expose an explicit disabled reconnect state.
  • Update the native embed test for the removed offline fence (P2) - The native embed offline-navigation test still waits for openclaw-router-outlet[inert] before exercising Back. This hunk intentionally removes that attribute during ordinary disconnects, so the test cannot reach its navigation assertions. Exact-head checks-ui-e2e (1/9) fails at native-embed-settings.e2e.test.ts:134 with that timeout. Wait for the disconnected Gateway state and retain the Back/navigation assertions.
  • Exercise Gateway replacement through its owner in the dock test (P2) - Removing the private Home cache leaves app-host.dock-suppression.test.ts changing gateway.connection.gatewayUrl directly while retaining the previous hello, then expecting Home to disappear. The replacement design relies on connect() clearing that hello, so this fixture no longer represents the production transition and exact-head CI fails at line 312. Update the fixture to publish the owner-cleared replacement state and retain coverage that another Gateway cannot inherit Home access.
  • Update the refresh failure test to the new message (P2) - The refresh-card test still requires 'Actions are unavailable while the Gateway reconnects.' after the current refresh attempt fails. This hunk replaces that output with the refresh-specific message, so exact-head checks-ui (2/3) fails at sidebar-update-card.test.tsx:458. Update both message assertions while preserving the stale-completion and retry-availability checks.

Findings

  • [P2] Preserve Cron drafts entered while reconnecting — ui/src/app/app-shell-view.tsx:321-323
  • [P2] Gate channel setup on the live Gateway connection — ui/src/app/app-shell-view.tsx:295
  • [P2] Keep the Desktop palette command consistent with its dispatcher — ui/src/app/app-shell-view-state.ts:118-122

Tests

  • Missing end-to-end proof: Supply inspected before/after captures of the built UI through a real Gateway disconnect and recovery, including draft survival; base-fail/head-pass regression execution is not shown.
Agent review details

How this fits together

The Control UI Gateway store publishes connection state and handshake metadata to navigation, panels, and pages; action owners use the live client to send Gateway requests.

flowchart LR
  A[Gateway transport] --> B[Gateway store]
  B --> C[Retained presentation metadata]
  C --> D[Navigation and page views]
  B --> E[Live connection checks]
  D --> F[Action owners]
  E --> F
  F --> G[Gateway RPC authorization]
Loading

Technical review

Best possible solution:

Retain presentation centrally while action owners enforce live connectivity and same-identity reconnects preserve editable drafts.

Do we have a high-confidence way to reproduce the issue?

Current-main source directly shows handshake clearing and page-wide disconnect fencing; the reported live before-state is consistent with those paths, but no reproduction was executed during this read-only review.

Is this the best way to solve the issue?

Separating presentation facts from live dispatch is appropriate, but removing the shared fence requires completing the affected action guards and preserving newly editable state across reconnect.

Full review comments:

  • [P2] Preserve Cron drafts entered while reconnecting — ui/src/app/app-shell-view.tsx:321-323
    Removing the outlet fence now lets an administrator open New task and enter an automation draft while reconnecting. When the same client reconnects, createGatewayConnectionLifecycle.transition returns true and cron-page-state.ts calls resetGatewayState, replacing the entire CronState and discarding that draft. The added test stops before reconnection and misses this loss. Preserve local editor state across same-identity transport recovery while still retiring requests and clearing state on identity changes.
    Confidence: 0.98
  • [P2] Gate channel setup on the live Gateway connection — ui/src/app/app-shell-view.tsx:295
    After an authenticated administrator disconnects, the retained auth keeps ChannelsProps.canAdmin true and the newly interactive Run Setup button enabled. createChannelSetup passes snapshot.client directly to wizard.start without checking the connection phase, so clicking it opens a workflow that immediately fails with 'gateway not connected'. Disable the server-backed setup action while disconnected while leaving local channel content usable.
    Confidence: 0.99
  • [P2] Keep the Desktop palette command consistent with its dispatcher — ui/src/app/app-shell-view-state.ts:118-122
    With a retained admin handshake advertising desktop.observe, this presentation check keeps Desktop executable in the command palette while offline. On a non-session route such as Logs, ShellPanelOwner.handleDeferredDesktopToggle rejects it through connected-only isDesktopPanelAvailable, while the palette closes unconditionally. Selecting the visible command therefore silently does nothing. Keep this executable command live-only or expose an explicit disabled reconnect state.
    Confidence: 0.99
  • [P2] Update the native embed test for the removed offline fence — ui/src/app/app-shell-view.tsx:322-323
    The native embed offline-navigation test still waits for openclaw-router-outlet[inert] before exercising Back. This hunk intentionally removes that attribute during ordinary disconnects, so the test cannot reach its navigation assertions. Exact-head checks-ui-e2e (1/9) fails at native-embed-settings.e2e.test.ts:134 with that timeout. Wait for the disconnected Gateway state and retain the Back/navigation assertions.
    Confidence: 1
  • [P2] Exercise Gateway replacement through its owner in the dock test — ui/src/app/panel-availability.ts:50-53
    Removing the private Home cache leaves app-host.dock-suppression.test.ts changing gateway.connection.gatewayUrl directly while retaining the previous hello, then expecting Home to disappear. The replacement design relies on connect() clearing that hello, so this fixture no longer represents the production transition and exact-head CI fails at line 312. Update the fixture to publish the owner-cleared replacement state and retain coverage that another Gateway cannot inherit Home access.
    Confidence: 1
  • [P2] Update the refresh failure test to the new message — ui/src/components/sidebar-update-card.tsx:401
    The refresh-card test still requires 'Actions are unavailable while the Gateway reconnects.' after the current refresh attempt fails. This hunk replaces that output with the refresh-specific message, so exact-head checks-ui (2/3) fails at sidebar-update-card.test.tsx:458. Update both message assertions while preserving the stale-completion and retry-availability checks.
    Confidence: 1

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 330ce7f06f38.

Provenance checked

  • Handshake and plugin capability retention changes intended behavior with a stated reason (b5134de: Plugin lifecycle work centralized capability publication and cleared disconnected capability state because a disconnected transport could not vouch for admission.)
  • Page-wide disconnect fencing and reconnect banner changes intended behavior with a stated reason (486b272: Prevent disconnected server actions from silently disappearing while keeping explicitly supported offline editors usable; later settings work refined the banner presentation.)
  • Home availability cache keeps the original intent (b86ea6c: Keep the Home dock available through same-Gateway reconnects while fencing Gateway changes and permission loss.)
  • Refresh-required detection keeps the original intent (12092aa: The update overlay treated a hello on a nonconnected client as evidence of build-skew fencing; retained hello metadata now requires distinguishing a new hello.)
  • Page presentation and individual mutation controls changes intended behavior with a stated reason (refactor(ui): render channels and automations with Solid 2 #168811: Solid migrations preserved existing page workflows and synchronous request owners; this PR deliberately changes disconnected presentation and adds action-level guards.)
  • Sidebar refresh failure message changes intended behavior with a stated reason (e80558a: The Solid sidebar migration carried forward the generic reconnect message; this PR replaces it with a refresh-specific failure and retry instruction.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test ui/src/pages/cron/cron-page.test.ts --maxWorkers=1
  • pnpm test ui/src/pages/channels/view.test.tsx --maxWorkers=1
  • pnpm test ui/src/app/app-host.dock-suppression.test.ts --maxWorkers=1
  • pnpm test ui/src/components/sidebar-update-card.test.tsx --maxWorkers=1
  • pnpm test:ui:e2e ui/src/e2e/native-embed-settings.e2e.test.ts --maxWorkers=1

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 9394889 adds ui/src/app/gateway-store.ts:142 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 9394889ffad1; files: ui/src/app/gateway-store.ts)
  • Patrick Erichsen: Raw commit b181d78 adds ui/src/styles/layout.css:286 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: b181d789837d; files: ui/src/styles/layout.css)

PR surface

Source -58, Tests +214, Docs +13. Total +169 across 28 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 16 87 145 -58
Tests 11 283 69 +214
Docs 1 13 0 +13
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 28 383 214 +169

Labels

Label changes:

  • add P2: This improves transient-disconnect usability, with focused defects in offline actions, automation drafting, and affected regression tests.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: This improves transient-disconnect usability, with focused defects in offline actions, automation drafting, and affected regression tests.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 16, 2026, 5:09 AM ET / 09:09 UTC.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a67b4c05d3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

eventSource,
fieldErrors,
canSubmit: !hasCronFormErrors(fieldErrors),
canSubmit: page.cron().connected && !hasCronFormErrors(fieldErrors),

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.

P2 Badge Gate every Cron mutation on connectivity

When an administrator disconnects after loading Cron, the retained handshake keeps canManageCron() true, but this change gates only form submission. Run now, pause/resume, and the job menu therefore remain enabled; their callbacks reach runCronAdminTask, after which withCronBusy returns immediately because state.connected is false, so the click has no visible outcome. Include the live connection in the mutation availability passed to all Cron controls, not only canSubmit.

AGENTS.md reference: AGENTS.md:L81-L81

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not changing: Cron clears its jobs and selected editor on disconnect, so the reported row actions are absent and offline create submission is already disabled.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 85cc7ad618

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

aria-disabled={
view().pageActionsBlocked || view().reloadRequired ? "true" : undefined
}
inert={view().reloadRequired}

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.

P2 Badge Disable Sessions refresh while disconnected

When an operator is viewing Sessions during reconnecting or offline, removing the shell fence leaves the Refresh button enabled (ui/src/pages/sessions/view.tsx:195), but its handler reaches refreshSessionList(), where captureRequestScope() returns null and the action silently returns (sessions-page-state.ts:531-534). Gate this server-backed control on live connectivity so it does not advertise an action that produces no outcome.

AGENTS.md reference: AGENTS.md:L79-L81

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 6a8c9c9: Sessions Refresh is disabled during reconnect and offline and becomes available again when connected.

Keep channel details browsable while disabling setup until reconnect. Align Desktop command visibility with its live panel opener, and disable Sessions refresh while disconnected. Cover retained handshakes and restored actions through page and shell regressions.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6a8c9c9b50

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

(!view().nativeEmbed && view().pageActionsBlocked) ||
(view().mobileNavLayout && view().navDrawerOpen)
}
inert={view().mobileNavLayout && view().navDrawerOpen}

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.

P2 Badge Gate channel-detail server actions on connectivity

When an admin has a channel detail open and the Gateway enters reconnecting or offline, removing this shell fence leaves several server-backed controls enabled: view.config.tsx gates Save/Reload only on loading and dirty state, while view.whatsapp.tsx gates login/logout/probe actions only on busy state. Their owners then return without dispatching because the channel/config capabilities are disconnected, so clicks produce no visible outcome; gate these channel-detail controls on the live connection while preserving local form edits.

AGENTS.md reference: AGENTS.md:L79-L81

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 33acceb58c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 315 to +317
<RouterOutlet
inert={view().pageActionsBlocked || view().reloadRequired}
aria-disabled={
view().pageActionsBlocked || view().reloadRequired ? "true" : undefined
}
inert={view().reloadRequired}
aria-disabled={view().reloadRequired ? "true" : undefined}

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.

P2 Badge Disable Agents file refresh while disconnected

When an authenticated operator loses the Gateway connection while the Agents Files panel is open, removing the outlet fence leaves its Refresh action enabled: panels-files.tsx:149-153 disables it only while loading, but loadAgentFiles() immediately returns when state.connected is false (agents-page-state.ts:588-593). The click therefore has no visible outcome; pass connectivity into this control and disable it offline while keeping the existing file draft readable and editable.

AGENTS.md reference: AGENTS.md:L79-L81

Useful? React with 👍 / 👎.

@steipete steipete changed the title fix(ui): keep the app present and usable through brief Gateway disconnects fix(ui): keep Gateway presentation through reconnects Oct 17, 2026
Keep pending search autofocus when catalog arrival mounts the input after the opening frame, without stealing newer user focus. Add coverage for open, closed, removed, and focus-moved pickers.

Join catalog-dependent browser assertions to admitted requests and rendered or enabled controls. Drain a distinct initial catalog response before measuring steady-state rendering, and target keyboard remediation without an unrelated global Tab. Retain all outcome assertions and performance budgets.

Proof: 11 picker unit tests and 47 focused E2E cases across eight files passed, with the corrected thinking and budget files rerun together. Formatting, whitespace checks, and focused follow-up review passed.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 344435e02e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

(!view().nativeEmbed && view().pageActionsBlocked) ||
(view().mobileNavLayout && view().navDrawerOpen)
}
inert={view().mobileNavLayout && view().navDrawerOpen}

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.

P2 Badge Disable standing-grant revocation while offline

When an operator disconnects after loading Approvals, applyGatewaySnapshot() preserves the loaded grants through resetHistory(false), so removing the shell fence leaves each Revoke button enabled. Clicking it cannot have an effect because revokeGrant() returns when isCurrentRequest() sees state.connected === false; disable this server-backed action while disconnected rather than presenting a silent no-op.

AGENTS.md reference: AGENTS.md:L82-L82

Useful? React with 👍 / 👎.

aria-disabled={
view().pageActionsBlocked || view().reloadRequired ? "true" : undefined
}
inert={view().reloadRequired}

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.

P2 Badge Disable manual RPC calls while offline

On the Debug route during reconnect or offline, the retained handshake keeps the RPC method list visible and the Call button remains enabled, but callDebugMethod() immediately returns when lifecycle.capture() cannot obtain a live connection. Gate the Call control on the existing connected prop so clicking it does not silently do nothing.

AGENTS.md reference: AGENTS.md:L82-L82

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9cbafbbb52

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

aria-disabled={
view().pageActionsBlocked || view().reloadRequired ? "true" : undefined
}
inert={view().reloadRequired}

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.

P2 Badge Disable Agents refresh while disconnected

When an operator remains on the Agents route during reconnecting or offline, making the outlet interactive leaves the roster Refresh button enabled (ui/src/pages/agents/view.tsx:199-205). Its handler reaches refreshAgents(), but context.agents.refreshList() short-circuits while the capability is disconnected and the subsequent request-scope check also fails, so the click produces no update or error. Gate this control on the live connection before exposing the route offline.

AGENTS.md reference: AGENTS.md:L80-L82

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8e8b3f3366

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

aria-disabled={
view().pageActionsBlocked || view().reloadRequired ? "true" : undefined
}
inert={view().reloadRequired}

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.

P2 Badge Disable Usage refresh while disconnected

When an operator remains on Usage during reconnect or offline, making the outlet interactive leaves the retained page's Refresh button enabled (ui/src/pages/usage/view.tsx:319-325). Its callback reaches loadUsage(), which only marks the load deferred and returns a resolved promise when gateway.connected is false (usage-page-state.ts:409-414), so the advertised action silently does nothing. Pass live connectivity into the Usage view and disable server-backed refresh while offline.

AGENTS.md reference: AGENTS.md:L82-L82

Useful? React with 👍 / 👎.

(!view().nativeEmbed && view().pageActionsBlocked) ||
(view().mobileNavLayout && view().navDrawerOpen)
}
inert={view().mobileNavLayout && view().navDrawerOpen}

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.

P2 Badge Disable Model Providers refresh while disconnected

When Model Providers is open during a same-Gateway disconnect, the controller deliberately preserves its visible data, but removing the shell fence leaves both Refresh/Retry buttons enabled because they only check core.loading (ui/src/pages/model-providers/view.tsx:581-594,647-660). The handler then reaches refresh(), which only records a deferred load and returns while disconnected, producing no visible outcome; gate these controls on the existing connected prop.

AGENTS.md reference: AGENTS.md:L82-L82

Useful? React with 👍 / 👎.

@steipete
steipete merged commit 98d893a into main Oct 17, 2026
92 checks passed
@steipete
steipete deleted the steipete/offline-retain branch October 17, 2026 16:10
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 18, 2026
* fix(ui): retain presentation through gateway disconnects

* fix(ui): clear retained presentation on any connect rejection

* test(ui): check persistent navigation rail during reconnect

* test(ui): align offline expectations with retained presentation

* test(ui): avoid sidebar helper shadowing after main merge

* fix(ui): gate offline actions on live Gateway availability

Keep channel details browsable while disabling setup until reconnect. Align Desktop command visibility with its live panel opener, and disable Sessions refresh while disconnected. Cover retained handshakes and restored actions through page and shell regressions.

* fix(ui): preserve model picker focus during catalog startup

Keep pending search autofocus when catalog arrival mounts the input after the opening frame, without stealing newer user focus. Add coverage for open, closed, removed, and focus-moved pickers.

Join catalog-dependent browser assertions to admitted requests and rendered or enabled controls. Drain a distinct initial catalog response before measuring steady-state rendering, and target keyboard remediation without an unrelated global Tab. Retain all outcome assertions and performance budgets.

Proof: 11 picker unit tests and 47 focused E2E cases across eight files passed, with the corrected thinking and budget files rerun together. Formatting, whitespace checks, and focused follow-up review passed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: L status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant