Skip to content

fix: confirm recovered config edits while the Gateway is busy - #207918

Merged
daniel-lxs merged 2 commits into
mainfrom
openclaw/config-confirm-2s-timeout-88d837
Nov 29, 2026
Merged

daniel-lxs merged 2 commits into
mainfrom
openclaw/config-confirm-2s-timeout-88d837

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #196174. The shard 34 failure surfaced on #207713; this is a separate fix, not a change to that PR.

What Problem This Solves

openclaw config set can exit 1 and tell the operator to reapply a change that the Gateway has already recovered and applied. I reproduced this on a busy SQLite-backed Gateway after the first apply failed.

User Impact

The running Gateway reads its own plugin install ledger through its existing shared-state reader, leaving time for the CLI to confirm the exact saved revision. The CLI still sends the write only once, stops confirming after two seconds, and returns the original error if the revision stays inactive. No setting or migration is required.

Why This Change Was Made

#202714 deliberately bounded confirmation after the write RPC releases admission. Reading current ledger rows before the first reload checkpoint is also deliberate: a plugin may be removed without a corresponding change to the config bytes (#149910). The unnecessary work was starting and retiring an inspector process to read a ledger the Gateway already owns. No row cache was added. External and sealed inspections keep their existing path, including the process exit that releases maintenance custody (#189722, #202608).

The recovery test already supplies its own file observation (#203117). It now holds back competing native notifications during that case so the write consumes the injected failure before the retry. Without this ordering, the faster reader could produce ordinary success without exercising CLI confirmation. The deadline, exit-code, output, saved/applied revision, and persistent-failure assertions are unchanged.

Evidence

I ran the real CLI process test against an isolated Gateway on CrabBox AWS, with 16 CPU competitors on four cores. The first apply failure was injected; the save, ledger read, watcher retry, RPC, and CLI were real.

Comparison Main 2f2edbf Fix 1667a8c
Original unchanged process test 3/3 failed under contention; unloaded control passed
Interleaved trials, identical final fixture 2/2 failed at the exit-code assertion 3/3 passed
Instrumented pair, retry ledger read 1,400.2 ms; CLI exit 1 6.2 ms; CLI exit 0

The saved and applied hashes matched on both sides of the timed pair. All 19 CLI process cases passed on the fix, including a permanently inactive revision still returning exit 1. In the fresh-row regression and controls, two committed values caused two startup inspections on main and zero on the fix; the reader observed both new values without main-thread SQL. The 9 plugin metadata tests, 11 SQLite worker-operation tests, core typecheck, and touched-file lint and formatting passed. I verified both leases were released.

Not verified: the full hosted shard, the original PostgreSQL exception, or the full suite. Local autoreview stopped before review because its isolation preflight requires a temporary directory outside the checkout; no clean review is claimed.

Captured CLI output

Terminal replays of the instrumented AWS pair. The last two lines show the process exit and the Gateway revision comparison.

Main: exit 1 Fix: exit 0
Main CLI output Fixed CLI output

Worked on by:

Work sessions

Linked for team reference; these sessions aren’t public.

Worked on by

🦞 Made with OpenClaw

roboclaw-bot and others added 2 commits November 29, 2026 02:18
…ctor

Read live plugin metadata through the shared-state worker when this Gateway owns the database. Keep external and sealed inspections isolated and leave the CLI confirmation deadline and revision checks intact.

Co-authored-by: daniel-lxs <[email protected]>
Worked on by:
- @daniel-lxs

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: 58ab85e4-f064-4888-9c5e-314957a86e56
@clawsweeper

clawsweeper Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review started

This attempt replaced any previous blocked status for this revision.

View this run’s status.

@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: XS labels Nov 29, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. impact:ux-friction User-facing flow adds avoidable confusion or support burden without fully blocking progress. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 29, 2026
@daniel-lxs
daniel-lxs marked this pull request as ready for review November 29, 2026 03:05
@daniel-lxs

Copy link
Copy Markdown
Member

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 29, 2026
@clawsweeper

clawsweeper Bot commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

Codex review: passed.

What this changes

The Gateway reads its own live plugin metadata through the shared-state worker so recovered config edits can be confirmed promptly.

Example: Run openclaw config set logging.level debug on a busy SQLite-backed Gateway when the first apply fails and the watcher recovers.

  • Before: The CLI exits 1 even though the saved and applied revisions match.
  • After: The CLI exits 0 and reports that the Gateway applied the change.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with inspectable CLI outcome evidence, controlled regression comparisons, and preserved sibling contracts.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): Inspected terminal captures and the supplied controlled comparison exercise the real CLI, RPC, saved file, shared-state reader, and isolated Gateway with an injected initial apply failure under CPU contention; the candidate reports success for the matching applied revision. The original PostgreSQL exception and full hosted shard were explicitly not established by this evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Operators receive a failed config command and reapply instructions after the Gateway has already recovered and applied their edit.
Reason: The scoped SQLite failure has concrete before/after evidence, and this maintainer-authored repair preserves the established timeout, fresh-read, and external-inspection contracts.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it makes a focused, worthwhile repair to recovered config confirmation, and no actionable defect was found in the introduced hunks.

Reviewed head: c8e4a83b42b6955da88316f80efef542c74ec31d

Before merge

None.

Findings

None.

Agent review details

How this fits together

CLI config writes reach the Gateway over RPC; reload preparation reads plugin metadata, and the CLI briefly checks whether the exact saved revision became active.

flowchart LR
  A[CLI config set] --> B[Gateway config RPC]
  B --> C[Config reload owner]
  C --> D[Shared state read worker]
  D --> E[Plugin metadata rows]
  C --> F[Applied config revision]
  F --> G[CLI confirmation]
Loading

Technical review

Best possible solution:

Use the existing shared worker for Gateway-owned live plugin reads while preserving fresh ledger queries, isolated external inspections, and bounded CLI confirmation.

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

Source confirms that main starts a retiring metadata inspector on this reload path, and supplied baseline captures demonstrate the false failure under contention; this read-only review did not independently execute the reproduction.

Is this the best way to solve the issue?

The predicate change removes unnecessary inspector startup at the existing read owner without extending polling, replaying writes, caching rows, or changing PostgreSQL behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 890b27730f34.

Provenance checked

  • Live plugin metadata inspection routing changes intended behavior with a stated reason (7e57516: The isolated metadata path avoided copying unrelated live state; later recovery work broadened that path, and startup retirement separately ensured maintenance custody ended before admission.)
  • Recovery process-test file observation keeps the original intent (a63f803: Deliver the observation through the existing adapter callback so the CLI confirmation assertion does not depend on filesystem notification timing.)
  • Bounded CLI revision confirmation keeps the original intent (ef5d3dc: Confirm the exact recovered revision after write admission releases, without replaying the write or waiting beyond a single two-second deadline.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 2225592 adds src/state/openclaw-state-read-operation.ts:329 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 22255926f9cf; files: src/state/openclaw-state-read-operation.ts)
  • Vincent Koc: Raw commit 1a74a80 adds src/state/openclaw-state-read-operation.ts:278 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 1a74a80617cf; files: src/state/openclaw-state-read-operation.ts)
  • Vito Cappello: Raw commit ef5d3dc adds src/cli/config-owner-route.process.test.ts:172 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: ef5d3dcefec4; files: src/cli/config-owner-route.process.test.ts)

PR surface

Source +3, Tests +40. Total +43 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 4 1 +3
Tests 2 41 1 +40
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 45 2 +43

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

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 November 28, 2026, 10:10 PM ET / November 29, 2026, 03:10 UTC.

@daniel-lxs
daniel-lxs merged commit a012e91 into main Nov 29, 2026
229 checks passed
@daniel-lxs
daniel-lxs deleted the openclaw/config-confirm-2s-timeout-88d837 branch November 29, 2026 05:45
vincentkoc added a commit that referenced this pull request Nov 29, 2026
* commit 'a012e91c821705e443e42660c34e352623fb0a70': (584 commits)
  fix: confirm recovered config edits while the Gateway is busy (#207918)
  fix: make desktop chat presence avatars slightly smaller (#207966)
  fix: list and select routed Claude models without requiring Claude CLI (#207806)
  fix(ci): check out verifier before plugin preflight reuse
  test(reply): prove channel replacement on user messages (#207813)
  fix(release): bootstrap smoke uses persistent agent creation
  fix(ui): stop model picker Enter checks from failing on cold opens (#207963)
  fix: explain when a provider policy stops a chat reply (#207411)
  fix: show context usage during Claude CLI turns (#207036)
  fix: align the side panel with its resize divider (#207936)
  fix: stop the manual handoff UI test from hanging after completion (#207945)
  fix: surface favorites and recommended models in picker search (#201450)
  fix: show the saved quota reset when chat skips its only model (#207210)
  fix: avoid reloading unchanged plugins after Gateway boot (#207949)
  fix: keep Task progress double-clicks from changing the window (#207937)
  fix(doctor): continue repairs past retained conflicting exec approvals (#207951)
  test(reply): make account isolation assertion decisive (#207793)
  fix: keep task progress compact when reopening Details (#207943)
  fix(ui): restore the saved reading position after an empty search (#207673)
  fix: remove four Memory Wiki settings that had no effect (#207882)
  ...
vincentkoc added a commit that referenced this pull request Nov 29, 2026
* commit 'ea8cd30a48de1f42962bb95535d2e1b3b201fc36': (599 commits)
  fix(ui): show a subtle placeholder while a new chat gets its title (#207809)
  fix: remove dismissed chat suggestions without waiting (#207792)
  test(gateway): isolate publication recovery memory pressure (#207993)
  fix(workboard): let users delete an empty default board (#207909)
  fix(ui): remove Open PR from the session menu (#207808)
  feat(ui): offer Add to Home agent when Home sidebar is open (#207773)
  fix(ui): keep narrow desktop composers on desktop icon and control sizes (#207772)
  fix: remove extra space on the right of the compact iPad chat bar (#207763)
  fix: keep the task progress options button inside the Details header (#207940)
  fix(workboard): update the active list when you archive or restore a card (#207790)
  fix: move dropped sessions into their Workboard column immediately (#207787)
  fix(whatsapp): retain sender for explicit current-message reactions (#190121)
  fix: return the agent ID when agents add finishes offline (#207926)
  fix: stop sending internal steering errors to the chat (#207150)
  fix(agents): scheduled runs fail after a read or fetch error the model recovered from (#180922)
  fix: confirm recovered config edits while the Gateway is busy (#207918)
  fix: make desktop chat presence avatars slightly smaller (#207966)
  fix: list and select routed Claude models without requiring Claude CLI (#207806)
  fix(ci): check out verifier before plugin preflight reuse
  test(reply): prove channel replacement on user messages (#207813)
  ...
tideclaw-bot pushed a commit that referenced this pull request Nov 30, 2026
Read fresh plugin metadata through the owning Gateway’s shared-state reader so the CLI can confirm the saved revision within its two-second deadline. Keep startup and external SQLite inspections isolated.

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: 58ab85e4-f064-4888-9c5e-314957a86e56

(cherry picked from commit a012e91)
Co-authored-by: RomneyDa <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 30, 2026
…aw#207918)

Read fresh plugin metadata through the owning Gateway’s shared-state reader so the CLI can confirm the saved revision within its two-second deadline. Keep startup and external SQLite inspections isolated.

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: 58ab85e4-f064-4888-9c5e-314957a86e56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes impact:ux-friction User-facing flow adds avoidable confusion or support burden without fully blocking progress. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants