Repository navigation
fix(doctor): update rehearsal fails on installs with no configured agents - #169516
Conversation
…ents An explicitly empty agent roster made the Memory Core host-event backup collector throw "No agents configured" during update-rehearsal inventory, and the Canvas collector could read a configured root through an unadmitted producer link before the inventory refused it. - resolveMemoryDreamingWorkspaces returns no workspaces for an empty roster instead of a guaranteed-throw implicit-default fallback. - The rehearsal inventory admits copied plugin migration roots before plugin collectors read them.
|
🦞👀 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. |
|
Codex review: needs maintainer review before merge. What this changesThis PR removes the default-agent fallback for empty rosters and inspects copied migration roots before plugin backup collectors read them. Example: Run update rehearsal with agents.entries set to {}.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Regression provenanceRegression provenance — verified: source commit Merge readiness✅ Ready for maintainer review Keep this PR open: it repairs source-verifiable Doctor rehearsal failures still present on current main, and the maintainer-authored keep-open guard applies; no introduced correctness defect was found. Priority: P1 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe updater prepares a disposable state copy, and Doctor inventories its configuration, databases, and plugin migration resources before allowing maintenance. flowchart TD
A[Update command] --> B[Disposable state copy]
B --> C[Doctor rehearsal inventory]
C --> D[Strict path inspector]
D --> E[Plugin backup collectors]
E --> F[Admitted migration inventory]
Technical reviewBest possible solution: Use the shared roster owner for workspace enumeration and the existing strict path inspector before collector reads. Do we have a high-confidence way to reproduce the issue? Current source deterministically reaches a throwing default-agent lookup for agents.entries = {}, and the producer test exercises unsafe Canvas-root admission; execution results were reported by the maintainer and were not rerun during this read-only review. Is this the best way to solve the issue? The patch fixes both causes at their existing owners, preserves absent-roster compatibility and post-collector inspection, and continues propagating genuine collector read errors. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d178bb8fdd1e. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +5, Tests +4. Total +9 across 3 files. Added test files: 0. View PR surface stats
LabelsLabel changes: No label changes. Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 HistoryReview history (1 earlier review cycle)
Reviewed October 11, 2026, 10:07 PM ET / October 12, 2026, 02:07 UTC (Revision 2). |
…ents (#169516) An explicitly empty agent roster made the Memory Core host-event backup collector throw "No agents configured" during update-rehearsal inventory, and the Canvas collector could read a configured root through an unadmitted producer link before the inventory refused it. - resolveMemoryDreamingWorkspaces returns no workspaces for an empty roster instead of a guaranteed-throw implicit-default fallback. - The rehearsal inventory admits copied plugin migration roots before plugin collectors read them. (cherry picked from commit f379f15)
…primary-workspace Resolves the test conflict with openclaw#169516, which added its explicitly-empty-roster test at the same spot as this branch's known-primary-workspace test; both tests are kept. dreaming.ts merged cleanly and the fix is unchanged.
…ents (openclaw#169516) An explicitly empty agent roster made the Memory Core host-event backup collector throw "No agents configured" during update-rehearsal inventory, and the Canvas collector could read a configured root through an unadmitted producer link before the inventory refused it. - resolveMemoryDreamingWorkspaces returns no workspaces for an empty roster instead of a guaranteed-throw implicit-default fallback. - The rehearsal inventory admits copied plugin migration roots before plugin collectors read them.
… migrations move them (#169436) Backport of 7187a9a (#169436) adapted for 2026.10.3, squashed with its companion f379f15 (#169516), which fixes the no-agents rehearsal regression #169436 introduces. Resolved the doctor-migration-resources test conflict to main's undeclared-owner shape and strip the now-declared Canvas inventory in the 10.3-only per-owner warning test. (cherry picked from commit 7187a9a) (cherry picked from commit f379f15)
Related: #169436
What Problem This Solves
Fixes:
openclaw update's Doctor rehearsal inventory fails with "No agents configured" on installs whose agent roster is empty, a regression from #169436 that blocks the 2026.10.5-beta.2 release (FRVdoctor-update-rehearsal-producertest).User Impact
User impact: updates and
openclaw doctorwork again on installs with no configured agents, and a Canvas root pointing through an unsafe link is refused by the rehearsal's own link check instead of failing with a misleading Canvas read error. When workspaces exist, their Memory Core and Canvas migration files are still captured before migrations move them.Why This Change Was Made
#169436 added backup collectors that run during rehearsal inventory without the guard the Doctor migration runner puts around
detectLegacyState. A failingdetectjust becomes aFailed detecting …warning. A failing collector aborts the whole inventory.resolveMemoryDreamingWorkspacesfell back toresolveDefaultAgentIdwheneverlistAgentIdsreturned nothing.listAgentIdsreturns an empty list only for an explicitly empty roster, because raw pre-roster configs still get the legacy implicit id. In that stateresolveDefaultAgentIdalways throws. That fallback was left over when refactor(agents): move implicit-main fallback into load-time roster injection #112678 removed the runtimemainfallbacks. An empty roster has no agent workspaces, so the resolver now returns[]. This also stopsdetectandmigrate(and the runtime dreaming callers, which already treat an empty list as a no-op) from warning or throwing on that config.readdirs through a producer code link and threwENOTDIRbefore the inventory could refuse the link. Copied roots inside the rehearsal state are now admitted with the existinginspectPathbefore any collector reads them. External roots stay unread and are deferred exactly as before, and the post-collector admission is unchanged.Collectors stay fail-closed: real read errors (for example EACCES on a Canvas root) still abort the inventory.
Evidence
origin/main(a4d915f206e):pnpm test src/commands/doctor-update-rehearsal-producer.test.ts --maxWorkers=1fails withNo agents configured(stack throughresolveMemoryDreamingWorkspaces→collectLegacyMemoryHostEventSources→hostEventsStateMigration.collectBackupResources→inspectPreparedDoctorRehearsal). With only the roster fix, the same test fails next withCannot read Canvas documents … ENOTDIRinstead of the expectedunsafe ownership or linksrefusal.pnpm test src/commands/doctor-update-rehearsal-producer.test.ts extensions/memory-core/doctor-migration-inventory.test.ts src/commands/doctor-rehearsal-capture.test.ts src/plugins/doctor-migration-resources.test.ts src/memory-host-sdk/dreaming.test.ts --maxWorkers=1passes (4 shards, 58s wall). Siblingssrc/commands/doctor-update-rehearsal-inventory.test.ts,extensions/memory-core/src/dreaming.test.ts, andextensions/memory-core/src/session-ingestion.test.tsalso pass.src/memory-host-sdk/dreaming.test.ts> "returns no workspaces for an explicitly empty roster": 3ms, pure unit, no I/O.pnpm check:changed: typecheck core, core tests, and boundary/ratchet checks pass. Its only failure is the dead-export scan, which lists unrelated pre-existing exports (reef, ui, gateway) and none in the touched files.oxlinton the touched files is clean.git merge-tree --write-tree --merge-base=<fix>^ origin/release/2026.10.5 <fix>applies cleanly.scoped-clean. The ClawSweeper review at51b7820844fhas no findings and nothing under "Before merge".Inherited CI failures (also fail on clean
main)CI run 38192988803, attempt 2 (fail-fast cancelled the attempt-1 siblings, so they were rerun to completion). Every PR-related job passed except these two, and both fail identically on clean
main(f9d2ebefe12) without this change:checks-node-compact-small-1:test/scripts/eager-import-closure.test.ts> "resolves wrapper package exports and workspace aliases from the extracted dependency context" expects[]and receivessrc/chat/sender-identity.ts,src/sessions/input-provenance.ts,src/sessions/user-turn-transcript.metadata.ts(chat/transcript import closure). It is reproduced locally on clean main withpnpm test test/scripts/eager-import-closure.test.ts --maxWorkers=1.checks-node-changed-extensions-bundle-1:extensions/memory-core/src/session-backfill.test.ts> "keeps a deleted/replaced source out of backfill during admission preparation" (2 tests). It is reproduced locally on clean main and on this branch with the same 2 failures (pnpm test extensions/memory-core/src/session-backfill.test.ts --maxWorkers=1). Its fixtures configure agents, so the empty-roster change does not apply to them.