Skip to content

Hook/cron lanes resolve auth from hardcoded 'main' agent path, ignoring default agent #24016

Description

@abersonFAC

Description

When using a multi-agent setup with no agent named main, hook and cron lanes fail because they resolve auth from ~/.openclaw/agents/main/agent/auth-profiles.json instead of using the agent marked default: true in config.

Config

{
  "agents": {
    "list": [
      { "id": "dev", "name": "Dev Assistant" },
      { "id": "exec", "default": true, "name": "Executive Life Assistant" }
    ]
  }
}

No main agent exists. exec is marked as default: true.

Error

FailoverError: No API key found for provider "openai-codex". Auth store: /home/openclaw/.openclaw/agents/main/agent/auth-profiles.json (agentDir: /home/openclaw/.openclaw/agents/main/agent). Configure auth for this agent (openclaw agents add <id>) or copy auth-profiles.json from the main agentDir.

This affects multiple lanes:

  • lane=cron
  • lane=session:agent:exec:hook:gmail:*
  • lane=main
  • lane=session:agent:exec:main

Expected Behavior

When no main agent is defined, auth resolution should fall back to the agent marked default: true (in this case exec), not to a hardcoded agents/main/agent/ path.

Workaround

Symlink ~/.openclaw/agents/main/agent/auth-profiles.json → the default agent's auth file.

Version

OpenClaw 2026.2.21-2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions