Repository navigation
feat(ui): add reactive OpenClaw health nudges - #110708
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 56592bd652
ℹ️ 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".
| const CHANNEL_AUTH_STATUS_KEYS = [ | ||
| "tokenStatus", | ||
| "botTokenStatus", | ||
| "appTokenStatus", | ||
| "signingSecretStatus", | ||
| "userTokenStatus", | ||
| ] as const; |
There was a problem hiding this comment.
Include API credential status in auth nudges
When a Nextcloud Talk account has its bot secret available but apiPasswordFile is unreadable, the health snapshot carries apiCredentialStatus: "configured_unavailable" from extensions/nextcloud-talk/src/accounts.ts, and the probe skips with ok: true when API credentials cannot resolve in extensions/nextcloud-talk/src/bot-preflight.ts. Because this allowlist only checks token/bot/app/signing/user credential keys, classifyCustodianEventNudge treats that configured channel as healthy and never shows the promised unavailable-credentials nudge; include apiCredentialStatus or scan *Status credential fields for configured_unavailable.
Useful? React with 👍 / 👎.
56592bd to
7f58fb8
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7f58fb859c
ℹ️ 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".
| private readonly eventSubscriptions = new SubscriptionsController(this).effect( | ||
| () => this.context?.gateway, | ||
| (gateway) => | ||
| gateway.subscribeEvents((event) => { |
There was a problem hiding this comment.
Process cached hello health snapshots
When the OpenClaw page is opened after the Gateway has already cached a bad health snapshot, this subscription only sees future health events. The Gateway includes the current cached health in the hello snapshot (connect-hello.ts fills snapshot.health from getHealthCache()), and the UI stores that hello, but no event is replayed for it; the next broadcast comes from the 60s maintenance refresh. In that common case the promised event chip stays absent for up to a minute even though the page already has the failing snapshot available.
Useful? React with 👍 / 👎.
7f58fb8 to
50f5e1c
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 50f5e1c633
ℹ️ 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".
| ${!this.onboarding && this.eventNudge | ||
| ? html`<div class="custodian__nudge" role="status"> |
There was a problem hiding this comment.
Keep the nudge visible in scrolled conversations
When the custodian transcript is long enough for .custodian__messages to scroll (ui/src/styles/custodian.css:57-63), this renders the chip as the first child while updated() only scrolls on messages changes. A health event that arrives while the user is at the bottom sets eventNudge without changing messages, so the new chip is inserted above the viewport and the operator sees no prompt; render it outside/sticky or after the transcript.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: abc64d8732
ℹ️ 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".
| @@ -128,6 +145,7 @@ export class CustodianPage extends OpenClawLightDomElement { | |||
| if (scopeChanged) { | |||
| this.sessionScopeKey = scopeKey; | |||
| this.sessionStarted = false; | |||
| this.eventNudge = null; | |||
There was a problem hiding this comment.
Reset nudge dismissal when the gateway scope changes
When an operator dismisses or uses a nudge and the same mounted custodian page then switches Gateway URL/credentials/device token, this branch clears only the pending chip while leaving eventNudgeClosed true; the event subscription then returns before classifying every future health event. Because this same scope-change path already treats the new connection as a different operator/server and clears the transcript, the new scope silently inherits the old dismissal and will not see any health nudges until the page is reloaded or remounted.
Useful? React with 👍 / 👎.
abc64d8 to
dea5b1b
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dea5b1b076
ℹ️ 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".
| message: `what happened with ${canonical}?`, | ||
| }; | ||
| } | ||
| if (account.connected === false && account.running === true) { |
There was a problem hiding this comment.
Honor channel startup grace before nudging
When a channel has just started but has not connected within the first 120s grace window, evaluateChannelHealth returns healthy startup-connect-grace (src/gateway/channel-health-policy.ts:109-112), so getHealthSnapshot leaves healthState unset (src/commands/health.ts:674-681) while still carrying running: true/connected: false. This branch treats that normal startup snapshot as a disconnect nudge, so opening the custodian during a channel startup/restart prompts the operator to diagnose a healthy channel; gate this on a reported failure state or mirror the startup-grace check.
Useful? React with 👍 / 👎.
|
Landing verification at exact head
Known scoped stop: channel summon/agent-down fallback did not ship because the work order's depth gate triggered; the PR body records the cancellation prerequisite and bounded follow-up proposal. |
|
Merged via squash.
|
* feat(ui): add reactive custodian health nudges * fix(ui): distinguish stopped channels from startup failures * test(ui): update custodian route gateway fixture * fix(ui): preserve current channel health failures * fix(ui): ignore recovered channel errors
* feat(ui): add reactive custodian health nudges * fix(ui): distinguish stopped channels from startup failures * test(ui): update custodian route gateway fixture * fix(ui): preserve current channel health failures * fix(ui): ignore recovered channel errors



What Problem This Solves
The permanent OpenClaw custodian page was passive when a consequential system problem arrived. Operators had to notice the failure elsewhere and manually decide what to ask, while routine Gateway traffic made a broad reactive assistant too noisy.
Why This Change Was Made
This adds one restrained, dismissible nudge per normal custodian-page visit. Only consequential
healthsnapshots qualify: configuration hot-reload disabled, configured/enabled channel credentials unavailable, explicit channel errors or failed probes, terminal disconnects, active channel disconnects, and the concrete degraded lifecycle statesdisconnected,stale-socket, andstuck. Routine events such asconfig.changed, disabled accounts, and intentionally stopped channels remain silent. Higher-severity failures may replace a pending chip; dismissal or use silences the visit. Gateway identity changes clear a pending chip so it cannot cross operators or servers.Clicking the chip sends a canonical diagnosis question through the existing
openclaw.chatpath and records it as a real user transcript message. Onboarding mode never subscribes visibly to these nudges.AI-assisted by Codex. No changelog edit per the phase work order.
Phase 6 server study / bounded follow-up proposal
The server deliverable was studied but intentionally stopped at the work order's depth gate:
/openclawhandling already enterssrc/auto-reply/reply/commands-system-agent.ts; existing commands use deterministic rescue viasrc/system-agent/rescue-message.ts./openclaw ask <request>can be routed there toopenclaw.chatwith the existing host-owned delegation fields fromsrc/gateway/server-methods/system-agent.ts, and the normal reply pipeline preserves the source thread.src/auto-reply/reply/agent-runner-error-handler.ts.openclaw.chatinference. TodaySystemAgentChatEngine.handleand the system-agent turn runner do not own anAbortSignal; merely racing the Gateway promise leaves inference running and can mutate a stable delegation session after the source turn was stopped.Proposed follow-up: add turn-owned cancellation from
openclaw.chatthrough the system-agent session queue,SystemAgentChatEngine.handle, and the embedded/CLI system-agent turn. Then add/openclaw ask <request>with source delegation, and invoke one disposable/cancellable diagnosis from the final generic channel failure. The returned copy must direct the user to the routable command, for exampleAsk me to fix it with /openclaw ask fix it, and reserved system-agent IDs must bypass the fallback to prevent loops.User Impact
Operators can notice one meaningful health incident while already talking to OpenClaw and ask for diagnosis with one click, without fake assistant transcript content or recurring Clippy-style prompts.
Evidence
node scripts/run-vitest.mjs ui/src/pages/custodian/custodian-page.test.ts— 27 passed.openclaw.chatrequest; routine events and onboarding stay silent — 2 passed.pnpm tsgo,pnpm tsgo:ui,pnpm check:test-types, targeted oxlint,pnpm deadcode:exports(0), i18n baseline/verify, docs MDX, format check, andgit diff --checkall passed. Testbox hydration run.