Skip to content

[Bug]: API Error JSON in message #919

@wisefool769

Description

@wisefool769

Summary

Raw API error JSON is forwarded to messaging surfaces (Telegram) instead of being handled gracefully.

Steps to reproduce

  1. Configure clawdbot with Telegram provider
  2. Set up a cron job with --deliver --channel telegram
  3. Wait for Claude API to return an overloaded_error (or trigger during peak load)

Expected behavior

  • Automatic retry with backoff, OR
  • Friendly error message to user ("Service busy, try again"), OR
  • Error suppressed entirely with logging for telemetry

Actual behavior

Raw JSON error forwarded to Telegram:
{"type":"error","error":{"details":null,"type":"overloaded_error","message":"Overloaded"},"request_id":"req_011CX7DwS7tSvggaNHmefwWg"}
User sees cryptic JSON instead of a handled error.

Environment

  • Clawdbot version: 2026.1.5-3
  • OS: Linux 6.8.0-1039-aws (Ubuntu 22.04, x86_64)
  • Node: v22.21.0
  • Install method: pnpm

Logs or screenshots

Observed on:

  • 2026-01-12 ~13:00 UTC (cron job delivery)
  • 2026-01-14 ~20:08 UTC (user message)

Additional context

  • Hooks system doesn't have an api_error event to intercept these
  • Error occurs below the agent loop in the API client layer
  • Feature request: either built-in retry/backoff or an api_error hook for custom handling

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions