fix(openai): remove convertToSimpleMessages to fix tool calling for OpenAI-compatible providers #10575
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.
Summary
Removes the
convertToSimpleMessagesfunction which was convertingtool_useblocks to text like[Tool Use: write_to_file]instead of proper OpenAItool_callsformat.This caused models to output text mimicking tool calls instead of actually invoking tools, triggering errors like:
Root Cause
convertToSimpleMessageswas added in Feb 2025 for Volcano Ark (.volces.com) compatibility when tools weren't being sent. After v3.37.1 addedNATIVE_TOOL_DEFAULTS, tools were always sent but history showed text patterns, confusing models.Changes
convertToSimpleMessagesusage fromopenai.tssimple-format.tsand its testsopenAiLegacyFormatsetting from provider-settings schemauseLegacyFormattranslation key from all 18 localesTesting
Fixes ROO-433
Important
Remove
convertToSimpleMessagesto fix tool call issues for OpenAI-compatible providers, affecting settings and localization.convertToSimpleMessagesfromopenai.ts, fixing tool call issues for OpenAI-compatible providers.simple-format.tsand its tests.openAiLegacyFormatfrom provider-settings schema.useLegacyFormattranslation key from all 18 locales.This description was created by
for 5c3b910. You can customize this summary. It will automatically update as commits are pushed.