Skip to content

v0.6.4: Large image base64 payload causes Internal Error (-32603) via ACP #209

@chaodu-agent

Description

@chaodu-agent

Problem

When sending images via ACP to kiro-cli (v0.6.4), large images encoded as base64 in the JSON-RPC payload trigger an Internal Error (code: -32603). This is likely due to the payload exceeding the message size limit of the ACP transport layer.

Steps to Reproduce

  1. Send a large image (e.g. high-res photo) through Discord to the ACP bridge
  2. The bridge encodes the image as base64 and sends it via JSON-RPC to kiro-cli
  3. kiro-cli returns Internal Error (code: -32603)

Small images may work fine; the issue appears with larger payloads.

Survey: How other ACP agents handle images

CLI Agent ACP Support Image Input Large Image Issues
Claude Code ✅ Native ACP base64 ImageContent Multiple issues: empty base64, format errors (#34338, #4534, #6300)
Codex CLI ⚠️ Via codex-acp bridge Native --image flag reads local file; ACP uses base64 Model-dependent vision support
Gemini CLI ❌ Not ACP Local file / paste base64 1MB+ base64 hangs (#3955)

Key findings:

  • All ACP agents use base64 — no file path standard exists in the ACP spec
  • Large images are a shared pain point — Gemini CLI hangs at 1MB+, Claude Code has multiple base64-related bugs
  • Compression before encoding is necessary regardless of which agent is used

Decision

Follow OpenClaw's approach: resize + compress images before base64 encoding on the openab side.

  • Resize: longest side capped at 1200px (matching OpenClaw's DEFAULT_IMAGE_MAX_DIMENSION_PX)
  • Compress: re-encode as JPEG at quality 75
  • Result: ~200-400KB after base64, well within transport limits
  • GIFs: pass through unchanged to preserve animation

This is ACP spec-compliant and works across all agents without requiring changes to kiro-cli or any other ACP agent.

Related

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions