Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions crates/goose-acp/tests/common_tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ pub async fn run_model_list<C: Connection>() {
"gpt-5-codex",
"gpt-5",
"gpt-5-2025-08-07",
"gpt-5-chat-latest",
"gpt-5-mini",
"gpt-5-mini-2025-08-07",
TEST_MODEL,
Expand Down Expand Up @@ -172,16 +171,10 @@ pub async fn run_model_list<C: Connection>() {
"gpt-4o-2024-05-13",
"gpt-4o-2024-08-06",
"gpt-4o-2024-11-20",
"text-embedding-3-large",
"text-embedding-3-small",
"gpt-4",
"gpt-4-0613",
"gpt-4-turbo",
"gpt-4-turbo-2024-04-09",
"gpt-3.5-turbo",
"gpt-3.5-turbo-0125",
"gpt-3.5-turbo-1106",
"text-embedding-ada-002",
]
.iter()
.map(|id| ModelInfo::new(ModelId::new(*id), *id))
Expand Down
4 changes: 4 additions & 0 deletions crates/goose/src/providers/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,10 @@ pub trait Provider: Send + Sync {
return None;
}

if !canonical_model.tool_call && !self.get_model_config().toolshim {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Did a quick audit of the data this seems true for popular recent models so agree this should improve the filtering.

return None;
}

let release_date = canonical_model.release_date.clone();

Some((model.clone(), release_date))
Expand Down
27 changes: 1 addition & 26 deletions crates/goose/src/providers/openrouter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ impl Provider for OpenRouterProvider {
Ok((message, ProviderUsage::new(response_model, usage)))
}

/// Fetch supported models from OpenRouter API (only models with tool support)
async fn fetch_supported_models(&self) -> Result<Vec<String>, ProviderError> {
let response = self
.api_client
Expand Down Expand Up @@ -350,32 +349,8 @@ impl Provider for OpenRouterProvider {
let mut models: Vec<String> = data
.iter()
.filter_map(|model| {
// Get the model ID
let id = model.get("id").and_then(|v| v.as_str())?;

// Check if the model supports tools
let supported_params =
match model.get("supported_parameters").and_then(|v| v.as_array()) {
Some(params) => params,
None => {
// If supported_parameters is missing, skip this model (assume no tool support)
tracing::debug!(
"Model '{}' missing supported_parameters field, skipping",
id
);
return None;
}
};

let has_tool_support = supported_params
.iter()
.any(|param| param.as_str() == Some("tools"));

if has_tool_support {
Some(id.to_string())
} else {
None
}
Some(id.to_string())
})
.collect();

Expand Down