Skip to content

Fix config patch restart-required notices - #83041

Merged
vincentkoc merged 6 commits into
openclaw:mainfrom
xuruiray:codex/46797-config-patch-restart-required
Jun 22, 2026
Merged

vincentkoc merged 6 commits into
openclaw:mainfrom
xuruiray:codex/46797-config-patch-restart-required

Conversation

@xuruiray

@xuruiray xuruiray commented May 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #46797.

This makes config write restart sentinel payloads carry whether the write actually requires a gateway restart, so pending/status summaries can say Gateway restart required (...) instead of Gateway restart config-patch ok (...).

It also keeps startup-consumed restart sentinel messages in the completed context, so automatic restart follow-up notices say the restart completed instead of telling the user a completed restart is still required.

Verification

  • node scripts/run-vitest.mjs src/infra/restart-sentinel.test.ts src/gateway/server-methods/config.shared-auth.test.ts -- --reporter=verbose
  • node scripts/run-vitest.mjs src/gateway/server-restart-sentinel.test.ts src/gateway/server.config-patch.test.ts -- --reporter=verbose
  • ./node_modules/.bin/oxfmt --check --threads=1 src/infra/restart-sentinel.ts src/infra/restart-sentinel.test.ts src/gateway/server-methods/config-write-flow.ts src/gateway/server-methods/config.shared-auth.test.ts src/gateway/server-restart-sentinel.ts src/gateway/server-restart-sentinel.test.ts src/gateway/server.config-patch.test.ts CHANGELOG.md
  • git diff --check
  • .agents/skills/codex-review/scripts/codex-review --mode local

Focused tests passed with 3 files / 42 tests, adjacent gateway tests passed with 2 files / 47 tests, formatting check passed, diff whitespace check passed, and Codex review reported no accepted/actionable findings.

Real behavior proof

Behavior addressed: config.patch and config.apply restart-required sentinel summaries now use Gateway restart required (...) only when the reload plan requires a restart; hot-reloaded config patch writes are explicitly marked as not restart-required.

Real environment tested: Local OpenClaw source checkout on macOS, loading the real src/infra/restart-sentinel.ts module with node --import tsx.

Exact steps or command run after this patch: Ran a live Node command against the real OpenClaw restart sentinel formatter:

node --import tsx --input-type=module <<'EOF'
import {
  formatRestartSentinelMessage,
  summarizeRestartSentinel,
} from "./src/infra/restart-sentinel.ts";

const restartRequiredPayload = {
  kind: "config-patch",
  status: "ok",
  ts: Date.now(),
  message: "Run restart-gateway.ps1 to apply config changes.",
  stats: { mode: "config.patch", requiresRestart: true },
};
const hotReloadedPayload = {
  kind: "config-patch",
  status: "ok",
  ts: Date.now(),
  stats: { mode: "config.patch", requiresRestart: false },
};

console.log("pending summary:", summarizeRestartSentinel(restartRequiredPayload));
console.log("pending message:");
console.log(formatRestartSentinelMessage(restartRequiredPayload));
console.log("completed message:");
console.log(formatRestartSentinelMessage(restartRequiredPayload, { state: "completed" }));
console.log("hot-reloaded summary:", summarizeRestartSentinel(hotReloadedPayload));
EOF

Evidence after fix: Terminal output from that live command:

pending summary: Gateway restart required (config.patch)
pending message:
Gateway restart required (config.patch)
Run restart-gateway.ps1 to apply config changes.
completed message:
Gateway restart completed (config.patch)
Run restart-gateway.ps1 to apply config changes.
hot-reloaded summary: Gateway restart config-patch ok (config.patch)

Observed result after fix: Pending restart-required config patch payloads show Gateway restart required (config.patch) with the note preserved underneath; startup/completed context shows Gateway restart completed (config.patch); hot-reloaded config patch payloads do not show restart required.

What was not tested: Live Windows/manual gateway restart behavior was not exercised locally; the local Crabbox preflight was blocked because the crabbox binary is unavailable in this checkout.

@xuruiray
xuruiray requested a review from a team as a code owner May 17, 2026 09:51
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: S triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 17, 2026
@clawsweeper

clawsweeper Bot commented May 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed June 22, 2026, 7:40 AM ET / 11:40 UTC.

Summary
The PR adds a requiresRestart flag to config write restart sentinel stats, derives it from the gateway reload plan for config.patch/config.apply, and adds formatter/gateway tests for restart-required versus hot-reload notices.

PR surface: Source +36, Tests +103. Total +139 across 5 files.

Reproducibility: yes. Source inspection shows PR head marks restart-required config writes, while startup delivery still formats the consumed sentinel through the same pending formatter after restart.

Review metrics: 1 noteworthy metric.

  • Persisted sentinel payload shape: 1 optional stats field added. Restart sentinels are serialized state, so maintainers should notice that old payloads remain readable and new payloads get a clear pending/completed interpretation before merge.

Stored data model
Persistent data-model change detected: migration/backfill/repair: src/infra/restart-sentinel.test.ts, serialized state: src/gateway/server-methods/config.shared-auth.test.ts, serialized state: src/infra/restart-sentinel.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🦐 gold shrimp
Result: blocked until stronger real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Restore or replace the completed/consumed restart-sentinel formatting path and add regression coverage for startup delivery.
  • [P1] Update the PR body with current-head terminal or live output that proves pending restart-required, completed post-restart, and hot-reload cases.
  • [P1] Rerun the focused restart sentinel/gateway tests and the failing exact-head CI shard after repair.

Proof guidance:

  • [P1] Needs stronger real behavior proof before merge: Terminal proof is present, but it no longer matches current head because the claimed completed-state formatter output was removed from the final diff; a fresh current-head proof is needed, with private details redacted. 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.

Risk before merge

  • [P1] As-is, a successful restart-required config write can produce a post-restart system notice that still says a restart is required instead of completed.
  • [P1] The PR body's real behavior proof is stale for current head because it claims a completed-state formatter output that the final diff removed.
  • [P1] One current CI shard is failing on the exact head, so merge gates still need a clean rerun after the branch is repaired.

Maintainer options:

  1. Decide the mitigation before merge
    Keep the requiresRestart sentinel metadata, but separate pending/status formatting from startup-consumed formatting so post-restart system events say completed, then refresh current-head proof and checks.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] Manual review is needed because the branch has a concrete wording defect plus stale current-head proof; automation should not merge until both are repaired and re-proven.

Security
Cleared: The diff does not add dependencies, workflow execution, secret handling, permissions, or externally executed code; no concrete security or supply-chain issue was found.

Review findings

  • [P2] Preserve completed restart wording — src/infra/restart-sentinel.ts:358
Review details

Best possible solution:

Keep the requiresRestart sentinel metadata, but separate pending/status formatting from startup-consumed formatting so post-restart system events say completed, then refresh current-head proof and checks.

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

Yes. Source inspection shows PR head marks restart-required config writes, while startup delivery still formats the consumed sentinel through the same pending formatter after restart.

Is this the best way to solve the issue?

No. The PR is a good boundary for pending restart-required metadata, but the final head dropped the completed/consumed formatting needed to avoid a misleading post-restart notice.

Full review comments:

  • [P2] Preserve completed restart wording — src/infra/restart-sentinel.ts:358
    This branch marks restart-required config writes and then always summarizes them as Gateway restart required. loadRestartSentinelStartupTask() still formats the same persisted payload after the gateway has come back up, so the follow-up system event tells the user a completed restart is still required; the PR body's completed-output proof is now stale. Please restore a consumed/completed formatting path or otherwise keep pending status text separate from post-restart delivery.
    Confidence: 0.88

Overall correctness: patch is incorrect
Overall confidence: 0.86

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against f40071cc0fd2.

Label changes

Label changes:

  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: Terminal proof is present, but it no longer matches current head because the claimed completed-state formatter output was removed from the final diff; a fresh current-head proof is needed, with private details redacted. 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.

Label justifications:

  • P3: This is a low-blast-radius gateway restart notice fix with user-visible wording impact but no evidence of data loss, security bypass, or broken core runtime.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: Terminal proof is present, but it no longer matches current head because the claimed completed-state formatter output was removed from the final diff; a fresh current-head proof is needed, with private details redacted. 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

PR surface:

Source +36, Tests +103. Total +139 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 2 49 13 +36
Tests 3 103 0 +103
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 152 13 +139

What I checked:

  • PR head always summarizes marked config writes as restart required: The combined PR diff adds isRestartRequiredConfigWriteSentinel and returns Gateway restart required whenever a config apply/patch sentinel has stats.requiresRestart === true, with no consumed/completed context remaining in the final head. (src/infra/restart-sentinel.ts:358, b208c3469b43)
  • Startup delivery still consumes the same formatter after restart: Current startup sentinel delivery reads the persisted payload and calls formatRestartSentinelMessage(payload) / summarizeRestartSentinel(payload) after the gateway is running again, so PR head would still show the pending-style required wording in the post-restart notice. (src/gateway/server-restart-sentinel.ts:456, f40071cc0fd2)
  • Config write path persists the sentinel payload that startup later consumes: The config.patch/config.apply handler writes the restart sentinel through respondWithConfigRestartWrite, passing the changed paths and mode into the payload builder before the startup wake path reads it back. (src/gateway/server-methods/config.ts:915, f40071cc0fd2)
  • PR proof is stale against current head: The PR body's terminal proof still calls formatRestartSentinelMessage(payload, { state: "completed" }) and claims Gateway restart completed, but the final diff removed that formatter option and completed-state tests. (b208c3469b43)
  • Canonical issue asks for restart-required wording while preserving the note: The linked issue reports that Gateway restart config-patch ok (config.patch) is misleading for a restart-required config.patch notice and asks for clear restart-required wording with the note text preserved.
  • Current checks are not clean: Current head still has checks-node-compact-small-7 failing and an auto-response check in progress, so merge gates need a clean exact-head rerun after the code/proof repair. (b208c3469b43)

