GPT-5 finding
Image block normalization may still produce invalid media_type when detection fails
lowapi-contractmedium
- src/bridge/inboundMessages.ts
If detectImageFormatFromBase64 cannot determine a type (returns undefined/empty), the resulting block will still lack a required media_type. The function's purpose is to prevent sessions from being poisoned by malformed image blocks; it should guarantee a valid media_type after normalization.
Recommendation
Provide a safe default (e.g., 'image/png') when detection fails, or validate and drop unsupported/undetectable image blocks to avoid propagating a broken payload.