Add unified thinking effort control across all providers#9242
Add unified thinking effort control across all providers#9242jh-block wants to merge 33 commits into
Conversation
|
Documentation preview deployed: https://pr-9242.goose-pr-previews-poc.pages.dev |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e82c782f40
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 19144daad0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a2ec5b9344
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 58da4d7d21
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a051baa586
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 52c2ff265a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aa8ac91b82
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Adds a single ThinkingEffort enum (off/low/medium/high/max) to ModelConfig that works across all providers, replacing the fragmented per-provider thinking controls. Backend: - Add ThinkingEffort enum to model.rs with FromStr/Display, read from request_params['thinking_effort'] or GOOSE_THINKING_EFFORT env var - OpenAI format: maps effort to reasoning_effort (low/medium/high) - Anthropic format: maps effort to thinking_type and thinking_effort - Databricks format: maps to reasoning_effort for OpenAI models and budget_tokens for Claude models - Google format: maps to thinking_level (low/high) for Gemini 3 - All providers fall back to legacy config when unified effort is unset UI: - Replace model-specific controls (Gemini thinking level, Claude thinking type/effort/budget) with a single 'Thinking Effort' dropdown - Show dropdown for any model that supports thinking (Claude, OpenAI reasoning models, Gemini 3) - Persist setting via GOOSE_THINKING_EFFORT config key
Remove all legacy configuration paths: - CLAUDE_THINKING_TYPE, CLAUDE_THINKING_EFFORT, CLAUDE_THINKING_BUDGET - CLAUDE_THINKING_ENABLED - GEMINI3_THINKING_LEVEL - Model name suffix effort encoding (e.g., o3-mini-high) All providers now use only the unified GOOSE_THINKING_EFFORT config (via request_params or env var). The CLI configure command now shows a single thinking effort prompt for any model that supports thinking. Also simplifies the CLI configure flow from model-specific multi-step thinking config to a single dropdown.
When a ModelConfig is created with a reasoning model name that has an effort suffix (e.g., 'o3-mini-high'), normalize_effort_suffix() now strips the suffix and sets thinking_effort in request_params. This ensures existing saved configurations with suffixed model names continue to work transparently. Only applies when no explicit thinking_effort is already set in request_params (explicit config always wins).
…t_params, avoid panic in configure
…to anthropic/databricks providers
…thinking to anthropic/databricks
…st, clarify type checks - Remove redundant local ThinkingEffort enum in anthropic.rs; use crate::model::ThinkingEffort directly since it has Display/FromStr - Simplify test_create_request_enabled_thinking_with_budget using cfg_with_effort and assert budget > 0 - Replace !!name checks with typeof === 'string' in SwitchModelModal Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: jh-block <jhugo@block.xyz>
Signed-off-by: jh-block <jhugo@block.xyz>
Signed-off-by: jh-block <jhugo@block.xyz>
Signed-off-by: jh-block <jhugo@block.xyz>
Signed-off-by: jh-block <jhugo@block.xyz>
Signed-off-by: jh-block <jhugo@block.xyz>
Signed-off-by: jh-block <jhugo@block.xyz>
Signed-off-by: jh-block <jhugo@block.xyz>
Signed-off-by: jh-block <jhugo@block.xyz>
c800e5c to
db5e545
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: db5e54527a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: jh-block <jhugo@block.xyz>
Signed-off-by: jh-block <jhugo@block.xyz>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 00fddd28f7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ac8d84177d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
f2e2910 to
713ae75
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 713ae756ec
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: jh-block <jhugo@block.xyz>
713ae75 to
c0b4bce
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c0b4bce830
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: jh-block <jhugo@block.xyz>
Signed-off-by: jh-block <jhugo@block.xyz>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ab1783305f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: jh-block <jhugo@block.xyz>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ef49673db6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: jh-block <jhugo@block.xyz>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6aae898ce0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: jh-block <jhugo@block.xyz>
|
Hey @jh-block 👋 — I was independently investigating how thinking/reasoning parameters flow across provider types in Goose and was about to start work on exactly this gap. Really glad to see this PR land first! |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b494213ec8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: jh-block <jhugo@block.xyz>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c8f0cacb4b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let claude_thinking_providers = ["anthropic", "databricks"]; | ||
| let supports_thinking = model.to_lowercase().starts_with("gemini-3") | ||
| || (model.to_lowercase().contains("claude") | ||
| && claude_thinking_providers.contains(&provider_name.as_str())) | ||
| || goose::model::ModelConfig::new(&model) |
There was a problem hiding this comment.
Offer unified thinking prompt for OpenRouter Claude models
The new CLI gating excludes Claude models unless the provider is anthropic or databricks, so goose configure skips the unified GOOSE_THINKING_EFFORT prompt for OpenRouter Claude selections even though this commit adds OpenRouter reasoning support via apply_reasoning_config when a model is reasoning-capable. In practice, configuring openrouter with a reasoning Claude model (for example claude-sonnet-4*) leaves users unable to set thinking effort through the CLI path, making the new feature unavailable from the primary setup flow.
Useful? React with 👍 / 👎.
|
Great work on this — the One gap worth flagging: local providers aren't wired up yet.
Both of these are listed as first-class providers on the goose docs providers page, so community users running local models would benefit from the same unified knob. The infrastructure is now in place — |
Replaces fragmented provider-specific thinking controls with a single unified Thinking Effort setting across supported providers.
Supersedes #7628 with the following changes:
Also updated some providers to support reasoning where they did not (or did not fully) before: