Repository navigation
fix: stop silently dropping unsupported multimodal content in kosong providers - #632
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: fd1def6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
7Sageer
force-pushed
the
fix/openai-tool-result-images
branch
from
June 10, 2026 13:35
ec6ea79 to
fd1def6
Compare
commit: |
Merged
7723qqq
pushed a commit
to 7723qqq/kimi-code
that referenced
this pull request
Aug 15, 2026
…providers (MoonshotAI#632) * fix: stop silently dropping unsupported media in provider conversions * fix: keep non-standard audio/video parts off the chat completions wire
5 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issue
No linked issue — the problem is explained below.
Problem
Provider conversion layers in
kosongsilently discard content parts the target API cannot represent, so the model answers as if the attachment never existed:audio_url/video_urlparts in user/assistant messages and in tool results were skipped without a trace (the API has no audio/video input type).video_urlwas dropped on both the user-message and tool-result paths; audio data URLs with a subtype other than mp3/wav were dropped too. WithtoolMessageConversion: 'extract_text', tool-result images were flattened away with no placeholder and no reattachment.For reference, comparable agent CLIs either degrade unsupported media to placeholder text or reattach it as user input — none drop it silently.
What changed
openai-legacy: tool-result images are reattached as a follow-up user message (image_urlis a standard Chat Completions content part). Tool-result audio/video cannot ride along — the API has no url-based audio/video part, and sending one would fail the whole request on a standard OpenAI endpoint — so the omission is noted inline in the tool message text ((audio omitted: not supported by this provider)). Shared wording constants moved toopenai-common.anthropic: audio/video parts degrade to a placeholder text block in user/assistant messages and insidetool_resultblocks; consecutive parts of the same kind collapse into a single placeholder.openai-responses: video parts and un-encodable audio degrade to placeholderinput_textitems on both the user-message and tool-result paths. Withextract_text, tool-result media is now buffered and reattached as a single user message after each run of consecutive tool messages (all items use standard Responses input types), mirroring the chat-completions provider.Tests that previously asserted the silent-drop behavior were inverted to assert the placeholders, with new cases covering audio-only and text+video tool results, placeholder degradation, and
extract_textreattachment.Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.