Skip to content

fix(gateway): preserve pending config restarts across repeated writes and reverts - #128127

Closed
aniruddhaadak80 wants to merge 8 commits into
openclaw:mainfrom
aniruddhaadak80:fix/gateway-cancel-reverted-restart
Closed

aniruddhaadak80 wants to merge 8 commits into
openclaw:mainfrom
aniruddhaadak80:fix/gateway-cancel-reverted-restart

Conversation

@aniruddhaadak80

@aniruddhaadak80 aniruddhaadak80 commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #119360 — reverting a deferred restart-required edit still restarts the Gateway.
Related: #131067 — the guided cloud-setup draft independently exposed an equivalent Save → Apply failure.

Additional instructions

Maintainer repair of the existing contributor PR; no duplicate PR. Preserve Aniruddha Adak's original contribution and regression scenario. This update is AI-assisted. The guided cloud-setup feature branch is unchanged, and none of its GUI, SDK, installer, or provider-allocation changes are included.

Do not merge until the real restart-flow video and exact-head CI gates below are complete. Passing source tests is not a waiver.

What Problem This Solves

Fixes an issue where users save a restart-required configuration and then apply equivalent settings before the Gateway restarts: the pending restart can be paused and never rearmed, while the saved configuration remains inactive. A metadata-only follow-up can instead publish the pending configuration as active too early. Reverting a deferred edit can also request a needless restart or lose still-unapplied plugin work.

Why This Change Was Made

The reload owner now distinguishes applied, restart-pending, and explicitly skipped candidates. Accepted source journaling remains separate from active service, secret, and plugin-install comparison state. Equivalent writes and watcher echoes carry the candidate's recorded disposition through the existing restart coordinator; only actual runtime publication advances the active baseline. Environment ownership still advances at its existing runtime/restart commit edge.

This replaces the previous PR's additional runtime baseline and cancellation shortcut with the canonical owner-boundary repair extracted from 97c6b86. A connected regression found during extraction also required retaining signaled plugin-metadata work until the running plugin generation is replaced—not merely until a restart is admitted. No retries, fallback restart path, public option, SDK export, dependency, schema, protocol, or permission change is added. Current-main config-write application receipts are preserved.

User Impact

Repeated Save/Apply and watcher echoes no longer erase pending restart work or declare inactive settings applied. Exact reverts cancel config-owned work without hiding pending plugin-install changes. Signaled plugin metadata still refreshes if a deferred configuration change is reverted. Invalid or explicitly skipped candidates remain non-applied, and shutdown does not rearm them.

The existing secret equality/revision guards, shared-generation checks, restart preflight, restart emission policy, source CAS, and journal/storage formats are unchanged. Two existing include-file tests now use their own temporary state directory instead of selecting host-default state.

Evidence

Reproduced before the repair

On current-main baseline 6e827231257cf7c9c26ecd54fdc73d8c30afa5d8, the new managed-reloader regression file failed 6 of 8 cases. Equivalent writes failed with GatewayConfigReloadSupersededError: config reload superseded by a newer runtime config source; metadata follow-ups incorrectly advanced active source from A to B. Two additional exact-revert/plugin-index cases also failed: an unnecessary second restart and a lost plugin-install restart reason.

The initially extracted owner fix exposed a further connected failure: signaled metadata + deferred restart + exact revert yielded zero plugin hot reloads instead of one. Removing premature metadata-consumption calls repaired that sequence. These are source-boundary reproductions, not live browser evidence.

Final focused source verification

561 tests across 12 files passed in one invocation, with three serial wrapper shards: 523 Gateway tests, 36 runtime-environment tests, and 2 secret-store tests. The new managed cases use the real core reloader, managed callbacks, restart coordinator, runtime-secret preparation, isolated secret store, and root-work admission. The watcher event source and final restart emitter are controlled fixtures; no actual process restart is claimed from those tests.

node scripts/run-vitest.mjs ``src/gateway/config-reload.test.ts`` ``src/gateway/server-reload-handlers.test.ts`` ``src/gateway/server-reload-managed.restart-debt.test.ts`` ``src/gateway/server-reload-restart.test.ts`` ``src/gateway/server-restart-deferral.test.ts`` ``src/gateway/server-reload-handlers.hot-reload-status.test.ts`` ``src/gateway/server-methods/config-write-flow.test.ts`` ``src/gateway/server-startup-config.secrets.test.ts`` ``src/gateway/server-startup-config.recovery.test.ts`` ``src/gateway/server.shared-token-hot-reload.test.ts`` ``src/config/config.env-vars.test.ts`` ``src/secrets/runtime-store.test.ts``
node scripts/check-changed.mjs -- ``src/gateway/config-reload.ts`` ``src/gateway/server-reload-managed.ts`` ``src/gateway/config-reload.test.ts`` ``src/gateway/server-reload-handlers.test.ts`` ``src/gateway/server-reload-managed.restart-debt.test.ts`` docs/gateway/configuration.md
pnpm build
git diff --check

The final changed-file gate passed, including core types, all 14 canonical core-test type shards, targeted lint, formatting, and the selected static guards. The full pnpm build passed in 6m 40.6s without an ineffective dynamic-import warning. Validation used Node 24.20.0. The final isolated Codex autoreview completed with no actionable findings at its default P0-only threshold; it is not all-priority certification or live proof. The unchanged sensitive managed-secrets module was inspected locally rather than bypassing the review helper's exclusion policy.

CI fixture follow-up

The first exact-head CI run, https://github.com/openclaw/openclaw/actions/runs/33118704789, failed only the Brave cancellation test job and its aggregate gate. Two existing in-flight tests used a one-second fetch-start poll: the first saw zero calls, then its unfinished request reached the next case's global fetch mock, which saw two. The unchanged 67-file shard passed locally, confirming the failure was timing-sensitive.

Test-only follow-up 697040a cancels at the existing mocked transport boundary after the abort listener is registered, awaits terminal rejection, and retains exact call-count and aborted-signal assertions. No timeout increase, production change, new seam, or SDK mock was added. The original 1,215-test / 67-file shard, the scoped changed gate, and fresh isolated P0 autoreview passed. This is separate from the 561-test owner batch, not a rerun of it.

OPENCLAW_VITEST_MAX_WORKERS=2 node scripts/run-vitest.mjs run --config test/vitest/vitest.extension-misc.config.ts --configLoader runner
node scripts/check-changed.mjs -- extensions/brave/``src/brave-web-search-provider.test.ts``

The published head is 697040a81eeb26a8ea947cec01b544125c3d98c0. The source build is bound to its production-identical parent ba17633d92151e063135d3467c5fe0044b1dd807 (2026.8.1-ba17633d9215-2026-08-27T21-33-56.621Z); the sole intervening change is the Brave test fixture. Exact-head CI is now green: https://github.com/openclaw/openclaw/actions/runs/33123143221, attempt 2, at 697040a81eeb26a8ea947cec01b544125c3d98c0.

Attempt 1 of that run failed the existing OC Path parser performance check: the best of three samples was 3,295 ms against its unchanged 800 ms CI budget. The unchanged 11-test performance file passed locally under its stricter 200 ms local budget; the same full extension shard had also passed in the prior run. One rerun of only the failed job and its dependent gate passed at the identical head. No parser code, threshold, sample count, coverage, timeout, or baseline was changed. This is an observed performance-gate failure followed by a passing diagnostic retry, not a claimed parser fix.

Named follow-ups from that failed full-extension run: profile OC Path's full-shard timing variance without weakening the budget; investigate the Reef test-worker termination timeout logged after its test passed. Neither is attributed to the restart-owner repair or presented as resolved here.

Live proof and landing gates

  • Capture the repaired Save → Apply sequence on a real isolated Gateway through the permitted real-Chrome route, with a visible restart/reconnection and matching saved/applied revision. Record source/build identity; inspect the capture before attaching it.
  • Include the deferred edit → exact revert decision in real behavior proof, retaining plugin-install/metadata work when present.
  • Exact-head required CI passed: run 33123143221, attempt 2, head 697040a81eeb26a8ea947cec01b544125c3d98c0.
  • Complete native scripts/pr review artifact validation, then OPENCLAW_TESTBOX=1 scripts/pr prepare-run and scripts/pr merge-run. Native review initialization succeeded, but the agent-worktree fence still refuses writes to the native review artifacts even after the documented directory-access grant. Prepared inputs are preserved in the owned worktree; no shell, copy, permission-setting, or parent-agent workaround is being used.

The current browser automation route is unavailable. No isolated-browser fallback, operator Gateway/config/state, credential, account, or allocation operation was used to bypass that limitation. The historical guided-setup Save/Apply JSON reports a new boot and matching applied revision, but its script explicitly disabled video; the draft's attached consent/cancel video shows a different flow and is not reused as restart proof.

Review closure and provenance

The previous ClawSweeper plugin-install finding is addressed by keeping the canonical install-record baseline active until runtime publication, with a config-revert-plus-index regression. The related signaled-metadata lifecycle is covered as well. Real-behavior proof remains explicitly open.

Blame identifies 3616fba from #105289 (transactional hot reload), authored and merged by Peter Steinberger (@steipete), July 13, 2026. Its parent already advanced the acceptance baseline before restart, so this is carried-forward behavior, not a claim that this PR first introduced it. The latest stable tag v2026.7.1-2 also contains premature baseline advancement at src/gateway/config-reload.ts:253–255; the exact source-supersession failure above was reproduced on current main.

Production LOC: +49/-53 (net -4). Tests: +440/-64 (net +376), including the real managed boundary fixture, expanded original regression scenarios, and the test-only CI follow-up; pure table reindentation is not new behavior. Documentation: +5/-0. No baseline or budget was relaxed.

Thanks to @aniruddhaadak80 for the original fix attempt and revert scenario, and @ape-deft for the original report. Documentation: https://docs.openclaw.ai/gateway/configuration#reload-planning

@clawsweeper

clawsweeper Bot commented Aug 23, 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.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: S triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. and removed triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Aug 23, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 23, 2026
@clawsweeper

clawsweeper Bot commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed September 10, 2026, 8:47 AM ET / 12:47 UTC (Revision 20).

ClawSweeper review

What this changes

The branch changes Gateway restart acceptance to check an explicit application disposition and adds regression coverage for repeated writes, reverts, skipped writes, and shutdown.

Merge readiness

⛔ Blocked before merge - 9 items remain

Keep open: this remains an actively owned fix candidate, but both previous correctness findings remain unresolved and the required restart/revert proof is outstanding. No verified merged replacement resolves the remaining work.

Priority: P1
Reviewed head: 8f63714c457522f76fbcb6189d7c541632278846

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) Useful regression intent remains, but the producer/consumer mismatch and broken fixture prevent confidence in the patch, while real restart proof is incomplete.
Proof confidence 🦪 silver shellfish (2/6) Needs stronger real behavior proof before merge: The changed managed-reloader path has controlled watcher/emitter tests; older cloud-setup observations and four inspected screenshots do not demonstrate this head's restart/revert outcome. The discussion explicitly retains an isolated-Gateway restart/reconnection recording with matching revisions and revert handling. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🧂 unranked krab (1/6) 2 actionable review findings remain.

Verification

Check Result Evidence
Real behavior Needs proof Needs stronger real behavior proof before merge: The changed managed-reloader path has controlled watcher/emitter tests; older cloud-setup observations and four inspected screenshots do not demonstrate this head's restart/revert outcome. The discussion explicitly retains an isolated-Gateway restart/reconnection recording with matching revisions and revert handling. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 8 items Introduced condition has no producer: The introduced condition reads acceptance.application, but the callback contract defines only runtimeApplied and publishSource. All three producer paths supply runtimeApplied without application. Consequently the skipped branch is unreachable, as well as violating the TypeScript contract.
Regression fixture still uses retired callbacks: The new fixture supplies reconcileTerminalSessions and commitTerminalConfig instead of required reconcileRuntimePolicy and commitRuntimePolicy. The first restart reaches the unconditional reconcileRuntimePolicy call at server-reload-managed.ts:245 before the intended restart-debt assertions.
Current-main necessity check: Fetched main still uses the runtimeApplied boolean contract and guard. Its restart branch calls commitReloadBaseline without a non-applied disposition, advancing the comparison baseline before process replacement; the intended separation is not established by the remaining one-line branch change.
Findings 2 actionable findings [P1] [P1] Define and populate the acceptance disposition before reading it
[P2] [P2] Use the current runtime-policy callbacks in the regression fixture
Security None None.

How this fits together

The Gateway configuration reloader receives saved settings and filesystem notifications, then decides whether to update running services or defer a process restart. Its restart coordinator must preserve pending work without treating inactive settings as already applied.

flowchart TD
  A[Saved settings and file notifications] --> B[Validate and compare configuration]
  B --> C{Application disposition}
  C -->|Applied| D[Publish active runtime]
  C -->|Restart pending| E[Restart coordinator]
  C -->|Skipped| F[Keep runtime unchanged]
  E --> G[Drain work and restart Gateway]
  B -->|Revert| E
Loading

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: The changed managed-reloader path has controlled watcher/emitter tests; older cloud-setup observations and four inspected screenshots do not demonstrate this head's restart/revert outcome. The discussion explicitly retains an isolated-Gateway restart/reconnection recording with matching revisions and revert handling. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • [P1] Define and populate the acceptance disposition before reading it (P1) - The previous finding remains unresolved: onConfigAccepted still receives only { runtimeApplied, publishSource? } from config-reload.ts, so acceptance.application is always undefined and also fails the declared TypeScript contract. With an outstanding restart followed by a skipped write, this bypasses the branch that keeps restart work paused and can rearm it despite writer intent or reload mode off. Implement the disposition at every producer and replay path, preserving the active baseline for restart-pending candidates; a consumer-only rename is insufficient.
  • [P2] Use the current runtime-policy callbacks in the regression fixture (P2) - The previous fixture finding also remains unresolved. ManagedGatewayConfigReloaderParams requires reconcileRuntimePolicy and commitRuntimePolicy, but this fixture supplies the retired terminal callback names. Its first restart reaches params.reconcileRuntimePolicy(...) and fails before the intended regression assertions; the object also violates the parameter type. Supply the current callbacks so the tests exercise restart debt rather than fixture initialization failure.
  • Resolve merge risk (P1) - A skipped write while restart work is pending can bypass the existing pause behavior and rearm a restart, including when automatic reload is disabled.
  • Resolve merge risk (P1) - Actual process replacement, reconnection, and saved-versus-applied revision behavior remain unproved for the reviewed implementation.
  • Complete next step (P2) - Resolve both continuing findings and provide the requested restart/revert recording with supporting logs and reviewed build identity. Redact credentials, IP addresses, private endpoints, and account details. Update the PR body to trigger re-review; if it does not run, ask a maintainer to comment @clawsweeper re-review.
  • Improve patch quality - Complete the application disposition across acceptance producers and echoes, preserving skipped writes and active runtime baselines.
  • Improve patch quality - Replace the obsolete fixture callbacks and establish failing-before/passing-after coverage for the focused restart scenarios.
  • Improve patch quality - Attach the requested isolated-Gateway restart/revert recording with diagnostic logs and source/build identity, and refresh the PR body's outdated validation claims.

Findings

  • [P1] [P1] Define and populate the acceptance disposition before reading it — src/gateway/server-reload-managed.ts:424
  • [P2] [P2] Use the current runtime-policy callbacks in the regression fixture — src/gateway/server-reload-managed.restart-debt.test.ts:185-186
Agent review details

Security

None.

PR surface

Source 0, Tests +323. Total +323 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 2 2 0
Tests 2 329 6 +323
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 331 8 +323

Review metrics

Metric Value Why it matters
Production versus regression coverage Production net 0 lines; tests net +323 lines The proposed production change is a condition replacement; the added tests justify their scope through restart lifecycle scenarios but currently fail before exercising them.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #119360
Summary: This PR is the open candidate for the reported deferred-restart/revert defect; the cloud-setup draft independently overlaps the repeated-write problem.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Complete the disposition contract (recommended)
    Repair the producer and consumer together, update the fixture callbacks, and demonstrate that skipped writes cannot rearm a pending restart.

Technical review

Best possible solution:

Carry applied, restart-pending, and skipped outcomes consistently through the canonical reload owner, preserve active baselines until publication, and demonstrate restart and revert behavior while respecting disabled reloads.

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

Yes, from source: every acceptance producer omits the newly read field, and the regression fixture lacks an unconditionally invoked restart callback. No tests or contributor code were executed during this read-only review.

Is this the best way to solve the issue?

No. The owner-level approach is appropriate, but changing only the consumer condition cannot establish the promised application states or preserve the active baseline.

Full review comments:

  • [P1] [P1] Define and populate the acceptance disposition before reading it — src/gateway/server-reload-managed.ts:424
    The previous finding remains unresolved: onConfigAccepted still receives only { runtimeApplied, publishSource? } from config-reload.ts, so acceptance.application is always undefined and also fails the declared TypeScript contract. With an outstanding restart followed by a skipped write, this bypasses the branch that keeps restart work paused and can rearm it despite writer intent or reload mode off. Implement the disposition at every producer and replay path, preserving the active baseline for restart-pending candidates; a consumer-only rename is insufficient.
    Confidence: 1
  • [P2] [P2] Use the current runtime-policy callbacks in the regression fixture — src/gateway/server-reload-managed.restart-debt.test.ts:185-186
    The previous fixture finding also remains unresolved. ManagedGatewayConfigReloaderParams requires reconcileRuntimePolicy and commitRuntimePolicy, but this fixture supplies the retired terminal callback names. Its first restart reaches params.reconcileRuntimePolicy(...) and fails before the intended regression assertions; the object also violates the parameter type. Supply the current callbacks so the tests exercise restart debt rather than fixture initialization failure.
    Confidence: 1

Overall correctness: patch is incorrect
Overall confidence: 0.99

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P1: The change addresses Gateway settings that remain inactive or trigger unwanted restarts, and the proposed guard currently breaks skipped-write handling.
  • merge-risk: 🚨 compatibility: The missing disposition can override existing writer intent and disabled automatic-reload behavior when restart work is pending.
  • merge-risk: 🚨 availability: Rearming work that should remain paused can cause an unwanted Gateway restart and disconnect active clients.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🦪 silver shellfish and patch quality is 🧂 unranked krab.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The changed managed-reloader path has controlled watcher/emitter tests; older cloud-setup observations and four inspected screenshots do not demonstrate this head's restart/revert outcome. The discussion explicitly retains an isolated-Gateway restart/reconnection recording with matching revisions and revert handling. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The changed managed-reloader path has controlled watcher/emitter tests; older cloud-setup observations and four inspected screenshots do not demonstrate this head's restart/revert outcome. The discussion explicitly retains an isolated-Gateway restart/reconnection recording with matching revisions and revert handling.

Evidence

What I checked:

  • Introduced condition has no producer: The introduced condition reads acceptance.application, but the callback contract defines only runtimeApplied and publishSource. All three producer paths supply runtimeApplied without application. Consequently the skipped branch is unreachable, as well as violating the TypeScript contract. (src/gateway/server-reload-managed.ts:424, 8f63714c4575)
  • Regression fixture still uses retired callbacks: The new fixture supplies reconcileTerminalSessions and commitTerminalConfig instead of required reconcileRuntimePolicy and commitRuntimePolicy. The first restart reaches the unconditional reconcileRuntimePolicy call at server-reload-managed.ts:245 before the intended restart-debt assertions. (src/gateway/server-reload-managed.restart-debt.test.ts:185, 8f63714c4575)
  • Current-main necessity check: Fetched main still uses the runtimeApplied boolean contract and guard. Its restart branch calls commitReloadBaseline without a non-applied disposition, advancing the comparison baseline before process replacement; the intended separation is not established by the remaining one-line branch change. (src/gateway/config-reload.ts:161, af50bd6c7684)
  • Latest-release comparison: The v2026.9.3 source also checks !acceptance.runtimeApplied. This release comparison does not establish a shipped implementation of the proposed three-way disposition. (src/gateway/server-reload-managed.ts, 1391f7cd2d40)
  • Re-review continuity: The previous completed review already raised both the missing disposition and obsolete fixture callbacks. The fixture is unchanged from that reviewed head; these are continuing findings, not newly discovered concerns. Comparison of the older managed source encountered an unavailable historical blob, so no additional historical-introduction claim is made. (src/gateway/server-reload-managed.restart-debt.test.ts:185, 8f63714c4575)
  • Proof inspected and bounded: Read the supplied body and discussion under sourceRevision d843d2aebfac7f0c89bd517e71f0a49cfa056cfa424f9185a39ed707687e36dd and inspected all four prepared screenshots. They show cloud-profile configuration, diagnostics, and draft preservation from feat: guide cloud-session setup with protected provider connections #131067, not this head's restart/revert sequence. Historical Save/Apply observations are useful context, but the body and fix(gateway): preserve pending config restarts across repeated writes and reverts #128127 (comment) explicitly leave the isolated-Gateway recording incomplete. The reported build and green CI identify an older head.

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (19 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-03T11:08:58.824Z sha e70ae7f :: needs real behavior proof before merge. :: [P1] Define the acceptance disposition before reading it
  • reviewed 2026-09-03T11:43:35.490Z sha dcd08d9 :: needs real behavior proof before merge. :: [P1] Define the acceptance disposition before reading it
  • reviewed 2026-09-03T11:56:16.805Z sha dcd08d9 :: needs real behavior proof before merge. :: [P1] Define the acceptance disposition before reading it
  • reviewed 2026-09-03T12:31:09.371Z sha 57c05fa :: needs real behavior proof before merge. :: [P1] Define the acceptance disposition before reading it
  • reviewed 2026-09-03T13:57:32.377Z sha e17617d :: needs real behavior proof before merge. :: [P1] Define the acceptance disposition before reading it
  • reviewed 2026-09-04T08:43:51.621Z sha 588a778 :: needs real behavior proof before merge. :: [P1] Define and populate the acceptance disposition before reading it | [P2] Update the regression harness to the current policy callbacks
  • reviewed 2026-09-04T09:23:36.335Z sha 588a778 :: needs real behavior proof before merge. :: [P1] Define and populate the acceptance disposition before reading it | [P2] Use the current restart-policy callbacks in the new harness
  • reviewed 2026-09-05T14:05:35.977Z sha 4c07bbb :: needs real behavior proof before merge. :: [P1] Define and populate the acceptance disposition before reading it | [P2] Use the current runtime-policy callbacks in the regression fixture

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 23, 2026
@aniruddhaadak80

Copy link
Copy Markdown
Contributor Author

Pushed 7bac997a52a — a corrected version of the restart-debt fix after CI surfaced two things:

  1. My new regression test asserted the wrong observable. A full revert now flows through the "effective config unchanged" path (changedPaths.length === 0), which intentionally does not call onNoopConfigCommit. The test now asserts the actual contract: onRestart still exactly once, no onNoopConfigCommit, no onHotReload, and onConfigRevisionApplied re-applied with the reverted config's hash.

  2. The first revision had an incomplete invariant: currentRuntimeCompareConfig only advanced in markRuntimeCommitted, so any candidate accepted without an external runtime owner (no-op plans, baseline accepts) left the runtime diff baseline stale — caught by the existing "plans one immutable runtime override snapshot per candidate" test, which I reproduced locally before and after. The rule is now explicit: the runtime baseline advances whenever the process actually adopts a snapshot (normal commitReloadBaseline completion and markRuntimeCommitted), and explicitly does not advance for restart-deferred candidates (advanceRuntimeBaseline: false) or runtime-skipped ones.

Verification: -t "plans one immutable runtime override snapshot" failed pre-fix and passes post-fix locally; my regression test's first flush (chokidar) cannot run reliably in this Windows sandbox (same local failures as sibling tests that pass on Linux CI), so the definitive validation is this CI run.

@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Aug 23, 2026
@steipete steipete self-assigned this Aug 27, 2026
@steipete
steipete force-pushed the fix/gateway-cancel-reverted-restart branch from f8e6bc1 to ba17633 Compare August 27, 2026 21:33
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: L and removed size: S labels Aug 27, 2026
@steipete steipete changed the title fix(gateway): cancel deferred restart when config settles back to the runtime baseline fix(gateway): preserve pending config restarts across repeated writes and reverts Aug 27, 2026
@steipete

steipete commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

The focused maintainer repair is on this existing PR, preserving Aniruddha Adak's credit rather than opening a duplicate. Runtime repair: ba17633. Current head, with a test-only CI follow-up: 697040a.

The original cancellation shortcut is replaced by the canonical active-versus-accepted owner repair extracted from 97c6b86. No guided-setup GUI, SDK, installer, or provider-allocation code is included. Current-main write receipts remain intact. The reviewed plugin-install baseline defect and a reproduced metadata-refresh-after-revert failure are covered. The fresh ClawSweeper review found no introduced correctness defect and confirmed the prior finding is addressed.

Source verification: 561 tests across 12 files passed; the changed gate (including all 14 core-test type shards), full build, exact-commit rebuild, and fresh isolated Codex P0-only autoreview passed. Production delta remains -4 lines.

The first CI run https://github.com/openclaw/openclaw/actions/runs/33118704789 failed two preexisting Brave cancellation tests: a one-second polling deadline let an unfinished request leak into the next fixture. The test-only follow-up cancels at the existing transport boundary and awaits terminal rejection, without increasing timeouts or weakening assertions. The original 1,215-test / 67-file shard, scoped check gate, and fresh P0 autoreview passed. Exact-head CI is now green at 697040a81eeb26a8ea947cec01b544125c3d98c0: https://github.com/openclaw/openclaw/actions/runs/33123143221, attempt 2. Attempt 1 hit OC Path's preexisting parser performance budget (3,295 ms versus 800 ms); the unchanged local test and one exact failed-job retry passed. No parser code, budget, samples, coverage, timeout, or baseline changed. This retry is not presented as a parser repair. The PR body records the timing-variance and Reef worker-termination follow-ups.

This is not yet merge-ready. The real-Chrome restart/revert recording remains mandatory. The historical guided-setup JSON has no preserved restart video; consent/cancellation footage is a different flow. Native review initialization succeeded, but artifact writes remain blocked by the agent-worktree fence even after the documented directory-access grant. Owned review inputs are preserved; no shell/copy, permission-setting, or parent-agent workaround is being used. No prepare/merge, operator-state change, or browser fallback has been attempted.

Exact commands, provenance, CI failure details, and remaining gates are in the updated PR body.

@clawsweeper

clawsweeper Bot commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 27, 2026
Keep restart-pending and skipped candidates separate from the active config
and plugin-install comparison baseline. Equivalent writes and watcher echoes
retain restart debt without publishing inactive services or secrets. Exact
reverts cancel only config-owned debt, and signaled plugin metadata stays
pending until its running generation is replaced.

Extract the generic owner repair from 97c6b86
without the guided cloud setup feature. Preserve current-main config-write
application receipts. Extend the original revert scenario through residual
plugin-index and metadata work, with real managed-secret/reloader regressions.

Fixes openclaw#119360. Related to openclaw#131067 and openclaw#130713.

Co-authored-by: Aniruddha Adak <[email protected]>
@aniruddhaadak80
aniruddhaadak80 force-pushed the fix/gateway-cancel-reverted-restart branch from 697040a to c0d1c05 Compare September 1, 2026 11:49
Copilot AI lite review requested due to automatic review settings September 1, 2026 11:49

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. and removed P2 Normal backlog priority with limited blast radius. labels Sep 3, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the docs Improvements or additions to documentation label Sep 10, 2026
@clawsweeper clawsweeper Bot added the proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. label Sep 10, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This assigned pull request has been automatically marked as stale after being open for 27 days.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Sep 20, 2026
@clawsweeper

clawsweeper Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: fix(gateway): preserve pending config restarts across repeated writes and reverts This is item 2/3 in the current shard. Shard 73/89.

This temporary status tracks the active review worker. The completed review will appear in the durable ClawSweeper review comment.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@openclaw-barnacle openclaw-barnacle Bot removed the stale Marked as stale due to inactivity label Sep 23, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This assigned pull request has been automatically marked as stale after being open for 27 days.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Sep 23, 2026
@openclaw-barnacle

Copy link
Copy Markdown

Closing due to inactivity.
If you believe this PR should be revived, post in #clawtributors on Discord to talk to a maintainer.
That channel is the escape hatch for high-quality PRs that get auto-closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: M stale Marked as stale due to inactivity 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.

[Bug]: Transient restart-required config write still restarts after revert to identical config

3 participants