Root Cause
When NEMOCLAW_EXTRA_AGENTS_JSON is non-empty, the Dockerfile Python bake script does:
config['agents'].update({'list': extra_agents}) if extra_agents else None
This replaces agents.list wholesale. With only e.g. [research], the main agent entry is gone from config entirely.
Impact
OpenClaw's resolveDefaultAgentId (src/agents/agent-scope.ts) falls back to agents[0] when no entry has default: true. So the first extra agent becomes the dashboard/session default, displacing the intended primary agent.
Reproduction
Set NEMOCLAW_EXTRA_AGENTS_JSON to a non-empty JSON array and onboard. The first extra agent will be the default instead of main.
Fix
Prepend a canonical main entry before extra agents in the bake step:
main_entry = {
'id': 'main',
'default': True,
'workspace': '/sandbox/.openclaw-data/workspace',
'agentDir': '/sandbox/.openclaw-data/agents/main'
}
config['agents']['list'] = ([main_entry] + extra_agents) if extra_agents else [main_entry]
Workaround (no re-onboard)
Patch /sandbox/.openclaw/openclaw.json to prepend the main entry with default: true and restart the gateway inside the sandbox. Not persistent across sandbox recreate.
Related
#4560
Environment
- NemoClaw: 85b087d (local/nemoclaw-instance-fixes)
- OpenClaw: 2026.5.7
- OpenShell: v0.0.26
Root Cause
When
NEMOCLAW_EXTRA_AGENTS_JSONis non-empty, the Dockerfile Python bake script does:This replaces
agents.listwholesale. With only e.g.[research], themainagent entry is gone from config entirely.Impact
OpenClaw's
resolveDefaultAgentId(src/agents/agent-scope.ts) falls back toagents[0]when no entry hasdefault: true. So the first extra agent becomes the dashboard/session default, displacing the intended primary agent.Reproduction
Set
NEMOCLAW_EXTRA_AGENTS_JSONto a non-empty JSON array and onboard. The first extra agent will be the default instead ofmain.Fix
Prepend a canonical main entry before extra agents in the bake step:
Workaround (no re-onboard)
Patch
/sandbox/.openclaw/openclaw.jsonto prepend the main entry withdefault: trueand restart the gateway inside the sandbox. Not persistent across sandbox recreate.Related
#4560
Environment