Skip to content

Misleading error normalization: SIGPIPE/SIGKILL exec failures reported as “API billing error” #11722

Description

@cmfinlan

Summary

When a local exec command is terminated (e.g., by SIGPIPE from | head, or by manually killing the exec session), OpenClaw sometimes emits a generic message:

⚠️ API provider returned a billing error — your API key has run out of credits or has an insufficient balance...

This is misleading: the underlying failure is a local process termination (SIGPIPE/exit 141 or SIGKILL), not an API billing/credit issue.

Why this matters

This message trains users to look at provider billing dashboards when the actual issue is just a shell pipeline / process termination. It also creates false incident noise for monitoring.

Reproduction (likely)

  1. Run a command that will be intentionally truncated, e.g.:
    curl -I https://example.com 2>&1 | head -n 5
    (This often causes SIGPIPE / exit code 141 in the upstream process.)
  2. Or start a long-running grep -R ... and terminate the exec session.
  3. Observe OpenClaw producing the “API billing error” explanation.

Observed

  • The underlying tool failure presented as SIGPIPE/SIGKILL (exit 141 / signal kill)
  • Followed by the “API provider returned a billing error…” explanation in the chat surface

Expected

  • If exit code indicates SIGPIPE (141) or SIGKILL, surface a message like:
    • “Command terminated early (SIGPIPE) — likely due to piped truncation (e.g., | head).”
    • “Command killed (SIGKILL) — likely manually terminated / OS kill.”
  • Do not label as billing/credits unless the HTTP response or provider error explicitly indicates 402/insufficient balance.

Environment

  • OpenClaw version: 2026.2.6-3
  • Host: macOS (Mac mini)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstaleMarked as stale due to inactivity

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions