mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-10-16 07:33:06 +08:00
The eligibility gate in grokChatResponsesBridgeEligibility rejected any structured content (arrays), including standard OpenAI image_url parts. This forced image-bearing requests to fall back to raw Chat Completions forwarding, where non-Composer models have no image bridge — silently dropping the images or causing upstream errors. Changes: - Allow content arrays containing only text and image_url parts to pass eligibility, so ChatCompletionsToResponses can convert them to input_image parts that Grok vision models natively support. - Force image-bearing requests to use Responses even when no prompt cache identity is available, since the raw path cannot forward images for non-Composer models. - Add grokChatStructuredContentBridgeable helper with conservative validation: unknown part types (e.g. input_audio) still fall back. - Update tests: image_url content is now bridgeable; add cases for text+image, text-only arrays, unknown parts, and empty arrays.