#OPENCLAW v2026.4.2 — MULTI-AGENT INITIALIZATION BUG---

7 messages Ā· Page 1 of 1 (latest)

vale ocean
#

OPENCLAW v2026.4.2 — MULTI-AGENT INITIALIZATION BUG


VERSION:

pnpm openclaw --version → 2026.4.2


BEHAVIOR:

• Existing agents (systemarchitect) execute normally
• ANY newly created agent hangs on execution
• Reproducible across names, templates, and cloned agents


CONFIRMED:

• Session state cleared → no change
• /tmp runtime cleared → no change
• Gateway restarted → no change
• Agent cloned from working agent → still hangs
• Minimal prompt ("OK") → still hangs


CRITICAL:

• systemarchitect works immediately
• trading-desk (and any new agent) hangs
• failure occurs ONLY during new agent initialization


QUESTION:

Given v2026.4.2 and known multi-agent fixes earlier in 2026:

Is this a known bug in:

• agentDir resolution
• auth-profiles initialization
• sessionFile path handling
• bootstrap state machine


REQUEST:

Identify exact root cause for this version and provide minimal fix

NOT workaround

whole oakBOT
timber cargoBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> āœ… Mark Solution

whole oakBOT
opaque fractalBOT
#

I dug through v2026.4.2.

This is not agentDir, not auth-profile init, and not the old sessionFile path bug.

The matching regression is in non-default agent workspace resolution:

  • File: src/agents/agent-scope.ts
  • Function: resolveAgentWorkspaceDir(cfg, agentId)

In v2026.4.2 it does this:

  • default agent → uses agents.defaults.workspace
  • non-default agent without its own explicit agents.list[].workspace → wrongly falls back to
    path.join(resolveStateDir(process.env), "workspace-" + id)

So if systemarchitect is the existing/default working agent, it keeps the correct workspace.
A new agent like trading-desk gets a different fresh workspace on first init, which is why the failure is new-agent-only.

#

The later fix is:

  • 94e170763e5776f39fbf86a2b9ff6d9a1ab79fca
  • fix: respect agents.defaults.workspace for non-default agents (#59789)

Minimal fix

Cherry-pick that commit, or patch resolveAgentWorkspaceDir() like this:

const defaultAgentId = resolveDefaultAgentId(cfg);
const fallback = cfg.agents?.defaults?.workspace?.trim();

if (id === defaultAgentId) {
  if (fallback) {
    return stripNullBytes(resolveUserPath(fallback));
  }
#
  return stripNullBytes(resolveDefaultAgentWorkspaceDir(process.env));
}

if (fallback) {
  return stripNullBytes(path.join(resolveUserPath(fallback), id));
}

const stateDir = resolveStateDir(process.env);
return stripNullBytes(path.join(stateDir, `workspace-${id}`));

So the exact answer is:

  • Category: bootstrap/init path
  • Exact root cause: wrong workspace resolution for new non-default agents in v2026.4.2
  • Minimal fix: apply 94e170763e5776f39fbf86a2b9ff6d9a1ab79fca