Skip to content

bug: NEMOCLAW_EXTRA_AGENTS_JSON replaces agents.list entirely, displacing main agent as default #4562

@johnkhagler

Description

@johnkhagler

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

Metadata

Metadata

Assignees

Labels

area: cliCommand line interface, flags, terminal UX, or output

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions