Repository navigation
fix(cli): validate the loaded agent roster in fast config checks - #203520
Conversation
gateway status (fast path) and update status validated the authored file with validateConfigObjectRaw, skipping applyImplicitAgentRosterDefaults that the snapshot load applies, so a config without agents.entries was reported invalid while config validate said valid. Fixes #203505
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Observed proof (built CLI in a secretless node:24.22.1 container, empty profile per scenario, |
|
One additional reader has the same gap and is not in this PR's file set: It resolves the file itself ( $ OPENCLAW_STATE_DIR=... openclaw update check-release --json
{"ok":false,"reason":"config-invalid: agents.entries: agents.entries must contain at least one configured agent","surfaces":[]}With the same defaults-only config ( Applying const { resolvedConfigRaw } = resolveConfigForRead(included, env);
const validated = validateConfigObjectRaw(applyImplicitAgentRosterDefaults(resolvedConfigRaw), {
env,
});
Reproduced on |
|
Codex review: needs maintainer review before merge. What this changesThe two status commands apply existing implicit agent roster defaults before validating configuration. Example: Run openclaw models set openai/gpt-5 in an empty profile, then run gateway status and update status.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a confirmed diagnostic inconsistency with a small, complete change and no actionable findings. The reviewed head is mergeable; its CI gate is still pending. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherCLI status readers inspect authored configuration and produce configuration-health diagnostics; the normal snapshot loader already materializes the implicit main agent before validation. flowchart TD
A[Authored config] --> B[Fast Gateway status reader]
A --> C[Update status reader]
B --> D[Existing implicit roster normalizer]
C --> D
D --> E[Raw config validator]
E --> F[CLI health diagnostics]
Technical reviewBest possible solution: Reuse the existing roster normalizer immediately before both diagnostic validations while preserving authored configuration and genuine error reporting. Do we have a high-confidence way to reproduce the issue? Source tracing confirms that defaults-only agents reach raw validation without roster injection on the pinned base, matching the contributor's before-and-after CLI output; this read-only review ran no target code. Is this the best way to solve the issue? This is the smallest complete repair for the linked issue: it uses the established normalization owner, retains the fast import boundary, and avoids changing raw-validator or authored-reader contracts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 8d1e59c2fddc. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +2, Tests +3. Total +5 across 4 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 22, 2026, 10:29 AM ET / 15:29 UTC. |
|
Merged in b949a1c. Thanks @woodmanlegion for the precise report and reproduction in #203505. |
…nclaw#203520) Root cause: `src/cli/daemon-cli/status.config.ts:99` and `src/cli/update-cli/status.ts:333` validate the config as written with `validateConfigObjectRaw`, skipping `applyImplicitAgentRosterDefaults`, which the normal snapshot load applies first (`src/config/io.snapshot.ts:252`). The schema rule "agents.entries must contain at least one configured agent" is written for the loaded view, so a config without `agents.entries` fails it only in these two readers. Fixes openclaw#203505 Thanks @woodmanlegion for the report and the clear trace of the two readers. ## Problem A config with no `agents.entries` is supported since openclaw#112678: the normal load adds `{ main: {} }` in memory. `openclaw models set openai/gpt-5` in an empty profile writes exactly that shape. `openclaw config validate` and `openclaw gateway status --deep` say the config is valid, but `openclaw gateway status` (fast path) and `openclaw update status` mark it invalid and send the user to `doctor --fix`, which finds nothing. ## Fix The two fast readers now run the existing `applyImplicitAgentRosterDefaults` before `validateConfigObjectRaw`, the same order the snapshot load uses. No second implementation, no schema change, no config write: the file is unchanged and real config errors still report as before. Callers of the raw validator checked: - `gateway status` fast path (`readFastStatusConfig`): had the gap, fixed. - `update status` (`readSourceConfigBestEffort` + raw check): had the gap, fixed. Other callers of `readSourceConfigBestEffort` do not validate. - Doctor repair, heartbeat repair, setup native runtime: validate `snapshot.sourceConfig` or a loaded config, already normalized. ## Evidence Built CLI in a secretless `node:24.22.1` container, empty profile per scenario, `openclaw models set openai/gpt-5`, then the four commands. Full output: openclaw#203520 (comment) | Scenario | Build | gateway status | update status | config validate | gateway status --deep | |---|---|---|---|---|---| | defaults only (no `entries`) | main | invalid | invalid | valid | valid | | defaults only (no `entries`) | this PR | valid | valid | valid | valid | | explicit `entries.main` | main / this PR | valid | valid | valid | valid | | `ownership: "explicit"`, no entries | main / this PR | invalid (same message) | invalid | invalid | invalid | | `gateway.port: "not-a-port"` | this PR | invalid (port issue only) | invalid | invalid | invalid | On main the port scenario also lists the false `agents.entries` line next to the port issue in the two fast commands; this PR drops only that line. The config file hash is unchanged after every run. Tests: two existing fast-read cases (`status.gather` fast config read, `update status` remote JSON) now carry a defaults-only `agents` section; both fail on main and pass here. Size: production +4/-2, tests +3/-0 against the merge base; no new helper, flag or state. ## Merge danger Two-way door: read-only diagnostics, no state or config written; a revert fully restores the old output. Blast radius: the config-validity lines of `openclaw gateway status` (fast path) and `openclaw update status`. Co-authored-by: Ayaan Zaidi <[email protected]>
…ate acts on it (#201668) * fix(update): verify recorded data-at-risk marks before repair acts on them * fix(update): verify any unverified data-at-risk mark and honor receipts in handoff recovery * fix(update): recognize a Git release-mode service as its checkout's own * fix(update): check a recorded data-at-risk mark before the next update, including already-current runs * fix(update): lead data-at-risk refusals with triage and record them on the refused run * fix(update): keep data-at-risk refusals within the recorded warning limit * test(e2e): finish the seeded data-at-risk run with a terminal phase * fix(update): name the agent route in killed-update recovery refusals * fix(update): drop an unused import * test(update): expect the agent route in killed-update refusals * fix(update): verify the newest mark before restoration without comparing run ids * fix(update): address review: keep the Gateway down on any inconsistent mark, resolve all marks, harden release ownership * fix(update): break the admission-root import cycle and type the e2e schema read * fix(update): address rating findings: agent rollback leftovers, helper restart, blocking findings first, shared Git metadata * test(e2e): prove the next plain update resolves a mark with the Gateway running * fix(update): address rating round 2: refuse marks before Doctor, registry-based rollback check, handoff fallback, async history read * test(update): pick the repair run, not a settlement row, in the data-at-risk cell * fix(update): resolve live-writer marks after Doctor holds the state * fix(doctor): say a skipped stale-Gateway stop left the PID running * fix(update): address rating round 3: leftovers before deferrals, retained rollback files, refusal after Doctor fails finalization * docs(update): note retained rollback files and refusals after Doctor * fix(doctor): say a stale Gateway stop could not be confirmed when nothing shows it running * fix(update): address landing review: revert release-mode ownership, check leftovers first, handoff entry guard, durable rollback evidence * test(update): follow main's Git release link layout in the launcher refusal test * fix(update): treat uninspectable leftovers and unreadable databases as unchecked; true wording after Doctor Release adaptation: Retain the stable installed-recovery harness. Do not add main's installed Docker service cell, later retired by #203808, or Git release-launcher wording/test because stable uses the in-place Git updater. Keep the state-verification, next-update, repair and interrupted-handoff paths and their compatible regressions. Companion audit: #203486 is present-equivalent at 3081077 (preserved). #201978 is selected next in this lane. #203808 and #203966 involve the inapplicable installed service-cell layout; #203497 and #203194 change main's package/Git activation layout and are not applicable; #204017 depends on that release-install layout. #204077, #204043, #203555 and #203520 are independent authority, cleanup, helper-fixture and config-validation changes. #204151, #203917, #203849 and #203406 are separate guidance, cleanup or status changes, not required by the data-risk verifier. #203569 fixes a separate cron receipt fixture in the same Doctor suite; the touched stale-stop cases do not depend on it. (cherry picked from commit a28f211) Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit f8d4bc138ed2512c413cf96f66fe0eefb3b28d65)
Root cause:
src/cli/daemon-cli/status.config.ts:99andsrc/cli/update-cli/status.ts:333validate the config as written withvalidateConfigObjectRaw, skippingapplyImplicitAgentRosterDefaults, which the normal snapshot load applies first (src/config/io.snapshot.ts:252). The schema rule "agents.entries must contain at least one configured agent" is written for the loaded view, so a config withoutagents.entriesfails it only in these two readers.Fixes #203505
Thanks @woodmanlegion for the report and the clear trace of the two readers.
Problem
A config with no
agents.entriesis supported since #112678: the normal load adds{ main: {} }in memory.openclaw models set openai/gpt-5in an empty profile writes exactly that shape.openclaw config validateandopenclaw gateway status --deepsay the config is valid, butopenclaw gateway status(fast path) andopenclaw update statusmark it invalid and send the user todoctor --fix, which finds nothing.Fix
The two fast readers now run the existing
applyImplicitAgentRosterDefaultsbeforevalidateConfigObjectRaw, the same order the snapshot load uses. No second implementation, no schema change, no config write: the file is unchanged and real config errors still report as before.Callers of the raw validator checked:
gateway statusfast path (readFastStatusConfig): had the gap, fixed.update status(readSourceConfigBestEffort+ raw check): had the gap, fixed. Other callers ofreadSourceConfigBestEffortdo not validate.snapshot.sourceConfigor a loaded config, already normalized.Evidence
Built CLI in a secretless
node:24.22.1container, empty profile per scenario,openclaw models set openai/gpt-5, then the four commands. Full output: #203520 (comment)entries)entries)entries.mainownership: "explicit", no entriesgateway.port: "not-a-port"On main the port scenario also lists the false
agents.entriesline next to the port issue in the two fast commands; this PR drops only that line. The config file hash is unchanged after every run.Tests: two existing fast-read cases (
status.gatherfast config read,update statusremote JSON) now carry a defaults-onlyagentssection; both fail on main and pass here.Size: production +4/-2, tests +3/-0 against the merge base; no new helper, flag or state.
Merge danger
Two-way door: read-only diagnostics, no state or config written; a revert fully restores the old output. Blast radius: the config-validity lines of
openclaw gateway status(fast path) andopenclaw update status.