anthropics / anthropics/claude-code-action

v1 cannot process issues with JPEGs in them

Open
#495 1 comment 4 reactions 0 assignees View on GitHub
bug p1
Dominant language
TypeScript
Stars
8.9k
Forks
2.1k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

Describe the bug
Claude GitHub Action fails with an API error when processing GitHub issues that contain uploaded images. The error indicates a media type mismatch where the base64 image data doesn't match the expected PNG format.

To Reproduce
Steps to reproduce the behavior:

1. Create a GitHub issue in a repository with Claude GitHub Action enabled
2. Upload an image directly to the issue (drag and drop or paste)
3. Mention @claude in the issue to trigger the action
4. Claude responds with an API error about image format mismatch

Expected behavior
Claude should be able to process issues containing images, either by:
- Correctly handling various image formats (JPEG, PNG, etc.)
- Gracefully skipping image content if unable to process
- Converting images to the correct format before sending to the API

Screenshots
The error message received:
```
{"type":"user","message":{"role":"user","content":[{"tool_use_id":"toolu_01WnM9ZBxs2vCwhKiSdzoJmn","type":"tool_result","content":[{"type":"image","source":{"type":"base64","data":"/9j/4AAQSkZJRgABAQAASABIAAD/4QBARXhpZgAATU0AKgAAAA
...

API Error: 400 {
"type":"error",
"error":{
"type":"invalid_request_error",
"message":"messages.1.content.6.image.source.base64.data: Image does not match the provided media type image/png"
},
"request_id":"req_011CSYPDcYC4wR98Ljz3ke1u"
}
```
API Provider

[x] Anthropic First-Party API (default)
[ ] AWS Bedrock
[ ] GCP Vertex

Additional context
- The issue appears to be related to how the GitHub Action processes embedded images in issues
- The base64 image data appears to be JPEG format (based on the /9j/ header which is typical for JPEG) but is being sent with a PNG media type
- This prevents Claude from analyzing issues that contain screenshots or other visual content
- Action version: @v1 (latest)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.