Skip to content

Prompt token count of exceeds the limit of 128000 #11624

Closed

Description

@DanielProkhorov17

Description

I get this error when a model like claude is trying to read file attachments that are images (.png, jpeg), thus crashing with token count limit.

I'd be great to perform token count before the request is getting sent to the model. In case, it exceeds the images shall be compressed to a reasonable size.

Plugins

No response

OpenCode version

1.1.48

Steps to reproduce

  1. Let the model download an image (for e.g. via MPC), or python script ivocation, or curl
  2. The AI model tries to read downloaded image(s)

Screenshot and/or share link

No response

Operating System

Windows 11

Terminal

Windows Terminal

Activity

  1. added
    perfIndicates a performance issue or need for optimization
    on Feb 1, 2026
  2. github-actions commented on Feb 1, 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.

  3. DanielProkhorov17 commented on Feb 1, 2026

    @DanielProkhorov17
    Author

    #11450 This issue is reported during compaction. The usecase I'm describing is specifically related to image attachments.

  4. bankjaneo commented on Feb 1, 2026

    @bankjaneo

    The last good version that can read image is 1.1.31

    You might want to pin to that version until this bug is fixed.

  5. tlaukkanen commented on Feb 2, 2026

    @tlaukkanen

    Thanks for the tip. 1.1.31 works with images. Especially handy when agent uses MCP like playwright to troubleshoot some bug and tries to take a screenshot.

  6. thomashfr commented on Feb 2, 2026

    @thomashfr

    I'm getting the same error when using the Figma prototype, or any more detailed prompt in plan mode. Version 1.1.48

  7. paq85 commented on Feb 3, 2026

    @paq85

    Happens also with local model, when it tries to analyse image

    Image
  8. aeciolevy commented on Feb 5, 2026

    @aeciolevy

    1.1.31

    Lifesaver.

    I could not do anything with images anymore.

  9. bankjaneo commented on Feb 6, 2026

    @bankjaneo

    This bug has been fixed in 1.1.52 🎉

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingperfIndicates a performance issue or need for optimizationwindows

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions