Switch tetrate tool filtering back to supports_computer_use#7024
Switch tetrate tool filtering back to supports_computer_use#7024
Conversation
There was a problem hiding this comment.
Pull request overview
This PR reverts part of the changes from PR #6808, which had switched the Tetrate provider from checking supports_computer_use to checking supported_parameters for determining tool support. The author indicates that the supported_parameters field isn't appearing in API responses, so this PR implements a more permissive filtering approach.
Changes:
- Replaces explicit check for
supported_parametersarray containing "tools" with a more concise logic usingis_some_and - Changes behavior to include models when
supported_parametersfield is missing (fallback behavior) - Introduces confusingly-named
dominatedvariable to track whether models lack tool support
| .and_then(|v| v.as_bool()) | ||
| .unwrap_or(false); | ||
| if supports_computer_use { | ||
| Some(id.to_string()) | ||
| } else { | ||
| tracing::debug!("Model '{}' does not support tools, skipping", id); | ||
| None | ||
| } | ||
| }) | ||
| .collect(); | ||
|
|
||
| // If no models with tool support were found, fall back to manual entry | ||
| if models.is_empty() { | ||
| tracing::warn!("No models with tool support found in Tetrate Agent Router Service API response, falling back to manual model entry"); | ||
| tracing::warn!("No models found in Tetrate Agent Router Service API response, falling back to manual model entry"); | ||
| return Ok(None); | ||
| } |
There was a problem hiding this comment.
The PR description states this switches back to using "supports_computer_use" but the code still checks "supported_parameters". The logic also has a confusing flow: when supported_parameters is missing, models are included (dominated=false), but the comment at line 300 suggests this is intentional. However, this differs from the OpenRouter provider which explicitly skips models missing supported_parameters (see openrouter.rs:362-367). If models without this field should be included as a fallback, the variable name "dominated" is misleading - consider renaming to something like "lacks_tool_support" for clarity.
| .unwrap_or(false); | ||
| if supports_computer_use { | ||
| Some(id.to_string()) | ||
| } else { | ||
| tracing::debug!("Model '{}' does not support tools, skipping", id); | ||
| None | ||
| } |
There was a problem hiding this comment.
The variable name "dominated" is unclear and misleading in this context. It appears to indicate whether a model lacks tool support, but the name doesn't convey this meaning. Consider renaming to "lacks_tool_support" or "should_skip" to make the logic more readable.
| .and_then(|v| v.as_bool()) | ||
| .unwrap_or(false); | ||
| if supports_computer_use { | ||
| Some(id.to_string()) | ||
| } else { | ||
| tracing::debug!("Model '{}' does not support tools, skipping", id); | ||
| None | ||
| } | ||
| }) | ||
| .collect(); | ||
|
|
||
| // If no models with tool support were found, fall back to manual entry | ||
| if models.is_empty() { | ||
| tracing::warn!("No models with tool support found in Tetrate Agent Router Service API response, falling back to manual model entry"); | ||
| tracing::warn!("No models found in Tetrate Agent Router Service API response, falling back to manual model entry"); | ||
| return Ok(None); |
There was a problem hiding this comment.
The comment says "If supported_parameters is available, check for tool support" but the logic using is_some_and will include models when supported_parameters is missing. This creates a permissive fallback that differs from the OpenRouter provider (which explicitly skips models missing this field). If this is intentional to handle Tetrate API responses that don't include the field, it should be documented in a comment explaining why Tetrate differs from OpenRouter's stricter approach.
…webtoken-10.3.0 * origin/main: (54 commits) Switch tetrate tool filtering back to supports_computer_use (#7024) feat(ui): add inline rename for chat sessions in sidebar (#6995) fix: handle toolnames without underscores (#7015) feat(claude-code): use stream-json protocol for persistent sessions (#7029) test(providers): add model listing to live provider suite (#7038) Agent added too much (#7036) fix(deps): bump tree-sitter to 0.26 and set sqlx default-features=false to fix RUSTSEC advisories (#7031) feat: add image support and improve error resilience for Codex (#7033) fix(providers): Azure OpenAI model listing 404 during configure (#7034) fix(deps): bump bat to 0.26.1 to resolve RUSTSEC-2026-0008 (#7021) Don't swallow Tetrate errors (#6998) docs: remove hardcoded_stuff links (#7016) fix(ui): keep Hub chat input from overlapping SessionInsights on paste (#6719) Clean up css (#6944) docs: aws bedrock bearer token auth (#6990) docs: extended custom provider headers support (#7012) feat(cli): add type-to-search filtering to select/multiselect dialogs (#6862) feat(ci): add cargo-audit workflow for scanning rust vulnerabilities (#6351) feat: add User-Agent header to MCP HTTP requests (#6988) chore(deps-dev): bump webpack from 5.102.1 to 5.105.0 in /ui/desktop (#6996) ... # Conflicts: # Cargo.lock
* origin/main: Remove build-dependencies section from Cargo.toml (#6946) add /rp-why skill blog post (#6997) fix: fix snake_case function names in code_execution instructions (#7035) Document max_turns settings for recipes and subagents (#7044) feat: update Groq declarative data with Preview Models (#7023) fix(codex): propagate extended PATH to codex subprocess (#6874) Switch tetrate tool filtering back to supports_computer_use (#7024) feat(ui): add inline rename for chat sessions in sidebar (#6995) fix: handle toolnames without underscores (#7015) feat(claude-code): use stream-json protocol for persistent sessions (#7029) test(providers): add model listing to live provider suite (#7038) Agent added too much (#7036) fix(deps): bump tree-sitter to 0.26 and set sqlx default-features=false to fix RUSTSEC advisories (#7031) feat: add image support and improve error resilience for Codex (#7033) fix(providers): Azure OpenAI model listing 404 during configure (#7034) fix(deps): bump bat to 0.26.1 to resolve RUSTSEC-2026-0008 (#7021) Don't swallow Tetrate errors (#6998) docs: remove hardcoded_stuff links (#7016) # Conflicts: # ui/desktop/src/components/GooseSidebar/AppSidebar.tsx
* origin/main: (141 commits) Add global config switch to disable automatic session naming (#7052) docs: add blog post - 8 Things You Didn't Know About Code Mode (#7059) fix: ensure animated elements are visible when prefers-reduced-motion is enabled (#7047) Show recommended model on failture (#7040) feat(ui): add session content search via API (#7050) docs: fix img url (#7053) Desktop UI for deleting custom providers (#7042) Add blog post: How I Used RPI to Build an OpenClaw Alternative (#7051) Remove build-dependencies section from Cargo.toml (#6946) add /rp-why skill blog post (#6997) fix: fix snake_case function names in code_execution instructions (#7035) Document max_turns settings for recipes and subagents (#7044) feat: update Groq declarative data with Preview Models (#7023) fix(codex): propagate extended PATH to codex subprocess (#6874) Switch tetrate tool filtering back to supports_computer_use (#7024) feat(ui): add inline rename for chat sessions in sidebar (#6995) fix: handle toolnames without underscores (#7015) feat(claude-code): use stream-json protocol for persistent sessions (#7029) test(providers): add model listing to live provider suite (#7038) Agent added too much (#7036) ...
We swapped this in: #6808 but I'm not seeing the new field at all, leading to all models being filtered. supports_computer_use still seems like the best proxy from what is provided.