openclaw - 💡(How to fix) Fix [Bug]: CLI-backend sub-agent announce delivers empty payload despite non-empty child output [3 comments, 3 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#50888Fetched 2026-04-08 01:06:55
View on GitHub
Comments
3
Participants
3
Timeline
10
Reactions
1
Author
Timeline (top)
commented ×3cross-referenced ×2labeled ×2mentioned ×1

CLI-backend sub-agent spawned via sessions_spawn completes and delivers completion status to the parent, but the announce result payload is empty despite non-empty child output visible in gateway journal logs.

Root Cause

Krill (OpenClaw community) suggested the root cause may be a mismatch between CLI -p mode output format and what the announce pipeline expects for result extraction. Switching from output: "json" to output: "text" did not resolve. OPENCLAW_CLAUDE_CLI_LOG_OUTPUT=1 was not enabled during testing — maintainers may want that for deeper diagnosis.

Code Example

{
    "claude-review": {
      "output": "text",
      "input": "arg",
      "serialize": false,
      "command": "/usr/local/bin/claude-coding-team",
      "args": ["-p", "--permission-mode", "bypassPermissions",
               "--disallowedTools", "Write,Edit,Bash,NotebookEdit",
               "--mcp-config=/path/to/mcp.json"],
      "sessionMode": "always",
      "systemPromptArg": "--append-system-prompt",
      "systemPromptWhen": "first"
    }
  }

---

Gateway journal showing child CLI exec and full output:
  [agent/claude-cli] cli exec: provider=claude-review model=opus promptChars=1433
  | High | approver.ts | 190193 | Unchecked type assertions on payload fields...
  [full structured review output visible in journal]

  Followed immediately by parent message:
  Alas, dear Jared: Cotillion returned with empty hands...

  Concrete session IDs from the last reproduce:
  - Child session key: agent:reviewer:subagent:944fb359-f3f5-459d-9b3c-37465a282c3d
  - Session ID: 4fd291e1-2eee-4431-926b-cc2350ada593
  - Run ID: 93fc270b-15dd-4ff6-a589-f6aeb405352f
  - Label: cotillion-review-approver-ts-announce-test
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Summary

CLI-backend sub-agent spawned via sessions_spawn completes and delivers completion status to the parent, but the announce result payload is empty despite non-empty child output visible in gateway journal logs.

Steps to reproduce

  1. Configure a CLI backend (claude-review) with output: "text", serialize: false, command: claude -p --permission-mode bypassPermissions
  2. Create an architect agent (OpenClaw-native, Codex model) with subagents.allowAgents including the target agent
  3. From the architect session, run sessions_spawn --agent reviewer --task "<any structured review prompt>"
  4. Child runs on CLI backend, produces non-empty text output (visible in journalctl --user -u openclaw-gateway)
  5. Parent receives completion event but result content is empty
  6. sessions_history(childSessionKey) returns []
  7. Child transcript file at the advertised path is ENOENT

Expected behavior

Parent agent should receive the child's non-empty text output as the announce result payload. Per Krill (OpenClaw community support): "CLI-backend announce is supported, -p mode does not bypass the announce flow." The parent should be able to read the child's result either via announce delivery or via sessions_history(childSessionKey).

Actual behavior

  • Parent receives completion event (knows child finished) but result content is empty — no text payload
  • sessions_history(childSessionKey) returns empty array []
  • Child transcript file at the advertised session path returns ENOENT
  • Child output IS visible in gateway journal (journalctl --user -u openclaw-gateway) as full text — the content exists but is not captured into the session/announce system
  • Tested with both output: "json" + --output-format json and output: "text" (no format flag) — same result
  • Tested with serialize: true and serialize: false — same result
  • No NO_REPLY or ANNOUNCE_SKIP in child output

OpenClaw version

2026.3.13 (61d171a)

Operating system

Ubuntu 24.04 LTS (GMKtec G10)

Install method

npm install -g openclaw, running as systemd user service under openclaw user

Model

Parent: openai-codex/gpt-5.4 (OpenClaw native); Child: claude-review/opus (custom CLI backend using Claude Code CLI 2.1.79)

Provider / routing chain

Parent → OpenClaw gateway (local, port 18789) → sessions_spawn --agent reviewer → CLI backend claude-review → /usr/local/bin/claude-coding-team (wrapper setting OP_SERVICE_ACCOUNT_TOKEN) → claude -p --permission-mode bypassPermissions --disallowedTools Write,Edit,Bash,NotebookEdit

Additional provider/model setup details

{
  "claude-review": {
    "output": "text",
    "input": "arg",
    "serialize": false,
    "command": "/usr/local/bin/claude-coding-team",
    "args": ["-p", "--permission-mode", "bypassPermissions",
             "--disallowedTools", "Write,Edit,Bash,NotebookEdit",
             "--mcp-config=/path/to/mcp.json"],
    "sessionMode": "always",
    "systemPromptArg": "--append-system-prompt",
    "systemPromptWhen": "first"
  }
}

Architect has subagents.allowAgents: ["reviewer", "senior-eng", "junior-eng", "research-agent"]. tools.sessions.visibility: "all". tools.agentToAgent.allow includes all agents.

Logs, screenshots, and evidence

Gateway journal showing child CLI exec and full output:
  [agent/claude-cli] cli exec: provider=claude-review model=opus promptChars=1433
  | High | approver.ts | 190–193 | Unchecked type assertions on payload fields...
  [full structured review output visible in journal]

  Followed immediately by parent message:
  Alas, dear Jared: Cotillion returned with empty hands...

  Concrete session IDs from the last reproduce:
  - Child session key: agent:reviewer:subagent:944fb359-f3f5-459d-9b3c-37465a282c3d
  - Session ID: 4fd291e1-2eee-4431-926b-cc2350ada593
  - Run ID: 93fc270b-15dd-4ff6-a589-f6aeb405352f
  - Label: cotillion-review-approver-ts-announce-test

Impact and severity

  • Affected: Any multi-agent setup using sessions_spawn with CLI-backend child agents
  • Severity: Blocks workflow — sub-agent delegation is the core orchestration mechanism for our 5-agent coding team. Without announce delivery, the architect cannot receive results from spawned agents.
  • Frequency: Always — 100% reproduction rate across 5+ test runs with different output formats and serialization settings
  • Consequence: Architect must fall back to manual inspection (checking branch diffs, reading journal logs) instead of receiving structured results. The entire multi-agent pipeline works except the last-mile result delivery.

Additional information

Krill (OpenClaw community) suggested the root cause may be a mismatch between CLI -p mode output format and what the announce pipeline expects for result extraction. Switching from output: "json" to output: "text" did not resolve. OPENCLAW_CLAUDE_CLI_LOG_OUTPUT=1 was not enabled during testing — maintainers may want that for deeper diagnosis.

extent analysis

Fix Plan

To resolve the issue of empty announce result payloads from CLI-backend sub-agents, we need to adjust the configuration and potentially modify the code to ensure compatibility between the CLI output format and the announce pipeline's expectations.

Configuration Changes

  1. Verify Output Format: Ensure that the output format of the CLI backend matches what the announce pipeline expects. Given that switching from "json" to "text" did not resolve the issue, further investigation into the exact format expected by the pipeline is necessary.
  2. Serialization Setting: Although testing with serialize: true and serialize: false showed the same result, it's crucial to understand how serialization affects the output and whether it aligns with the pipeline's requirements.

Code Changes

If the issue persists after configuration adjustments, code modifications might be necessary to ensure the CLI backend's output is correctly captured and delivered to the parent agent.

// Example adjustment to handle output formatting
const childProcess = require('child_process');

// Assuming 'command' is the CLI command to execute
const command = '/usr/local/bin/claude-coding-team';
const args = ['-p', '--permission-mode', 'bypassPermissions', /* other args */];

// Execute the command and capture output
childProcess.execFile(command, args, (error, stdout, stderr) => {
  if (error) {
    // Handle error
  } else {
    // Process stdout to match the expected format for announce payload
    const formattedOutput = formatOutput(stdout); // Implement formatOutput function
    // Deliver formattedOutput as the announce result payload
  }
});

// Example function to format output (implementation depends on expected format)
function formatOutput(output) {
  // If the pipeline expects JSON, parse and stringify the output accordingly
  try {
    const jsonData = JSON.parse(output);
    return JSON.stringify(jsonData);
  } catch (e) {
    // Handle non-JSON output
    return output;
  }
}

Infra / Dependency Fixes

  • Environment Variables: Ensure that environment variables such as OPENCLAW_CLAUDE_CLI_LOG_OUTPUT are set appropriately for debugging purposes.
  • Dependency Versions: Verify that all dependencies, including openclaw and claude-coding-team, are up-to-date and compatible with each other.

Verification

To verify that the fix worked:

  1. Run Test Scenarios: Repeat the steps to reproduce the issue after applying the fixes.
  2. Check Announce Payloads: Verify that the parent agent receives non-empty announce result payloads from the child agents.
  3. Inspect Logs: Review gateway journal logs to ensure that child output is correctly captured and delivered.

Extra Tips

  • Debugging: Enable detailed logging (e.g., OPENCLAW_CLAUDE_CLI_LOG_OUTPUT=1) to gain deeper insights into the interaction between the CLI backend and the announce pipeline.
  • **

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

Parent agent should receive the child's non-empty text output as the announce result payload. Per Krill (OpenClaw community support): "CLI-backend announce is supported, -p mode does not bypass the announce flow." The parent should be able to read the child's result either via announce delivery or via sessions_history(childSessionKey).

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Bug]: CLI-backend sub-agent announce delivers empty payload despite non-empty child output [3 comments, 3 participants]