#Error: Embedded agent failed before reply:

1 messages · Page 1 of 1 (latest)

leaden hawk
#

My openclaw bot made an update itself, and then it crashed and can't respond to any messages.

19:36:02 warn model-catalog {"subsystem":"model-catalog"} Failed to load model catalog: TypeError: Cannot read properties of undefined (reading 'map')
19:36:11 debug diagnostic {"subsystem":"diagnostic"} lane enqueue: lane=session:agent:main:main queueSize=1
19:36:11 debug diagnostic {"subsystem":"diagnostic"} lane dequeue: lane=session:agent:main:main waitMs=20 queueSize=0
19:36:11 debug diagnostic {"subsystem":"diagnostic"} lane enqueue: lane=main queueSize=1
19:36:11 debug diagnostic {"subsystem":"diagnostic"} lane dequeue: lane=main waitMs=1 queueSize=0
19:36:11 error diagnostic {"subsystem":"diagnostic"} lane task error: lane=main durationMs=8 error="TypeError: Cannot read properties of undefined (reading 'map')"
19:36:11 error diagnostic {"subsystem":"diagnostic"} lane task error: lane=session:agent:main:main durationMs=13 error="TypeError: Cannot read properties of undefined (reading 'map')"
19:36:11 error Embedded agent failed before reply: Cannot read properties of undefined (reading 'map')

faint yarrowBOT
#

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

last swanBOT
#

That model-catalog … Cannot read properties of undefined (reading 'map') looks like a bad models.providers.google entry (Google provider present, but its models array is missing) + a recent regression that doesn’t guard that case. The result is the gateway can’t build the model catalog, and the embedded agent crashes before it can reply.

1) First: grab version + a safe status dump

On the machine running the Gateway, paste:

openclaw --version
openclaw status --all

(status --all is designed to be shareable; it redacts tokens.)
Docs: https://docs.openclaw.ai/help/faq#first-60-seconds-if-somethings-broken

2) Quick workaround (usually fixes it immediately)

Check your config (~/.openclaw/openclaw.json, or ~/.openclaw-<profile>/openclaw.json) for something like:

#
models: {
  providers: {
    google: { /* ... */ }
  }
}

If you see providers.google, do this:

  • Remove/comment out the entire google: provider block (don’t post keys here).
  • Put your key in the env instead (recommended for built-in providers):
    • add to ~/.openclaw/.env:
      GEMINI_API_KEY=...your key...
      
  • Restart the gateway:
#
openclaw gateway restart

Then tail logs:

openclaw logs --follow

Model providers doc (note “built-in providers need no models.providers”): https://docs.openclaw.ai/concepts/model-providers
Troubleshooting ladder: https://docs.openclaw.ai/gateway/troubleshooting

3) If you don’t have models.providers.google

Then we need the stack trace / more context: please paste the output of openclaw status --all and the next ~30 lines after that error from openclaw logs --follow (redacted is fine).

If this turns out to be the regression I think it is, it’s GitHub-issue-worthy; but the workaround above should get you unwedged fast.

leaden hawk
#

openclaw status --all -- is to big to be posted. Here is my models: "models": {
"providers": {
"ollama": {
"api": "ollama",
"apiKey": "ollama-local",
"baseUrl": "http://127.0.0.1:11434/v1",
"models": [
{
"contextWindow": 40960,
"cost": {
"cacheRead": 0,
"cacheWrite": 0,
"input": 0,
"output": 0
},
"id": "qwen3:8b",
"input": [
"text"
],
"name": "qwen3:8b",
"reasoning": true
},
{
"contextWindow": 204800,
"cost": {
"cacheRead": 0,
"cacheWrite": 0,
"input": 0,
"output": 0
},
"id": "minimax-m2.5:cloud",
"input": [
"text"
],
"maxTokens": 128000,
"name": "minimax-m2.5:cloud",
"reasoning": true
},
{
"cost": {
"cacheRead": 0,
"cacheWrite": 0,
"input": 0,
"output": 0
},
"id": "glm-5:cloud",
"input": [
"text"
],
"name": "glm-5:cloud",
"reasoning": true
}
]
}
}
} -- I'm running version 2026.2.25

last swanBOT
#

That helps — and the Cannot read … (reading 'map') error is very consistent with one provider entry having models missing/undefined inside the generated models.json (even if your current openclaw.json only shows ollama). This can happen because models.mode defaults to merge, so an older/stale provider (often google) can stick around in ~/.openclaw/agents/<agentId>/agent/models.json and break catalog loading after an update.

Fix (fast): regenerate models.json (keeps your real config)

On the gateway host, run:

# 1) find the generated models.json
ls -la ~/.openclaw/agents/*/agent/models.json ~/.openclaw/agent/models.json 2>/dev/null

# 2) see if there's a stale google provider (or anything unexpected)
grep -n '"google"' ~/.openclaw/agents/*/agent/models.json ~/.openclaw/agent/models.json 2>/dev/null

Then move it aside (don’t delete permanently yet):

#
# adjust the path to whatever "ls" printed (example uses agentId "main")
mv ~/.openclaw/agents/main/agent/models.json ~/.openclaw/agents/main/agent/models.json.bak
openclaw gateway restart

If you don’t have ~/.openclaw/agents/..., but instead a legacy path exists, do the same for ~/.openclaw/agent/models.json.

Optional hardening (prevents stale providers from lingering)

Set replace-mode so old providers don’t survive forever:

openclaw config set models.mode replace
openclaw gateway restart

If it still crashes after regenerating