Likely related people:

  • vincentkoc: Recently moved restart sentinel persistence to SQLite and later helped repair this PR branch, so they are close to the current persisted sentinel shape and review context. (role: recent area contributor; confidence: high; commits: 514b3365b54c, b208c3469b43; files: src/infra/restart-sentinel.ts, src/gateway/server-methods/config-write-flow.ts)
  • jameswniu: Recently changed restart sentinel summary formatting to avoid duplicated restart wording, touching the same formatter surface this PR changes. (role: recent formatter contributor; confidence: medium; commits: 923828ccd733; files: src/infra/restart-sentinel.ts, src/infra/restart-sentinel.test.ts)
  • joshavant: Recently fixed restart sentinel internal continuations, which is adjacent to the startup-consumed sentinel delivery path implicated by this review finding. (role: adjacent restart continuation contributor; confidence: medium; commits: 584fa3215c19; files: src/infra/restart-sentinel.ts, src/gateway/server-restart-sentinel.ts)
  • steipete: Recent config write flow history includes changes to the gateway config write and secrets startup path that this PR builds on. (role: recent gateway config contributor; confidence: medium; commits: 0177a4b6c9cc; files: src/gateway/server-methods/config-write-flow.ts, src/gateway/server-methods/config.shared-auth.test.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. and removed triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 17, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. impact:session-state Session, memory, transcript, context, or agent state can drift or corrupt. labels May 17, 2026
@RomneyDa

Copy link
Copy Markdown
Member

Heads up: this PR needs to be updated against current main before the new required Dependency Guard check can pass.

@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 29, 2026
@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 impact:session-state Session, memory, transcript, context, or agent state can drift or corrupt. labels May 29, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 29, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 29, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 29, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels May 29, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 29, 2026
@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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels May 29, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 29, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 29, 2026
@xuruiray

Copy link
Copy Markdown
Contributor Author

@RomneyDa 准备好了,CI 已经全绿。

@openclaw-barnacle openclaw-barnacle Bot removed the scripts Repository scripts label Jun 22, 2026
@vincentkoc

Copy link
Copy Markdown
Member

Clownfish 🐠 reef automerge status

Clownfish finished this automerge repair swim without changing the branch.

Target: #83041
Executor outcome: base branch advanced after validation and projectclownfish/repair-automerge-openclaw-openclaw-83041-83041 needs a fresh rebase pass: Rebasing (1/6) Rebasing (2/6) Rebasing (3/6) Rebasing (4/6) Rebasing (5/6) error: could not apply 225b8be84e... fix(ci): refre....
Worker summary: Canonical path stays on PR #83041, but it is not merge-ready in this worker lane: the latest hydrated ClawSweeper review still says needs maintainer review before merge, three current-head CI shards are failing, and merge/close are blocked by job policy. The safe executable outcome is to repair contributor branch #83041 in place because maintainer_can_modify is true, preserve @xuruiray credit, rerun focused restart-sentinel proof plus pnpm check:changed, and request a fresh ClawSweeper/Codex review before the comment router considers merge.

Worker actions:

No push, rebase, replacement PR, merge, or ClawSweeper re-review happened this swim.

fish notes: model gpt-5.5, reasoning medium.

@vincentkoc
vincentkoc force-pushed the codex/46797-config-patch-restart-required branch from 6c70d91 to 4228b3b Compare June 22, 2026 11:10
@clawsweeper clawsweeper Bot added 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. and removed 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. labels Jun 22, 2026
@vincentkoc

Copy link
Copy Markdown
Member

Clownfish 🐠 reef update

Thanks for the work here. Clownfish patched this branch directly so the contributor trail stays right where it started.

Source PR: #83041
Validation: node scripts/run-vitest.mjs src/infra/restart-sentinel.test.ts src/gateway/server-methods/config.shared-auth.test.ts src/gateway/server-restart-sentinel.test.ts src/gateway/server.config-patch.test.ts -- --reporter=verbose; pnpm check:changed
Contributor credit stays right here with this PR's history and changelog context. no lost treasure, no mystery bubbles.

fish notes: model gpt-5.5, reasoning medium; reviewed against b208c34.

@vincentkoc
vincentkoc force-pushed the codex/46797-config-patch-restart-required branch from 6d03462 to b208c34 Compare June 22, 2026 11:17
@clawsweeper clawsweeper Bot added 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 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 Jun 22, 2026
@vincentkoc
vincentkoc merged commit 96e27c6 into openclaw:main Jun 22, 2026
112 of 117 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jun 23, 2026
Merges the Clownfish-repaired contributor branch for openclaw#83041. Clownfish merge preflight cleared security/comments/review and accepted pnpm check:changed; the remaining cron shard failure is present on current main.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clownfish:automerge Maintainer opted this Clownfish PR into bounded ClawSweeper-reviewed automerge gateway Gateway runtime P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S 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.

Config patch restart notice is misleading; should say 'restart required'

3 participants