Skip to content

fix(ai): crash when sending clipboard-pasted images in AI chat#2724

Merged
abose merged 2 commits intomainfrom
ai
Mar 5, 2026
Merged

fix(ai): crash when sending clipboard-pasted images in AI chat#2724
abose merged 2 commits intomainfrom
ai

Conversation

@abose
Copy link
Member

@abose abose commented Mar 5, 2026

DataTransferItem.type becomes invalid after the paste event handler returns, but the code read it inside an async FileReader.onload callback, resulting in an empty media_type that crashed the Claude Code subprocess (exit code 1).

  • Capture mediaType from blob.type synchronously before FileReader
  • Add server-side fallback: infer media type from base64 magic bytes
  • Add stderr logging for Claude Code subprocess diagnostics

abose added 2 commits March 5, 2026 15:34
DataTransferItem.type becomes invalid after the paste event handler
returns, but the code read it inside an async FileReader.onload
callback, resulting in an empty media_type that crashed the Claude
Code subprocess (exit code 1).

- Capture mediaType from blob.type synchronously before FileReader
- Add server-side fallback: infer media type from base64 magic bytes
- Add stderr logging for Claude Code subprocess diagnostics
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 5, 2026

@abose abose merged commit ed9b520 into main Mar 5, 2026
17 of 21 checks passed
@abose abose deleted the ai branch March 5, 2026 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant