Skip to content

[Bug]: subagent normal completion logged as error level — "run ended with stopReason=stop" #101695

Description

@Nelsoncongbao

Description

On OpenClaw 2026.7.1-beta.2, when a subagent spawned via sessions_spawn completes successfully (with output, task done), the gateway logs record the completion as error level instead of info:

2026-07-07T21:19:16.836+08:00 error [agent] run <runId> ended with stopReason=stop
2026-07-07T21:19:26.808+08:00 error [agent] run announce:v1:agent:executor:subagent:<id>:<runId> ended with stopReason=stop

The subagent actually completed successfully — it produced output, the parent session received the result, and the task was verified as done. There is no actual failure.

Expected behavior

stopReason=stop on a successful subagent run should be logged at info level, not error level.

Regression

On older logs (April 2026, pre-2026.5.x), the same stopReason=stop message appeared at info level (no error prefix). This appears to be a regression introduced in a recent version.

Note: This is distinct from the known stopReason=stop payloads=0 failure case (where the agent actually failed to generate a response). In our case, payloads > 0 and the task completed successfully.

Environment

  • OpenClaw version: 2026.7.1-beta.2 (a580a7f)
  • OS: macOS 26.5.2 (arm64)
  • Node: v24.14.1
  • Subagent spawned via: sessions_spawn with mode="run" (background task)

Steps to reproduce

  1. Spawn a subagent with sessions_spawn(agentId="executor", mode="run", task="..."
  2. Wait for subagent to complete successfully
  3. Check gateway logs: openclaw logs --limit 200
  4. Observe error [agent] run ... ended with stopReason=stop even though task succeeded

Additional context

Related historical fix: #70396 ("stopReason=stop 时不再误报 Agent couldn't generate a response") — this regression may be related.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions