Skip to content

fix(ui): keep settings drafts and data through reconnects - #174045

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

steipete merged 12 commits into
mainfrom
steipete/offline-drafts-settings

Conversation

@steipete

@steipete steipete commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: unsaved Settings edits disappear when the Gateway connection blips.

Several Settings pages treated an ordinary reconnect of the same client as an identity change and reset their state: Model Providers dropped default-model drafts, key editors, entered keys and login flows; Plugins closed credential editors and cleared details; Devices discarded unsaved execution-approval policy edits; Skills reset library editor content; Profile reset the display-name draft and account-linking flow; GitHub identity, Session Storage, Channels (Nostr drafts) and Cloud Worker pool/policy drafts reset too, and Channels claimed nothing was connected. Model default drafts and profile-order intent were also cleared after a failed or never-dispatched save. Config autosave paused after any disconnect until an explicit Save, even when nothing was in flight.

User Impact

User impact: you can keep editing Settings through a spotty connection; your drafts and the last loaded data stay put, saves are disabled only while disconnected, and autosave resumes on its own after a clean reconnect.

Why This Change Was Made

Request-generation fencing is unchanged (old-epoch results are still discarded); only drafts and presented data now outlive a same-identity transport edge. A different client, Gateway or account still resets everything, and typed secrets stay in memory only. Model default drafts and profile-order intent clear only on acknowledged success. The config write coordinator resumes autosave after reconnect only when no submission was in flight and the base revision is unchanged; uncertain submissions and changed bases keep the existing pause and explicit recovery.

Part of the offline-first series.

Evidence

  • Per-page regression tests: drafts and data survive a same-client disconnect/reconnect and reset on identity change (Model Providers, Plugins credential editor, Devices, Skills, Profile and model accounts, GitHub identity, Session Storage, Channels, Cloud Workers); config autosave resume and pause branches.
  • Remote Testbox run found a type error, two lint violations and two test expectation issues; all fixed in this branch.
  • Access revocation: a late response from a request started before operator.admin/read access was revoked can no longer republish restricted data (Cloud Workers environments/images/editor, Models, Plugins, Channels plugin presentation, config writes, Profile, GitHub identity before identity readiness).
  • Scope note: Memory search moved into the memory-core plugin on main while this PR was open; its retention was dropped here because the plugin settings-view host owns that lifetime (it remounts on reconnect). Follow-up: let plugin settings views survive a same-identity reconnect.

Landing validation

The current head merges main through 45c6db39b27. The Skills conflict keeps main's shared createPageRequest owner while retaining drafts and loaded results and canceling pending reads on reconnect or access loss. Six focused files passed all 51 tests; formatting and whitespace checks passed; independent Codex autoreview was scoped-clean. The offline guide no longer promises memory-search retention, which remains the plugin-host follow-up described above.

CI run 39062011444 has one inherited failure: check-lint-core-2 reports typescript(await-thenable) at src/infra/sqlite-readonly-location.worker.ts:381. Main commit f15018960a1 removed the async state-snapshot operation from the read-only registry but retained the worker's await on its now-synchronous dispatch. The exact tested merge 10611c2417375c451c05e53e5a54d95b321ec082 has main parent d91ee6e97b7d42fe80c42d16f98c60788824e4c2; the failing source, registry, operation contracts, lint configuration, and dependencies are byte-identical to that parent. This PR changes only UI/docs. The CI classification used an older main run from before that removal. Scheduled main CI run 39062485709 independently reproduces the identical diagnostic in check-lint-core-4; main and this PR assign src/infra to different lint stripe numbers. Every other job in the PR run completed successfully or was normally skipped, including successful security-fast. This failure is recorded for the native inherited-failure landing path; CI remains failed. No checks were rerun or assertions weakened.

@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-17T19:25:13.448998Z e4c969c 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: XL 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: dbe9c9279d

ℹ️ 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 +61 to +65
onIdentityChange: () => {
setView((state) => {
state.editor = null;
state.draft = createCloudWorkerDraft();
});

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 Clear cloud-worker drafts when admin access is lost

When a connected snapshot on the same GatewayBrowserClient drops operator.admin, onIdentityChange does not run because GatewayPageBinding defines identity changes only as source/client replacement. The editor therefore remains open with its unsaved setup/setupEnv draft visible after the current account no longer has permission; unlike the adjacent cloud-worker owners, this page has no onSnapshot access-loss reset. Clear the editor and draft when a fresh connected snapshot fails the config.patch admin check.

AGENTS.md reference: ui/AGENTS.md:L17-L18

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 3b9145f: Confirmed admin revocation now clears the machine profile editor and private setup drafts and retires pending catalog work.

@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. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. 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 real behavior proof before merge.

What this changes

This PR preserves Settings drafts and loaded data across same-client reconnects and conditionally resumes unsent configuration autosaves.

Example: Enter an unsaved device execution policy with security set to allowlist, then briefly disconnect the Gateway.

  • Before: The reconnect clears the policy draft.
  • After: The draft remains visible, and Save stays unavailable until reconnection.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The repair is valuable, but an introduced wizard defect and missing required authority evidence prevent a pass.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🦪 silver shellfish (2/6) Security review found an item that needs attention.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Partial
User problem: Brief Gateway disconnects discard unsaved Settings edits and temporarily remove already loaded information.
Reason: The maintainer-authored direction restores useful editing continuity, but the active Models sign-in wizard still lacks the required offline submission state.

Merge readiness

⛔ Blocked before merge - 7 items remain

Keep this PR open: it addresses draft loss still present on main, but retaining the Models sign-in wizard introduces an enabled submission button that silently does nothing while disconnected.

Priority: P2
Reviewed head: dbe9c9279d7bb59b235591dc2aff0ebc69cc306f

Before merge

  • Add real behavior proof - Authority-chain proof required: supplied tests use mocked Gateway requests and provide no production-transport trace showing that retained device confirmations and resumed configuration autosaves succeed for the authorized principal but perform no final mutation after revocation or reassignment; redact credentials and private endpoints from supplied evidence. After adding proof, update the PR body, then request a new review with @clawsweeper re-review. The PR author or someone with repository write access can request it.
  • Disable submission in the retained Models wizard while offline (P2) - Start a provider sign-in and reach an idle text or confirmation step, then disconnect the same client. This branch now retains the login wizard, but login-controller.ts supplies only mutationActive as its busy state, and WizardStepControls disables Continue only for busy. Continue therefore remains enabled; clicking it reaches run(), whose canContinue guard returns immediately while disconnected, producing neither a request nor feedback. Carry live submission availability into the retained wizard so the button is unavailable until recovery without clearing the entered value.
  • Resolve security review attention item - Retained mutation intent needs final-effect authorization evidence; no concrete authorization bypass or supply-chain regression was established.
  • Resolve merge risk - Before merge, establish that retained device confirmations and resumed autosaves cannot authorize mutations after permission revocation or principal reassignment across reconnect.
  • Complete next step - Resolve the reported merge conflict while preserving main's Models Solid factory cutover.
  • Improve patch quality - Add final-effect proof for revoked pairing/admin permissions and principal reassignment across reconnect, alongside an authorized control.
  • Add data-model compatibility proof - The review found that existing stored data may not work after upgrade. Show that existing data still loads and works with this change.

Findings

  • [P2] Disable submission in the retained Models wizard while offline — ui/src/pages/model-providers/model-providers-controller.ts:141-143

Tests

  • Missing end-to-end proof: Missing evidence covers an active Models wizard through disconnect/reconnect, final-effect authorization controls, and fresh-install/latest-stable upgrade preservation; a failing-base/passing-head regression run is not supplied.
Agent review details

How this fits together

Settings pages consume Gateway snapshots and configuration projections, retain local presentation state, and submit authorized mutations through existing Gateway RPC owners.

flowchart LR
  A[Settings input] --> B[Page draft owner]
  C[Gateway connection snapshots] --> B
  C --> D[Request and authorization guards]
  B --> D
  D --> E[Gateway RPC]
  E --> F[Authoritative configuration and accounts]
Loading

Technical review

Best possible solution:

Preserve drafts at their existing owners while keeping submission availability, current authorization, request retirement, and configuration revision checks explicit.

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

Source shows both main's reconnect resets and the introduced enabled-but-inert wizard submission path; no runtime reproduction was executed.

Is this the best way to solve the issue?

Separating presentation retention from request lifetimes is the right approach and reuses the existing page, configuration, and Gateway owners.

Full review comments:

  • [P2] Disable submission in the retained Models wizard while offline — ui/src/pages/model-providers/model-providers-controller.ts:141-143
    Start a provider sign-in and reach an idle text or confirmation step, then disconnect the same client. This branch now retains the login wizard, but login-controller.ts supplies only mutationActive as its busy state, and WizardStepControls disables Continue only for busy. Continue therefore remains enabled; clicking it reaches run(), whose canContinue guard returns immediately while disconnected, producing neither a request nor feedback. Carry live submission availability into the retained wizard so the button is unavailable until recovery without clearing the entered value.
    Confidence: 0.98
    Late finding: first raised on code an earlier review cycle already covered.

Overall correctness: patch is incorrect
Overall confidence: 0.94

AGENTS.md: found and applied where relevant.

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

Merge-risk options

Maintainer options:

  1. Prove authorization at the final mutation boundary (recommended)
    Exercise retained confirmations and autosave through the production transport with allowed, revoked, and reassigned principals, recording which mutations reach the final effect.

Provenance checked

Testing

Proof path: unit tests only.

Security

Needs attention: Retained mutation intent needs final-effect authorization evidence; no concrete authorization bypass or supply-chain regression was established.

Evidence

What I checked:

  • Current-main defect remains: Pinned main still resets Models connection state on same-client transport changes and pauses retained configuration drafts until explicit submission. (ui/src/pages/model-providers/model-providers-controller.ts:169, 330ce7f06f38)
  • Introduced wizard submission defect: The reconnect branch now preserves login state; wizardViewProps supplies only mutationActive as busy, while the wizard submit button checks busy alone and run returns immediately when canContinue is false. (ui/src/pages/model-providers/model-providers-controller.ts:142, dbe9c9279d7b)
  • Authority-bearing intent survives reconnect: Device confirmations no longer require their original request generation, and configuration autosave can bind retained intent to the new connection epoch after an unchanged-base read; immediate live guards remain in source. (ui/src/pages/devices/devices-dialogs.ts:182, dbe9c9279d7b)
  • Recorded original safety rationale: The earlier autosave repair deliberately required explicit recovery to avoid sending drafts to a replacement Gateway; this PR narrows automatic recovery to the same client with an unchanged revision. (ui/src/lib/config/config-write-coordinator.ts:435, dbe9c9279d7b)
  • Existing review concern checked against the base: The existing Cloud Worker review comment describes an access-loss reset missing from both the original and changed page, so it is not counted as an introduced defect. (ui/src/pages/cloud-workers/cloud-workers-page.tsx:58, 8f44c97a1e5e)
  • Merge and validation state: GitHub reports the reviewed head as conflicting with main; the CI gate is pending, and the cancelled auto-response job establishes no diff-caused validation failure. (dbe9c9279d7b)

Likely related people:

  • Peter Steinberger: Raw commit a3210ac adds ui/src/lib/config/config-write-coordinator.ts:166 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: a3210acd3db8; files: ui/src/lib/config/config-write-coordinator.ts)
  • Ayaan Zaidi: Raw commit 274df5b adds ui/src/lib/config/config-write-coordinator.ts:166 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 274df5be0729; files: ui/src/lib/config/config-write-coordinator.ts)
  • Sebastien Tardif: Raw commit 6768452 adds ui/src/lib/config/config-write-coordinator.ts:167 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 676845210acb; files: ui/src/lib/config/config-write-coordinator.ts)

