Skip to content

Conversation

@The-Best-Codes
Copy link
Collaborator

@The-Best-Codes The-Best-Codes commented Jul 10, 2025

Before:

You have to type out a model manually.

┌   goose-configure
│
◇  What would you like to configure?
│  Configure Providers
│
◇  Which model provider should we use?
│  OpenRouter
│
●  OPENROUTER_API_KEY is already configured
│
◇  Would you like to update this value?
│  Yes
│
◇  Enter new value for OPENROUTER_API_KEY
│  [REDACTED]
│
◇  Model fetch complete
│
◆  Enter a model from that provider:
│  anthropic/claude-3.5-sonnet (default)
└

After:

Goose CLI will automatically fetch the list of models that support tool use from OpenRouter when you configure it as a provider:

┌   goose-configure
│
◇  What would you like to configure?
│  Configure Providers
│
◇  Which model provider should we use?
│  OpenRouter
│
●  OPENROUTER_API_KEY is already configured
│
◇  Would you like to update this value?
│  Yes
│
◇  Enter new value for OPENROUTER_API_KEY
│  [REDACTED]
│
◇  Model fetch complete
│
◆  Select a model:
│
│  ● ai21/jamba-1.6-large
│  ○ ai21/jamba-1.6-mini
│  ○ amazon/nova-lite-v1
│  ○ amazon/nova-micro-v1
│  ○ amazon/nova-pro-v1
│  ○ anthropic/claude-3-haiku
...

@The-Best-Codes The-Best-Codes changed the title feat: fetch supported models from api for github copilot and openrouter feat: fetch openrouter supported models in goose configure Jul 10, 2025
@The-Best-Codes The-Best-Codes marked this pull request as ready for review July 10, 2025 20:05
Copy link
Collaborator Author

@The-Best-Codes The-Best-Codes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ready for review!

@michaelneale michaelneale self-assigned this Jul 10, 2025
Copy link
Collaborator

@michaelneale michaelneale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very nice - I don't have access to manually test open router - any chance you can add a small recording showing it in action?

Also - where is fetch_supported_models_async called from? I must be missing some context

@The-Best-Codes
Copy link
Collaborator Author

The-Best-Codes commented Jul 10, 2025

@michaelneale The fetch_supported_models_async function is a public function. It was added to base.rs in a previous PR. Providers can optionally include that function to enable supported model fetching.

async fn fetch_supported_models_async(&self) -> Result<Option<Vec<String>>, ProviderError> {
Ok(None)
}

It gets called in configure.rs:

// Attempt to fetch supported models for this provider
let spin = spinner();
spin.start("Attempting to fetch supported models...");
let models_res = {
let temp_model_config = goose::model::ModelConfig::new(provider_meta.default_model.clone());
let temp_provider = create(provider_name, temp_model_config)?;
temp_provider.fetch_supported_models_async().await
};
spin.stop(style("Model fetch complete").green());

Copy link
Collaborator

@michaelneale michaelneale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice isolated change, will help with experience with open router

@michaelneale michaelneale merged commit 5db89aa into block:main Jul 14, 2025
7 checks passed
@michaelneale
Copy link
Collaborator

@The-Best-Codes merged - wonder if future enhancement is to have some UI that lets people find.. as there is a lot! (but no idea what that would look like)

zanesq added a commit that referenced this pull request Jul 14, 2025
* 'main' of github.com:block/goose:
  feat: fetch openrouter supported models in `goose configure` (#3347)
  Add the ability to configure rustyline to use a different edit mode (e.g. vi) (#2769)
  docs: update CLI provider guide (#3397)
  Streamable HTTP CLI flag (#3394)
  docs: Show both remote options for extensions in CLI (#3392)
@The-Best-Codes
Copy link
Collaborator Author

@michaelneale Awesome!

have some UI that lets people find

Do you mean in Goose desktop or a TUI? In the terminal, maybe type to search the list of models?

michaelneale added a commit to jackjackbits/goose that referenced this pull request Jul 14, 2025
* main: (51 commits)
  docs: reflecting benefits of CLI providers (block#3399)
  feat: fetch openrouter supported models in `goose configure` (block#3347)
  Add the ability to configure rustyline to use a different edit mode (e.g. vi) (block#2769)
  docs: update CLI provider guide (block#3397)
  Streamable HTTP CLI flag (block#3394)
  docs: Show both remote options for extensions in CLI (block#3392)
  docs: fix YouTube Transcript MCP package manager (block#3390)
  docs: simplify alby mcp (block#3379)
  docs: add max turns (block#3372)
  feat(cli): add cost estimation per provider for Goose CLI (block#3330)
  feat: Allow Ollama for non-tool models for chat only (block#3308)
  [cli] Add --provider and --model CLI options to run command (block#3295)
  Docs: Lead/worker model in Goose Desktop (block#3342)
  revert: refactor: abstract keyring logic to better enable DI (block#3358)
  Drop temporal-service binary (block#3340)
  docs: add fuzzy search (block#3357)
  Fix name of GPT-4.1 System Prompt (block#3348) (block#3351)
  docs: add goose-mobile (block#3315)
  refactor: abstract keyring logic to better enable DI (block#3262)
  fix: correct tool use for anthropic (block#3311)
  ...
atarantino pushed a commit to atarantino/goose that referenced this pull request Jul 14, 2025
s-soroosh pushed a commit to s-soroosh/goose that referenced this pull request Jul 18, 2025
kwsantiago pushed a commit to kwsantiago/goose that referenced this pull request Jul 19, 2025
cbruyndoncx pushed a commit to cbruyndoncx/goose that referenced this pull request Jul 20, 2025
@The-Best-Codes The-Best-Codes deleted the best/copilot-openrouter-autofetch branch November 11, 2025 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants