#9127: fix(doctor): clarify default agent labeling
commands
stale
## Summary
- Show `(default)` label only for agents that have `default: true` explicitly set in config
- Previously the label was shown for the first agent in the list regardless of config, which confused multi-agent users about which agent handles unrouted messages
- Added `isExplicitDefault` flag to `AgentHealthSummary` to distinguish between explicit `default: true` and implicit fallback-to-first
Fixes #8947
## Test plan
- [x] `pnpm build && pnpm check && pnpm test` passes (207/207 tests)
- [ ] `openclaw doctor` shows `(default)` only for the agent with `default: true`
- [ ] `openclaw agents list` reflects explicit default correctly
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR refines how “(default)” is displayed for multi-agent setups by distinguishing between the *effective* default agent (fallback-to-first behavior) and an agent explicitly marked with `default: true` in config.
Concretely:
- `AgentSummary` now includes `isExplicitDefault`, and `openclaw agents list` uses it to render the “(default)” tag.
- `health` snapshots and `openclaw doctor`/health output now carry `isExplicitDefault` through `AgentHealthSummary` and use it when printing agent labels.
- Tests were updated to assert explicit vs implicit default handling.
Overall this aligns the CLI/UI labeling with config intent while preserving the existing `isDefault` semantics for routing behavior.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk.
- Changes are narrowly scoped to labeling/summary output, preserve existing `isDefault` routing semantics, and add a separate `isExplicitDefault` signal that is only consumed in the updated output paths. No other parts of the repo reference these types, so API ripple is contained.
- No files require special attention
<!-- greptile_other_comments_section -->
<sub>(5/5) You can turn off certain types of comments like style [here](https://app.greptile.com/review/github)!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#15852: fix: pass agentId when resolving IRC session paths
by MisterGuy420 · 2026-02-14
77.3%
#16685: Fix cli agents/approvals/discord routing edge cases
by craftowen · 2026-02-15
77.3%
#22977: fix(ui): resolve agent names from config in session dropdown
by NikhilGaddam · 2026-02-21
76.6%
#16362: Update session-pruning.md - updated agents.defaults config std
by elliottb · 2026-02-14
76.3%
#12808: docs(subagents): clarify allowAgents is per-agent only
by JBrady · 2026-02-09
75.3%
#10182: fix: skip non-openclaw LaunchAgents in doctor gateway scan
by Yida-Dev · 2026-02-06
75.1%
#11602: fix(config): skip stale legacy config files when openclaw.json exists
by akoscz · 2026-02-08
74.9%
#19595: fix: elevatedDefault should default to off when tools.elevated.enab...
by guirguispierre · 2026-02-18
74.7%
#21742: fix(doctor): warn on conflicting exec approval config surfaces
by habakan · 2026-02-20
74.4%
#16899: feat(config): per-agent and per-model thinking defaults
by jh280722 · 2026-02-15
74.2%