PR surface

Source +476, Tests +952, Docs +15. Total +1443 across 77 files. Added test files: 3.

View PR surface stats
Area Files Added Removed Net
Source 52 868 392 +476
Tests 24 1239 287 +952
Docs 1 15 0 +15
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 77 2122 679 +1443

Review metrics

Metric Value Why it matters
Production versus test changes Production +868/-392; tests and fixtures +1239/-287 The production growth separates presentation resets from request invalidation across existing page owners; test changes include relocated coverage.

Labels

Label changes:

  • add P2: Preserving Settings drafts has clear user value, and the introduced offline wizard submission defect has a limited, recoverable blast radius.
  • add merge-risk: 🚨 security-boundary: Confirmation intent and automatic configuration submission now survive transport-session replacement, requiring proof that current authorization still controls the final effect.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Label justifications:

  • P2: Preserving Settings drafts has clear user value, and the introduced offline wizard submission defect has a limited, recoverable blast radius.
  • merge-risk: 🚨 security-boundary: Confirmation intent and automatic configuration submission now survive transport-session replacement, requiring proof that current authorization still controls the final effect.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

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:11 AM ET / 09:11 UTC.

@openclaw-barnacle openclaw-barnacle Bot reopened this Oct 16, 2026
Keep same-client Settings drafts and loaded views through transient disconnects while fencing old requests and requiring live authority for submissions. Retire defaults and profile-order intent only after acknowledged success, and resume unsent config autosave only after an unchanged-base refresh.
@steipete
steipete force-pushed the steipete/offline-drafts-settings branch from dbe9c92 to f6c1702 Compare October 16, 2026 09:46

