Skip to content

413 Payload Too Large when reading local image (gpt-5.2-codex + opus-4.5) #12060

Closed

Description

@bradleat

Summary

Reading a locally generated PNG through OpenCode API fails with size errors. gpt-5.2-codex returns Cloudflare 413; opus-4.5 returns request_too_large.

Steps to reproduce

  1. Generate a PNG on disk (any tool; e.g., render a still image) and note its size.
    Example (optional): bunx remotion still MyComp /tmp/frame-10s.png --frame=240
  2. In OpenCode with model gpt-5.2-codex or opus-4.5, read the local PNG via the file-read tool/API (e.g., /tmp/frame-10s.png).
  3. Observe the size error once the file exceeds the upstream limit.

Actual

  • gpt-5.2-codex:
    Payload Too Large (Cloudflare 413 HTML)
  • opus-4.5:
    {"error":{"type":"request_too_large","message":"Request exceeds the maximum size"}}

Expected

  • File read succeeds, or
  • API returns an explicit file-size limit and/or guidance (e.g., max size or streaming/upload alternative)

Notes

Hypothesis: when the model attempts to upload a local image read from filesystem, the file is too large for upstream limits.

Activity

  1. github-actions commented on Feb 4, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Feel free to ignore if none of these address your specific case.

  2. github-actions commented on Apr 6, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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