anthropics / anthropics/claude-code-action

v1 cannot process issues with JPEGs in them

Đang mở
#495 1 bình luận 4 reaction 0 người được giao Xem trên GitHub
bug p1
Ngôn ngữ chính
TypeScript
Star
8.9k
Fork
2.1k
Merge trung bình
3 ngày 9 giờ
Pull request đã merge (30 ngày)
10

Mô tả

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)

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.