@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: f6c170296a

ℹ️ 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 +140 to +146
if (change.snapshot.phase === "connected") {
const auth = change.snapshot.hello?.auth;
const allowed = auth?.scopes !== undefined && hasOperatorAdminAccess(auth);
if (profilesVisible && !allowed) {
resetConnectionState();
}
profilesVisible = allowed;

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 Reload model providers when admin access returns

When an already-connected client regains operator.admin after previously losing it, this sets profilesVisible back to true but does not restart the core provider load that resetConnectionState() cleared on access loss. Because GatewayPageBinding only invokes ensureInitialData for connection or identity changes, the page remains indefinitely in its empty loading state until another unrelated refresh occurs. Trigger the replacement refresh when allowed transitions from false to true.

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

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: Model Providers reloads through the existing route loader on navigation or the page Refresh action, so an additional grant change reload is outside this retention fix.

Comment on lines +136 to +143
if (!nextAccess[0]) {
resetLoadedSkillState();
} else {
if (!nextAccess[1]) {
library.reset();
}
if (!nextAccess[2]) {
data.skillEdits = {};

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 Reload Skills data when read access returns

When a connected snapshot regains operator.read, this branch invalidates requests but never calls ensureInitialData, loadSkills, or library.load. The preceding access-loss transition cleared the report and library, and GatewayPageBinding does not run its initial-data callback for a same-client permission-only update, so the Skills page stays empty until navigation or another unrelated event causes a load. Start the reads when nextAccess[0] transitions back to true.

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

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: Skills already reloads its report and library through Refresh or the next navigation, so immediate permission return reload is unnecessary.

@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: b0511efeea

ℹ️ 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 +319 to +322
if ((canRead && !nextRead) || (canAdmin && !nextAdmin) || (canManagePairing && !nextPairing)) {
gatewayBinding.invalidate();
invalidateRequests();
}

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 Reload Devices data when privileges return

When a connected same-client snapshot restores operator.read, pairing, or admin privileges, this only updates the access booleans. The corresponding loss path has already cleared nodes/presence, devicesList, and execution approvals, while neither GatewayPageBinding nor handleGatewaySnapshot calls ensureInitialData for an auth-only update. Pairing and node data therefore remain absent until polling, and execution approvals remain empty until manually loaded. Trigger the appropriate refreshes on false-to-true access transitions.

AGENTS.md reference: ui/AGENTS.md:L17-L18

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: Devices reloads inventory through polling or navigation and exposes Load for execution approvals, so an additional permission return reload is unnecessary.

Comment on lines 207 to 208
if (becameConnected || (identityChanged && !mutationOwnsIdentityChange)) {
queueVerification();

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 Reverify GitHub identities when access returns

When a connected account regains read/admin access without reconnecting, the preceding loss transition has cleared status, personal, and system, but this condition does not call queueVerification() because becameConnected and identityChanged are both false. Although the capability and client revision changed, the GitHub connection UI remains unloaded until another reconnect or identity change; include the access-restored transition in the verification condition.

AGENTS.md reference: ui/AGENTS.md:L17-L18

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: Profile connections reverify on access snapshots and the agent Tools panel rechecks on its next navigation or refresh, so hidden panel reloads are unnecessary.

Comment thread ui/src/pages/plugins/plugins-page.ts Outdated
Comment on lines +315 to +319
const allowed = hasOperatorAdminAccess(snapshot.hello?.auth ?? null);
if (this.adminAccess && !allowed) {
this.invalidateRequests(false);
}
this.adminAccess = allowed;

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 Restore selected plugin details when admin access returns

On a same-client admin-access loss, this branch calls invalidateRequests(false), which retires state.detail; when admin access later changes from false to true, the branch only records the boolean. Because access changes are absent from shouldRefreshAfterChange, ensureInitialData() does not call showDetails(), and unchanged route data is not reapplied, so a deep-linked plugin page falls back to the inventory and stays there until navigation or manual retry. Reload the active detail on access restoration.

AGENTS.md reference: ui/AGENTS.md:L17-L18

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: The selected plugin detail reloads through route navigation and catalog refresh completion, so an additional grant change reload is unnecessary.

Comment on lines +103 to +109
onSnapshot: ({ snapshot }) => {
if (
snapshot.phase === "connected" &&
!canCallGatewayMethod(snapshot, "environments.list", "operator.admin")
) {
clearPresentation();
}

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 Reload cloud-worker environments when admin access returns

When the Gateway advertises environments.list but not the optional crabbox.images.list method, losing admin access clears the environment inventory here, but regaining access on the same connected client does not call load(). GatewayPageBinding does not rerun initial loading for an auth-only update, and the nearby effect continues to see canCall("crabbox.images.list") === false on both sides, so the page remains empty until focus or another unrelated refresh. Detect the false-to-true environment access transition directly.

AGENTS.md reference: ui/AGENTS.md:L17-L18

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: Environments reloads through the existing page activation handler even without the optional images method, and the regression now proves recovery through that path.

@openclaw-barnacle openclaw-barnacle Bot reopened this 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: 28a4a5f238

ℹ️ 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 +102 to +108
onSnapshot: ({ snapshot }) => {
if (
snapshot.phase === "connected" &&
!canCallGatewayMethod(snapshot, "environments.list", "operator.admin")
) {
clearPresentation();
}

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.

P1 Badge Invalidate environment loads when admin access is lost

When operator.admin is revoked while environments.list is in flight on the same client, this branch clears the displayed data but does not invalidate the GatewayPageBinding scope or cancel activeLoad. An authorization-only snapshot leaves the connection epoch unchanged, so the response still passes gateway.isCurrent(scope) and republishes the restricted inventory after it was cleared. Invalidate or cancel the request as part of this access-loss path so an older authorized response cannot restore the data.

AGENTS.md reference: ui/AGENTS.md:L17-L18

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 3b9145f: Confirmed admin revocation now invalidates the existing Gateway request scope and retires the active environment load before clearing inventory, preventing late environment and image responses from restoring restricted data.

This was referenced Oct 19, 2026
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 merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant