fix(cli): differentiate gateway-restart hint for hot-loadable agent config sets (#80722) - #80823
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 24, 2026, 2:20 AM ET / 06:20 UTC. Summary PR surface: Source +122, Tests +336. Total +458 across 3 files. Reproducibility: yes. Source inspection shows current main and Review metrics: 2 noteworthy metrics.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the current planner-backed CLI hint change if maintainers accept the compatibility-sensitive wording, and keep the broader deterministic apply-status contract in #83851. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current main and Is this the best way to solve the issue? Yes. Reusing actual config diffs, AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 9d381d4530b9. Label changesLabel justifications:
Evidence reviewedPR surface: Source +122, Tests +336. Total +458 across 3 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
|
|
This pull request has been automatically marked as stale due to inactivity. |
|
ClawSweeper PR egg: 🔥 warming; proof passed, review follow-up or readiness checks remain. Hatch with Rules and detailsHatchability:
About:
|
8389d28 to
0b18f14
Compare
|
@clawsweeper re-review Updated the PR to address the stale legacy runtime finding:
|
|
Updated against current Conflict resolution was limited to Local verification on the merge head: GitHub checks are running on the new head. |
|
Narrowed the branch to the intended CLI/gateway reload-hint diff. New head: This drops
Local verification on the narrowed head: GitHub checks at last poll had the previously failing branch-scope checks green: @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Addressed the changed-path planning blocker on head What changed:
Verification: @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Addressed the direct Changes made:
Verification: @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Addressed the current-head proof gap on head What changed:
Current-head live CLI proof added to the PR body: $ OPENCLAW_STATE_DIR=/tmp/openclaw-80823-proof-models.HdGPd1/state OPENCLAW_CONFIG_PATH=/tmp/openclaw-80823-proof-models.HdGPd1/openclaw.json OPENCLAW_NO_COLOR=1 node scripts/run-node.mjs config unset models
Removed models. Restart the gateway to apply.
$ OPENCLAW_STATE_DIR=/tmp/openclaw-80823-proof-plugins.gWf5XB/state OPENCLAW_CONFIG_PATH=/tmp/openclaw-80823-proof-plugins.gWf5XB/openclaw.json OPENCLAW_NO_COLOR=1 node scripts/run-node.mjs config unset plugins
Removed plugins. Restart the gateway to apply.Verification: @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Updated this branch against current The PR-visible diff after the merge is still limited to the config-hint implementation and focused CLI/gateway tests:
Current-head verification added to the PR body: @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Addressed the reload-mode hint finding on head What changed:
Verification: @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Status check on current head Review focus: the CLI apply hint should keep restart guidance when |
Summary
config set,config patch, andconfig unsetnow derive their post-write hint from the shared gateway reload plan instead of always printingRestart the gateway to apply.agents.list.*,agents.defaults.models.*, andmodels.*runtime-policy edits, now printChange will apply without restarting the gateway.Restart the gateway to apply.; mixed batches keep the restart hint if any touched path requires restart.agents.list[].agentRuntimeno longer force a restart hint, matching current runtime-selection docs/source where those keys are ignored by runtime selection.Closes #80722.
Why
The old CLI success text was stale after reload metadata landed:
agents.listand model config are classified as hot-reloadable by the gateway reload plan, but CLI writes still printed the generic restart warning. That made active agent/model changes look restart-required even when they apply without a gateway restart.The earlier implementation treated legacy per-agent
agentRuntime.idas load-bearing. Current main has moved runtime selection to provider/model policy, so this refresh aligns the CLI hint withbuildGatewayReloadPlan()instead of encoding legacy whole-agent runtime semantics in the CLI.Implementation
configApplyHintForPaths()/configApplyHintForOperations()insrc/cli/config-cli.ts.buildGatewayReloadPlan()with the changed config paths.restartGateway: true->Restart the gateway to apply.Change will apply without restarting the gateway.No gateway restart needed.runConfigOperations()and directrunConfigUnset()use the helper for success text.agentRuntime, provider runtime policy, restart-required gateway paths, and mixed hot+restart batches.Real behavior proof
Restart the gateway to apply.after hot-reloadable config writes such as active agent model updates. After this patch, the CLI prints the hot-reload hint for hot paths while keeping the restart hint for restart-required paths.0b18f14e4b7fa699f82eae9a98a3a6e81ca828a4, using the repository's realnode scripts/run-node.mjs configcommand against a temporaryOPENCLAW_CONFIG_PATH=/tmp/openclaw-80722.fpLUa4/openclaw.jsonfixture.Restart the gateway to apply..Current-head proof update (2026-06-20)
After the latest direct-unset change, I verified the broad root removals that ClawSweeper called out on head
01e96400a197.config unset modelswithmodels.pricing.enabledpresent:config unset pluginswithplugins.load.pathspresent:The first live proof attempt exposed the root cause: whole-object removals collapsed to
models/pluginsbefore reload planning, so restart-owned descendants such asmodels.pricing.*andplugins.load.*could be hidden. The latest patch expands whole-object add/remove diffs to their descendant paths before callingbuildGatewayReloadPlan(); config write behavior is unchanged.Verification
Compatibility / risk
Low behavior risk: this only changes CLI success text after config writes. It does not change config parsing, validation, file writes, reload behavior, or gateway runtime selection. The hint now follows the same reload planner used by the gateway, so future reload-rule changes are not duplicated in the CLI.
Current-head refresh, 2026-06-21
Updated this branch against current
mainto clear the red CI paths on headda00cc2d36be5599ef9338f95123bdd6e1eb4fe1. The PR-visible diff after the merge is still limited to:src/cli/config-cli.tssrc/cli/config-cli.test.tssrc/gateway/config-reload.test.tsVerification on head
da00cc2d36be5599ef9338f95123bdd6e1eb4fe1:Current-head repair, 2026-06-24
Addressed the reload-mode hint finding on head
f0a673bf52d3bd1ea6fc936c36361973ebe66fa7.gateway.reload.modefrom the post-write config before printing the hot-apply text.gateway.reload.mode=offandgateway.reload.mode=restartkeepRestart the gateway to apply.for hot-path edits, matching the gateway reload handler behavior.Verification on head
f0a673bf52d3bd1ea6fc936c36361973ebe66fa7: