Skip to content

[Bug] OpenClaw runtime: daemon invokes openclaw with Claude Code flags, not openclaw agent protocol #5648

Description

@sh1baaaaa

Summary

Multica daemon (v0.4.4) invokes OpenClaw using Claude Code CLI flags instead of the openclaw agent protocol. Every task fails with "openclaw returned no parseable output".

Environment

  • Multica: v0.4.4 (self-hosted)
  • OpenClaw: 2026.5.6 (also tested 2026.5.5, 2026.6.6, 2026.6.11 - same result)
  • OS: Ubuntu 24.04 (Linux amd64)

What Multica actually sends to openclaw

Captured via wrapper script logging argv:

openclaw agent -p "hello" --output-format stream-json --model zai/glm-5.1 --workdir /root/multica_workspaces/.../workdir --dangerously-bypass-approvals-and-sandbox --add-dir /root/multica_workspaces/.../.repos/... --strict-mcp-config --mcp-config /tmp/multica-mcp-config-....json --json-input /tmp/openclaw-input-....json --no-tui

What openclaw returns

openclaw 5.6 does not recognize these flags. It prints usage/help text to stdout and exits non-zero. Multica reports: openclaw returned no parseable output

What openclaw agent actually accepts

Usage: openclaw agent [options]
Options:
  -m, --message <text>   Message body for the agent
  --model <id>           Model override
  --json                 Output result as JSON (single object, not NDJSON stream)
  --agent <id>           Agent id
  --session-id <id>      Use an explicit session id
  --local                Run embedded agent locally
  --thinking <level>     Thinking level
  --timeout <seconds>    Timeout override
  --channel <channel>    Delivery channel
  --deliver              Send reply back to channel
  --verbose <on|off>     Verbose level

None of the flags Multica sends exist in any openclaw version tested:

  • -p "text" -> openclaw uses -m/--message
  • --output-format stream-json -> openclaw uses --json (returns single JSON object, not NDJSON stream)
  • --model X -> same in both (only matching flag)
  • --json-input FILE -> no equivalent, openclaw uses --session-id for session state
  • --workdir DIR -> no equivalent
  • --add-dir DIR -> no equivalent
  • --mcp-config FILE -> no equivalent, MCP configured per-agent in openclaw.json
  • --no-tui -> no equivalent
  • --dangerously-bypass-approvals-and-sandbox -> no equivalent
  • --strict-mcp-config -> no equivalent

Expected behavior

Multica should invoke openclaw using native openclaw flags, not Claude Code CLI flags. Per server/pkg/agent/openclaw.go and the docs, the expected protocol is openclaw agent with openclaw-native flags and NDJSON from stdout.

Workaround

None that fully works. Partial workaround via wrapper script:

  1. Intercept openclaw config file (returns ~/.openclaw/openclaw.json with tilde — daemon cannot resolve it) and return absolute path
  2. After fixing config file issue, the Claude Code flags issue surfaces with no clean translation

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions