Repository navigation
Conversation
When the gateway runs in hot reload mode and a config write touches any restart-required path, the whole plan is dropped behind a single log.warn. Operators routinely miss this in log aggregator UIs and the runtime quietly serves a stale snapshot until manually restarted. Observed in production: `openclaw doctor --fix` migrated agents.defaults.models keys correctly but the auth.profiles rename in the same change set forced restart-required; in-memory agent kept resolving the old model id, every turn failed model lookup for 4 hours before manual launchctl kickstart -k recovered. Promote the log line to error so level=ERROR alert rules and Loki queries catch it, and include the remediation command verbatim so the operator does not have to look it up. Add a focused regression test that fakes hot mode, emits a restart-required watcher change, and asserts the new error message shape plus the absence of any hot-reload or restart calls. Mutation-verified: reverting to log.warn fails the new test on the 'log.warn was not called' expectation.
|
Codex review: needs real behavior proof before merge. Reviewed June 2, 2026, 2:28 PM ET / 18:28 UTC. Summary PR surface: Source +5, Tests +44. Total +49 across 2 files. Reproducibility: yes. from source inspection: configure hot reload mode, change a restart-required path such as Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the narrow diagnostic change after the contributor adds redacted after-fix real gateway proof for a hot-mode restart-required reload. Do we have a high-confidence way to reproduce the issue? Yes from source inspection: configure hot reload mode, change a restart-required path such as Is this the best way to solve the issue? Yes, this is the narrowest maintainable mitigation for operator visibility; partitioning mixed reload plans would be a larger behavior change outside this PR. AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 8bf6206a3e78. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +5, Tests +44. Total +49 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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
|
|
Consolidating with #89517. #89517 (which was opened earlier today, also under this account) addresses the same observed production failure — a hot-mode reload that drops the plan when any restart-required key is in the same change set — but with a stronger fix: instead of just promoting the log line, it actually queues the restart-required reload through the existing Closing this in favor of #89517. The log-promotion idea here may still be useful as a follow-up if maintainers want a louder signal when hot-mode autoschedules a restart, but I would rather not add it to #89517's diff until that scope is asked for. The originating incident ( |
Summary
In hot reload mode, when a config write touches any restart-required path, the runtime drops the whole reload plan behind a single
log.warn. Operators routinely miss this in log aggregator UIs and the runtime quietly serves a stale snapshot until a manual restart.Promote the log line to
error, include the remediation command verbatim, and add a focused regression test.Real environment tested
This was the production failure mode that motivated the PR. On a deployed gateway,
openclaw doctor --fixmigratedagents.defaults.modelskeys from legacy ids to canonical ids (a hot-reloadable change on its own) at the same time as renamingauth.profiles.*keys (restart-required). The auth-profile rename forced the whole plan to be classified as restart-required; in hot mode the whole plan was dropped with a singlelog.warn. The in-process agent kept resolving the legacy model id for ~4 hours, every Telegram turn aborted withFailoverError: Unknown model: ..., and the only operator-visible signal was admin DMs getting a cannedagent failedreply while group messages silently dropped.launchctl kickstart -kof the gateway recovered immediately because the disk config was already correct.Behavior addressed: hot mode silent config staleness when a restart-required key is in the same write as hot-reloadable keys.Real environment tested: deployed gateway (macOS, supervised via launchd, hot reload mode), Codex plugin externalized inv2026.6.2,agents.defaults.modelsandauth.profiles.*renamed in the samedoctor --fixchange.Exact steps or command run after this patch:Evidence after fix:Mutation-verified: reverting the
log.warn->log.errorpromotion fails the new test onharness.log.warn was not called.Observed result after fix: the existing log line is nowerrorlevel and reads:A level=ERROR alert rule on the gateway log stream will fire on this immediately, giving the operator a real signal instead of a buried
warnline. The remediation command is inlined so the operator does not have to look it up.What was not tested: this PR does not change the policy of dropping the whole plan when restart-required keys are present. Partitioning the plan and applying only hot-reloadable subsets would require key-dependency analysis and is intentionally out of scope.Verification
pnpm test src/gateway/config-reload.test.ts(79 passed locally)oxfmt --checkclean on both modified filesoxlintclean on both modified files