AI_APICallError - base64 encoded image pasted #3253

Open
opened 2026-02-16 17:39:21 -05:00 by yindo · 3 comments
Owner

Originally created by @paka63 on GitHub (Dec 2, 2025).

Originally assigned to: @rekram1-node on GitHub.

Description

After pasting an image into the chat which was encoded to base64, the original image was transferred to Anthropic Claude, but was being included in subsequent messages causing an AI_APICallError. Either we need to save the image locally and transmit a temporary path or use the path of the original file rather than encoding it in the message chat. Also, Opencode froze afterwards with no error messages or response so we are not handling the error gracefully.

OpenCode version

1.0.126

Steps to reproduce

  1. Select an image
  2. Clipboard copy image
  3. Paste image in opencode chat
  4. Continue to interact with model until it no longer continues.

Screenshot and/or share link

No response

Operating System

Ubuntu 25.04

Terminal

GNOME Terminal

Originally created by @paka63 on GitHub (Dec 2, 2025). Originally assigned to: @rekram1-node on GitHub. ### Description After pasting an image into the chat which was encoded to base64, the original image was transferred to Anthropic Claude, but was being included in subsequent messages causing an AI_APICallError. Either we need to save the image locally and transmit a temporary path or use the path of the original file rather than encoding it in the message chat. Also, Opencode froze afterwards with no error messages or response so we are not handling the error gracefully. ### OpenCode version 1.0.126 ### Steps to reproduce 1. Select an image 2. Clipboard copy image 3. Paste image in opencode chat 4. Continue to interact with model until it no longer continues. ### Screenshot and/or share link _No response_ ### Operating System Ubuntu 25.04 ### Terminal GNOME Terminal
yindo added the bug label 2026-02-16 17:39:21 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Dec 2, 2025):

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

  • #4687: Cannot paste image on Zed - relates to image pasting functionality across different terminals/editors
  • #4668: Images can not be dragged and dropped - relates to image handling when importing images via file paths vs clipboard
  • #4869: opentui: fatal: props.input.content?.split is not a function - relates to message content handling that results in crashes and potential freezing
  • #4484: TUI crash: props.input.content?.split is not a function (BMAD resume) - similar content parsing crash that causes UI freezing
  • #4951: imagen_generate tool crashes with validation error - shows image-related tools can cause validation errors and crashes
  • #4573: [FEATURE]: A config file parameter needs to be added to toggle whether image files should be processed - relates to image handling strategy

The key issues are:

  1. Image pasting/handling may not be properly managed across subsequent messages
  2. Content with certain data types (like base64 images) might cause props.input.content validation failures
  3. Error handling and graceful failure when API calls fail with image data needs improvement

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

@github-actions[bot] commented on GitHub (Dec 2, 2025): This issue might be a duplicate of existing issues. Please check: - #4687: Cannot paste image on Zed - relates to image pasting functionality across different terminals/editors - #4668: Images can not be dragged and dropped - relates to image handling when importing images via file paths vs clipboard - #4869: opentui: fatal: props.input.content?.split is not a function - relates to message content handling that results in crashes and potential freezing - #4484: TUI crash: props.input.content?.split is not a function (BMAD resume) - similar content parsing crash that causes UI freezing - #4951: imagen_generate tool crashes with validation error - shows image-related tools can cause validation errors and crashes - #4573: [FEATURE]: A config file parameter needs to be added to toggle whether image files should be processed - relates to image handling strategy The key issues are: 1. Image pasting/handling may not be properly managed across subsequent messages 2. Content with certain data types (like base64 images) might cause props.input.content validation failures 3. Error handling and graceful failure when API calls fail with image data needs improvement Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Dec 2, 2025):

ill check it out

@rekram1-node commented on GitHub (Dec 2, 2025): ill check it out
Author
Owner

@cvakiitho commented on GitHub (Jan 15, 2026):

I think I have a similar issue, where thought chain just completely stops with 0 issues displayed in export/logs. BTW is there another option to pass images then base64?

@cvakiitho commented on GitHub (Jan 15, 2026): I think I have a similar issue, where thought chain just completely stops with 0 issues displayed in export/logs. BTW is there another option to pass images then base64?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3253