Repository navigation
fix: persist doctor migrations for explicit agent rosters - #134758
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Verified the actual CI-built CLI from head 420a21d using fresh temporary homes and service repair disabled. All four cases passed:
Each fixture already had Commands: The first CI run found two lint issues (duplicate import and test-fixture map/spread). Commit d3f84d3 fixes only those mechanically; targeted lint and 22 regression tests pass, and fresh Codex autoreview is scoped-clean at P0. CI is rerunning on that head. Final production delta: -125 lines; tests +133; docs +2. |
|
Final-head CLI confirmation: the Artifact provenance: GitHub built merge ref |
|
Codex review: found issues before merge. Reviewed September 1, 2026, 12:05 AM ET / 04:05 UTC. ClawSweeper reviewWhat this changesThe branch makes Doctor apply legacy per-agent configuration migrations to explicit keyed and list-based agent rosters, then persist the valid canonical configuration. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep this maintainer-authored PR open, but it needs one correction: the new shared traversal processes a discarded legacy list even when keyed entries are canonical, allowing that discarded data to create global vLLM compatibility settings. Priority: P1 Review scores
Verification
How this fits togetherDoctor migrates an operator’s legacy configuration before validating and writing it back. Per-agent migrations run before the legacy list-to-keyed-entry migration, so traversal precedence determines which roster can affect the final persisted configuration. flowchart LR
A[Operator configuration] --> B[Doctor migration registry]
B --> C[Per-agent roster traversal]
C --> D[Model compatibility migration]
D --> E[Canonical roster conversion]
E --> F[Validated persisted configuration]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource -125, Tests +133, Docs +2. Total +10 across 17 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Make the shared per-agent traversal honor the same precedence as roster conversion—visit keyed entries when present, otherwise visit the legacy list—and add a regression proving discarded-list model settings cannot alter the persisted model configuration. Do we have a high-confidence way to reproduce the issue? Yes, from source: use a config with agents.entries plus a residual agents.list whose sole agent has a legacy vLLM Qwen setting; the new traversal processes it before the registry drops the list. Is this the best way to solve the issue? No. The shared traversal is the right owner boundary, but it must encode the established entries-over-list precedence rather than visit both authored shapes together. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 742801a82aee. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Main advanced during landing: 494f862 independently repaired the memory-search slice of this defect for #134256. The first merge attempt stopped before dispatch because that change conflicted with the broader shared traversal here. Head 37d257d integrates that repair, retains its stronger Doctor process regression, and uses one traversal for the remaining per-agent model-timeout, sandbox, TTS, vLLM, and policy migrations. There is no parallel memory-migration implementation or lost upstream test coverage. After conflict resolution, 441 tests passed across ten files, including the new upstream process regression and Gateway startup/repair process cases. Fresh Codex autoreview is scoped-clean at P0. Relative to the integrated main baseline, production is -131 lines, tests +133, docs +2. Exact-head CI is running again before merge. The resolved migration modules, new workspace-persistence regression, and Doctor docs are byte-for-byte identical to the previously CLI-tested head ( |
|
Addressed the P1 canonical-precedence finding and both Rank-up moves in 9815e22. The shared visitor now returns after visiting a record-shaped The new regression failed before the change: a discarded list containing a legacy vLLM Qwen setting created The earlier 441-test integration run and passing CI are retained as prior proof. Exact-head CI and the mixed-roster built-CLI rerun are pending before landing. Final delta against integrated main: production -129, tests +148, docs +2. |
|
The latest run failed the unrelated Control UI startup-size check: 348,480 bytes gzip against a 348,368-byte limit. Doctor migrations do not enter the UI bundle. Main has since landed the UI simplification in #134791, whose CI measured 348,247 bytes and passed that gate. Head 8263910 incorporates current main without changing any Doctor migration code, regression, or documentation from 9815e22. The merge was conflict-free; fresh Codex autoreview is scoped-clean at P0. Exact-head CI is running again, followed by the mixed-roster built-CLI confirmation before landing. |
|
The refreshed main combination still measured 348,462 bytes against the 348,368-byte startup budget. Head 3c0bce2 fixes that blocker by moving two explanatory comments out of boot HTML template strings and into ordinary TypeScript source comments. It preserves the rendered markup, bindings, styles, and the existing size limits. This is a two-file, four-line net reduction; no visual change requires screenshot evidence. The cleanup passed formatting, diff checks, and fresh Codex autoreview at P0. Removing the exact comment strings from the earlier built startup chunk estimates a 227-byte gzip saving; that estimate is not a substitute for the new hosted build. Local standalone Vite encountered the same stale shared pako installation already recorded above; dependencies were not modified. Final CI and built-CLI proof follow on this head. |
|
Final built-CLI proof passed at head 3c0bce2, using the For explicit ownership with both canonical entries and a residual legacy list: config validation exited 1 before repair; Artifact build-info identifies merge ref 08075d3ce1d1e14506fd7a00e304e7d3210d5a29. Its verified parents are main 84648e8 and PR head 3c0bce2. The earlier keyed/list × direct/update four-case CLI matrix remains covered by the unchanged Doctor source. The final hosted build also passed the unchanged Control UI budget: 348,197 bytes startup gzip against 348,368 bytes. The tiny template-comment cleanup resolved the unrelated CI build failure without changing UI behavior. Fresh Codex autoreview is scoped-clean at P0. The latest ClawSweeper P1 and both Rank-up moves are addressed with source, regression, and actual CLI proof. |
|
Merged via squash.
|
…34758) * fix: persist doctor migrations for explicit agent rosters * style: satisfy doctor migration lint rules * fix: preserve canonical roster precedence during migration * perf(ui): keep template explanations out of startup assets
Related: #133984. Follow-up to #134706.
What Problem This Solves
Fixes an issue where users running
openclaw doctor --fixafter an upgrade could still get “No config changes were written” withagents.ownership="explicit"already configured. Legacy per-agentmodel.timeoutMsremained invalid, while other skipped legacy settings such asmemorySearchandsandbox.perSessioncould be silently removed by unknown-key cleanup.Why This Change Was Made
Config snapshots normalize
agents.listintoagents.entriesbefore Doctor runs legacy migrations. Several migration and detection paths still visited only lists, so they missed both normalized and already-keyed fleets. One shared mutable traversal now handles agent defaults and either authored roster shape, with canonical entries taking precedence over a residual list; the existing migration registry remains the owner of conversion, validation still gates writes, and explicit canonical values retain precedence.The same traversal replaces duplicate walks in neighboring memory, sandbox, runtime-policy, TTS, vLLM, and retired-key migrations. While this PR was being verified, main separately landed the memory-search repair in 494f862 for #134256; this PR integrates it and retains its stronger process regression while repairing the remaining per-agent paths. Ambiguous legacy model-policy wildcards remain migration blockers rather than widening policy. No config options, schemas, dependencies, runtime compatibility readers, or ownership-write rules are added. Production delta: -133 lines; tests +148; docs +2.
CI maintenance: current main exceeded the Control UI startup gzip budget. Two non-rendering HTML comments in boot templates now remain as TypeScript source comments, preserving their explanations without shipping them. Markup, bindings, styles, and budget limits are unchanged. The final hosted build measured 348,197 bytes startup gzip, below the unchanged 348,368-byte limit.
User Impact
Doctor can persist the canonical per-agent configuration even when ownership was already explicit, including when called by the updater. It preserves supported memory and sandbox settings, removes ignored model-selection timeout keys, and leaves a valid configuration that requires no second migration pass. The Doctor documentation describes this behavior.
This fixes a demonstrated failure mode in #133984, not every independently reported failure in that issue. The original reporter's complete config and WSL/systemd environment were unavailable.
Evidence
agents.entries.ops.model: Invalid input. A separate reproduction without that union-validation blocker silently lost memory and sandbox settings.v2026.7.1-2accepted per-agent memorySearch;v2026.8.1snapshot loading normalizes rosters before migration. Zod's strict-object union errors explain why generic unknown-key cleanup cannot repair the model-timeout case.[email protected]where the lockfile requires3.0.1; clean hosted CI owns the remaining verification.Remaining follow-up identified during source review:
pruneBindingsForMissingAgentsstill derives its deletion roster from legacy lists and needs separate routing/deletion-policy work. The WhatsApp legacy-list identity fallback identified during review was independently moved to the plugin Doctor owner, using canonical entries, by main commit a514fc0 while this PR landed. The merge preserves that upstream change.