Skip to content

fix(doctor): update rehearsal fails on installs with no configured agents - #169516

Merged
RomneyDa merged 1 commit into
mainfrom
fix/doctor-rehearsal-no-agents
Oct 12, 2026
Merged

RomneyDa merged 1 commit into
mainfrom
fix/doctor-rehearsal-no-agents

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

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 (FRV doctor-update-rehearsal-producer test).

User Impact

User impact: updates and openclaw doctor work 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 failing detect just becomes a Failed detecting … warning. A failing collector aborts the whole inventory.

  • Empty roster: resolveMemoryDreamingWorkspaces fell back to resolveDefaultAgentId whenever listAgentIds returned nothing. listAgentIds returns an empty list only for an explicitly empty roster, because raw pre-roster configs still get the legacy implicit id. In that state resolveDefaultAgentId always throws. That fallback was left over when refactor(agents): move implicit-main fallback into load-time roster injection #112678 removed the runtime main fallbacks. An empty roster has no agent workspaces, so the resolver now returns []. This also stops detect and migrate (and the runtime dreaming callers, which already treat an empty list as a no-op) from warning or throwing on that config.
  • Collector reads before admission: the inventory ran plugin collectors before it admitted the configured migration roots. The new Canvas collector then readdirs through a producer code link and threw ENOTDIR before the inventory could refuse the link. Copied roots inside the rehearsal state are now admitted with the existing inspectPath before 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

  • Red on clean origin/main (a4d915f206e): pnpm test src/commands/doctor-update-rehearsal-producer.test.ts --maxWorkers=1 fails with No agents configured (stack through resolveMemoryDreamingWorkspaces → collectLegacyMemoryHostEventSources → hostEventsStateMigration.collectBackupResources → inspectPreparedDoctorRehearsal). With only the roster fix, the same test fails next with Cannot read Canvas documents … ENOTDIR instead of the expected unsafe ownership or links refusal.
  • Green with this PR: 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=1 passes (4 shards, 58s wall). Siblings src/commands/doctor-update-rehearsal-inventory.test.ts, extensions/memory-core/src/dreaming.test.ts, and extensions/memory-core/src/session-ingestion.test.ts also pass.
  • New regression 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. oxlint on the touched files is clean.
  • Release branch: git merge-tree --write-tree --merge-base=<fix>^ origin/release/2026.10.5 <fix> applies cleanly.
  • Review: autoreview (Codex, P0–P2) came back scoped-clean. The ClawSweeper review at 51b7820844f has no findings and nothing under "Before merge".
  • Gap: no published-updater × candidate cell was run; per the task scope, only focused local proof was required. The release FRV covers that cell.

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 receives src/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 with pnpm 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.

…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.
@clawsweeper

clawsweeper Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@RomneyDa
RomneyDa marked this pull request as ready for review October 12, 2026 01:43
@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: XS labels Oct 12, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 12, 2026
@clawsweeper

clawsweeper Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This 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 {}.

  • Before: Memory Core workspace enumeration throws “No agents configured” and aborts inventory.
  • After: Workspace enumeration returns [] and inventory continues without inventing an agent.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The focused patch is source-consistent and supported by reported boundary regressions, with shipped-updater qualification still outstanding.
Proof confidence 🦐 gold shrimp (3/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Updates abort during Doctor rehearsal on empty-roster installations, and unsafe Canvas roots can produce a misleading collector read error.
Reason: Both changes repair the same rehearsal workflow, and the maintainer author's direction is already established.

Regression provenance

Regression provenance — verified: source commit 7187a9afa71a by Dallin Romney; canonical PR #169436 (blame-to-merge-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
Reviewed head: 51b7820844fbebc4fb0444dd6b48b27ac03f4117

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: No published-updater × candidate run from v2026.10.1 is supplied showing successful empty-roster rehearsal with existing settings and data preserved.
Agent review details

How this fits together

The 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]
Loading

Technical review

Best 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

  • Empty-roster workspace fallback changes intended behavior with a stated reason (bb440b3: The original enumerator built its own configured-agent list and supplied a default when that list was empty; later roster changes centralized legacy implicit ownership and made explicitly empty rosters ownerless.)
  • Configured migration-root admission keeps the original intent (fix(update): inspect plugin migration data before Doctor rehearsal #156326: Inspect copied migration data strictly while permitting producer-bound plugin code links and deferring external migration resources.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Dallin Romney: Raw commit febc700 adds src/memory-host-sdk/dreaming.ts:3 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: febc70036f29; files: src/memory-host-sdk/dreaming.ts)
  • Peter Steinberger: Raw commit 26d3b08 adds src/memory-host-sdk/dreaming.ts:583 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 26d3b08758fb; files: src/memory-host-sdk/dreaming.ts)
  • Jason (Json): Raw commit 4c46841 adds src/commands/doctor-update-rehearsal-inventory.ts:337 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 4c468412dfef; files: src/commands/doctor-update-rehearsal-inventory.ts)

PR surface

Source +5, Tests +4. Total +9 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 9 4 +5
Tests 1 4 0 +4
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 13 4 +9

Labels

Label changes:

No label changes.

Label justifications:

  • P1: A current-main regression aborts update rehearsal for empty rosters and is reported to block beta release validation.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Attach the scoped published-updater × candidate upgrade result with preserved settings and data, redacting credentials and non-public endpoints.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-12T01:49:12.606Z sha 51b7820 :: needs maintainer review before merge. :: none

Reviewed October 11, 2026, 10:07 PM ET / October 12, 2026, 02:07 UTC (Revision 2).

@RomneyDa
RomneyDa merged commit f379f15 into main Oct 12, 2026
238 of 272 checks passed
@RomneyDa
RomneyDa deleted the fix/doctor-rehearsal-no-agents branch October 12, 2026 02:24
RomneyDa added a commit that referenced this pull request Oct 12, 2026
…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)
MoerAI added a commit to MoerAI/openclaw that referenced this pull request Oct 12, 2026
…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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 12, 2026
…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.
RomneyDa added a commit that referenced this pull request Oct 13, 2026
… 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant