fix: pricing estimation for OpenRouter in goose-cli#3675
Merged
DOsinga merged 1 commit intoblock:mainfrom Jul 29, 2025
praneeth-ovckd:main
Merged
fix: pricing estimation for OpenRouter in goose-cli#3675DOsinga merged 1 commit intoblock:mainfrom praneeth-ovckd:main
DOsinga merged 1 commit intoblock:mainfrom
praneeth-ovckd:main
Conversation
DOsinga
approved these changes
Jul 28, 2025
| let (provider_to_use, model_to_use) = match &openrouter_data { | ||
| Some((real_provider, real_model)) => (real_provider.as_str(), real_model.as_str()), | ||
| None => (provider, model), | ||
| }; |
Collaborator
There was a problem hiding this comment.
how about:
let (provider_to_use, model_to_use) = if provider == "openrouter" {
parse_model_id(model)
.map(|(real_provider, real_model)| (real_provider.as_str(), real_model.as_str()))
.unwrap_or((provider, model))
} else {
(provider, model)
};
Contributor
Author
There was a problem hiding this comment.
Won't this lead to a dangling reference?
michaelneale
added a commit
that referenced
this pull request
Jul 30, 2025
* main: chore: small refactor on agent.rs (#3703) docs: Add GitMCP Tutorial to Extensions Library (#3716) chore: Speed up CI (#3711) Fix tool vector tests (#3709) docs: GitMCP Tutorial (#3708) Remove unused dependencies (#3626) feat: update Groq models for better tool calling support (#3676) chore: remove ffi libraries and related code (#3699) only run google analytics in prod (#3395) Fix typo in quickstart document (#3447) fix: pricing estimation for OpenRouter in goose-cli (#3675) fix: escape control characters in LLM tool call arguments JSON (#2893) feat(githubcopilot): add ability to fetch supported models (#2717) Create a message ID for tool response messages (#3591) fix: Fixed 404 broken link to extensions page in index.md (#3623)
atarantino
pushed a commit
to atarantino/goose
that referenced
this pull request
Aug 5, 2025
Signed-off-by: Adam Tarantino <tarantino.adam@hey.com>
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.
This PR fixes cost estimation for OpenRouter. OpenRouter model names are of the format "provider/model", which need to be parsed to get the actual provider and model, how goose-server does it.