Fix: strip profile prefix in OpenRouterProvider::set_model for direct…#360
Closed
akvarel wants to merge 1 commit into
Closed
Fix: strip profile prefix in OpenRouterProvider::set_model for direct…#360akvarel wants to merge 1 commit into
akvarel wants to merge 1 commit into
Conversation
… profiles
When a switch spec like 'deepseek:deepseek-v4-flash' (produced by
model_switch_request_for_session_route or fork_model_switch_request)
is passed directly to OpenRouterProvider::set_model on a direct
OpenAI-compatible profile (supports_provider_features=false), it was
stored as-is, causing the API request to send 'model: deepseek:deepseek-v4-flash'
which the DeepSeek API rejects.
Now detect and strip the known {profile_id}: prefix when the
OpenRouterProvider has a profile_id set, so the bare model name
is used in API requests.
Owner
|
Thanks! This repo no longer accepts external PRs, but the underlying problem is real - it's now tracked in #363 (with credit to this PR). Closing. |
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.
… profiles
When a switch spec like 'deepseek:deepseek-v4-flash' (produced by model_switch_request_for_session_route or fork_model_switch_request) is passed directly to OpenRouterProvider::set_model on a direct OpenAI-compatible profile (supports_provider_features=false), it was stored as-is, causing the API request to send 'model: deepseek:deepseek-v4-flash' which the DeepSeek API rejects.
Now detect and strip the known {profile_id}: prefix when the OpenRouterProvider has a profile_id set, so the bare model name is used in API requests.