openclaw - 💡(How to fix) Fix [Bug]: openclaw agent CLI returns intermittent empty payloads for ACP agents (pi, opencode) — session/new endpoint issue [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#62128Fetched 2026-04-08 03:08:38
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0

The openclaw agent --agent <name> CLI command intermittently returns empty payloads (payloads: []) for ACP agents (pi, opencode) even when the agent successfully processes the request. The Gateway logs show "No reply from agent." despite the agent actually running and producing output.

This appears to be related to the session/new endpoint in the OpenClaw ACP backend.

Root Cause

  • The health check script (acp_runtime_health_check.py) explicitly documents: "Uses opencode agent directly (openclaw ACP backend has a session/new bug)"
  • Both pi and opencode use the SAME model — not model-specific
  • The issue is timing/concurrency related — running two openclaw agent commands in quick succession triggers the bug
  • Manual retests with delay succeed consistently
  • Using acpx <agent> exec directly bypasses the bug

Fix Action

Workaround

Use acpx <agent> exec \"<message>\" directly instead of openclaw agent:

# Instead of:
openclaw agent --agent opencode --message \"test\" --json

# Use:
acpx --timeout 30 opencode exec \"test\"

Code Example

Apr 07 01:45:17 moltbot node[2445724]: 2026-04-07T01:45:17.763+10:00 PI_SMOKE_CRON_OK
Apr 07 01:45:35 moltbot node[2445724]: 2026-04-07T01:45:35.611+10:00 No reply from agent.

---

# Instead of:
openclaw agent --agent opencode --message \"test\" --json

# Use:
acpx --timeout 30 opencode exec \"test\"
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (intermittent failure)

Summary

The openclaw agent --agent <name> CLI command intermittently returns empty payloads (payloads: []) for ACP agents (pi, opencode) even when the agent successfully processes the request. The Gateway logs show "No reply from agent." despite the agent actually running and producing output.

This appears to be related to the session/new endpoint in the OpenClaw ACP backend.

Steps to reproduce

  1. Run: openclaw agent --agent pi --message \"Reply with exactly TEST_OK\" --json --timeout 60
  2. Run: openclaw agent --agent opencode --message \"Reply with exactly TEST_OK\" --json --timeout 60 (immediately after)
  3. Observe: Sometimes opencode returns empty payloads despite exit code 0

Environment

  • OpenClaw: 2026.4.5 (3e72c03)
  • ACP enabled: true
  • ACP backend: acpx
  • ACP allowedAgents: ["pi", "opencode"]
  • Both pi and opencode configured with model: ollama/qwen3.5:cloud

Root cause analysis

  • The health check script (acp_runtime_health_check.py) explicitly documents: "Uses opencode agent directly (openclaw ACP backend has a session/new bug)"
  • Both pi and opencode use the SAME model — not model-specific
  • The issue is timing/concurrency related — running two openclaw agent commands in quick succession triggers the bug
  • Manual retests with delay succeed consistently
  • Using acpx <agent> exec directly bypasses the bug

Evidence

Gateway log during failure:

Apr 07 01:45:17 moltbot node[2445724]: 2026-04-07T01:45:17.763+10:00 PI_SMOKE_CRON_OK
Apr 07 01:45:35 moltbot node[2445724]: 2026-04-07T01:45:35.611+10:00 No reply from agent.

Only pi output was captured in logs — opencode output was silently dropped.

Expected behavior

openclaw agent --agent <acp-agent> should consistently return the agent's response payloads.

Workaround

Use acpx <agent> exec \"<message>\" directly instead of openclaw agent:

# Instead of:
openclaw agent --agent opencode --message \"test\" --json

# Use:
acpx --timeout 30 opencode exec \"test\"

Impact and severity

  • Severity: Medium — intermittent failure in agent smoke-check and potentially other automated workflows
  • Frequency: ~10-20% of runs when agents invoked in quick succession
  • Affects: Any automation using openclaw agent for ACP agents

Similar issues

  • #46080: Anthropic tool_result succeeds but final assistant content is empty
  • #50888: CLI-backend sub-agent announce delivers empty payload
  • #60077: ACP spawn creates broken sessions

Notes

The workaround (using acpx directly) is already used by the ACP runtime health check script, confirming this is a known issue in the codebase.

extent analysis

TL;DR

Using acpx <agent> exec directly instead of openclaw agent can workaround the intermittent empty payload issue for ACP agents.

Guidance

  • The issue seems to be related to a session/new endpoint bug in the OpenClaw ACP backend, which is triggered by quick succession of openclaw agent commands.
  • Introducing a delay between openclaw agent commands can help mitigate the issue, as manual retests with delay have succeeded consistently.
  • Using the acpx <agent> exec command directly bypasses the bug and can be used as a workaround.
  • Reviewing similar issues (#46080, #50888, #60077) may provide additional insight into the root cause and potential fixes.

Example

# Instead of:
openclaw agent --agent opencode --message "test" --json

# Use:
acpx --timeout 30 opencode exec "test"

Notes

The provided workaround is already used in the ACP runtime health check script, confirming its effectiveness in bypassing the issue.

Recommendation

Apply the workaround by using acpx <agent> exec directly, as it has been proven to bypass the bug and provide consistent results.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

openclaw agent --agent <acp-agent> should consistently return the agent's response payloads.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING