Repository navigation
fix(doctor): stop false failures on multi-agent profiles - #124010
Merged
Merged
Conversation
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. |
steipete
marked this pull request as ready for review
August 15, 2026 04:38
Contributor
Author
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Aug 16, 2026
…4010) * fix(doctor): resolve multi-agent health owners * fix(doctor): keep bare json exit advisory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
Fixes an issue where
openclaw doctorinvented failures on an ordinary explicit multi-agent roster. A profile created byopenclaw agents addwithmain,helper, andthirdplusagents.defaults.systemAgent.agentId = "main"produced this JSON error:{ "checkId": "core/doctor/skill-workshop-tool-policy", "severity": "error", "message": "health check threw: Multiple agents are configured, but this operation has no explicit owner." }The same findings also made bare
doctor --jsonexit 1 while human Doctor exited 0, so selecting machine-readable output changed the advisory command's success contract.Why This Change Was Made
The Workshop check called
detectSkillWorkshopToolPolicyDiagnosticwithout its supportedagentIdargument. That fell throughresolveDefaultAgentId, which correctly rejects an unowned 2+ agent operation. Doctor now evaluates every configured agent and emits one targeted warning per affected agent; selecting only the ambient system agent would have hidden broken helper-agent policy, and the finding already owns atargetfield.The bounded sweep also moves other Doctor/setup paths to their actual owner boundary:
Bare
doctor --jsonstill runs the default read-only checks and preservesok: falseplus the findings, but exits 0 after producing the payload. Explicitdoctor --lintanddoctor --lint --jsonretain threshold-based exit 1 for CI. Fatal errors before a report remain nonzero.The exit decision is history-backed: ordinary Doctor's forced advisory success predates the current wrapper (
0aa28c71cabb), installers treat nonzero Doctor as a failed install/update, and explicit lint gating was added separately in9a5f2f61e76fwith “without --lint, doctor runs unchanged.” The mismatch appeared when bare JSON began implying lint in6093e3477d80.Remaining setup-owner decisions are intentionally not blanket-rewritten: generic
setup/onboard, memory-import migration staging, and system-agent inference activation need an explicit product decision about which agent owns an existing multi-agent setup. They continue to reject real ambiguity.User Impact
Operators can run Doctor on supported explicit multi-agent profiles without false
health check threwfindings. Per-agent Workshop policy problems remain visible and actionable. Human and bare-JSON Doctor both preserve advisory exit 0; automation that wants a failing gate uses explicit--lint.Evidence
Pre-fix, built from the original branch base on an isolated Testbox profile created with
agents add:Post-fix, exact rebased head, fresh build, isolated
OPENCLAW_STATE_DIR,OPENCLAW_CONFIG_PATH, andOPENCLAW_SKIP_CHANNELS=1:Focused regression command:
Result: 213 tests passed across 5 Vitest shards. The regression tests were first run against pre-fix source and failed for the intended Workshop throw and bare-JSON exit 1.
Additional proof:
pnpm build: passed;origin/maincannot complete a frozen install becausepnpm-lock.yamllacks@oxc-parser/[email protected]. Focused exact-head tests and build passed independently.Production LOC: +95/-49 (net +46) | Tests: +449/-111 | Docs: +25/-18. The positive production delta is the explicit ownership work needed to replace six throwing scalar/default-agent paths with roster iteration or legacy/system-agent ownership; it adds no config or compatibility fallback.