Skip to content

[Bug]: Main agent can reply with raw exec timeout JSON after direct subagent handoff times out #52484

@MLachance42

Description

@MLachance42

Bug type

Crash (process/app exits or hangs)

Summary

In OpenClaw 2026.3.13 on macOS, when a main-agent exec call that runs openclaw agent --agent ... --json --timeout 90 times out, the user-facing reply can surface the raw timeout JSON instead of a plain-language failure message.

Steps to reproduce

Steps to reproduce

  1. Start OpenClaw 2026.3.13 on macOS with a main agent using local Ollama and at least one configured subagent.
  2. From WebChat, send a prompt that causes the main agent to run a direct subagent handoff through exec, for example openclaw agent --agent data --message "<task>" --json --timeout 90.
  3. Wait for the subagent handoff to exceed the 90 second timeout.
  4. Observe the main session reply.

Expected behavior

When the direct subagent handoff times out, the main agent should reply in plain language that the handoff timed out and is not confirmed, rather than surfacing the raw tool payload.

Actual behavior

After the direct subagent handoff timed out, the main agent replied with the raw JSON timeout payload:

{
  "status": "error",
  "tool": "exec",
  "error": "Command timed out after 90 seconds. If this command is expected to take longer, re-run with a higher timeout (e.g., exec timeout=300)."
}

OpenClaw version

2026.3.13 (61d171a)

Operating system

macOS 26.3.1

Install method

npm global

Model

ollama/qwen3.5:9b

Provider / routing chain

openclaw -> local Ollama at 127.0.0.1:11434

Additional provider/model setup details

The timed-out handoff was initiated by the main agent from WebChat using the exec tool to run openclaw agent --agent data --message "Add a simple local mission-creation path in the canonical repo that writes into the JSON-backed mission source, keeping the existing update path intact." --json --timeout 90.

Logs, screenshots, and evidence

Observed in the main session file:
- `~/.openclaw/agents/main/sessions/28631055-b69a-4fd3-b578-b5e67d781ec8.jsonl`
- User prompt timestamp: `2026-03-22T13:44:20.623Z`
- Tool call launched at `2026-03-22T13:45:00.324Z`
- Tool result timeout at `2026-03-22T13:46:30.385Z`
- Assistant raw timeout reply at `2026-03-22T13:46:35.201Z`

Observed in `~/.openclaw/logs/gateway.err.log`:
- `2026-03-22T09:46:30.380-04:00 [tools] exec failed: Command timed out after 90 seconds. If this command is expected to take longer, re-run with a higher timeout (e.g., exec timeout=300).`
- `2026-03-22T09:46:35.199-04:00 [ollama-stream] Ollama returned empty assistant content after tool result; using tool result fallback text (190 chars)`

Impact and severity

Affected: WebChat conversations with the main agent when it delegates to subagents through direct openclaw agent --agent ... exec calls
Severity: Medium
Frequency: Observed in at least 1 confirmed repro
Consequence: The user receives raw internal timeout payloads instead of a normal explanation, which makes the handoff state unclear and degrades trust in orchestration replies

Additional information

In the same session, the main agent had already produced a correct plain-language project status response, so the raw timeout payload appears specific to the timeout/fallback path after the subagent handoff failed to complete in time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingbug:crashProcess/app exits unexpectedly or hangs

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions