Skip to content
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
bed1b55
feat(provider-types): add thinking-effort capability types and provid…
matt2e Aug 4, 2026
d3a8ca7
feat(acp): mirror and forward the harness's thinking-effort option
matt2e Aug 4, 2026
88ceff4
feat(agent): route thinking-effort picks to the provider before recre…
matt2e Aug 4, 2026
49c8ee0
feat(acp): derive the thinking-effort menu from agent capability
matt2e Aug 4, 2026
a165b84
fix(acp): guard effort re-sends with the mirrored current, not a cache
matt2e Aug 4, 2026
0c4e9f2
fix(acp): treat an effort pick as applied when the agent has no selector
matt2e Aug 4, 2026
1ea7800
fix(acp): refresh the effort mirror from bootstrap config-option resp…
matt2e Aug 4, 2026
5833351
fix(acp): classify thinking-effort failures as invalid_params vs inte…
matt2e Aug 4, 2026
71a24e8
fix(acp): resolve the advertised and applied thinking effort from one…
matt2e Aug 5, 2026
5d91342
fix(agent): normalize ACP-only effort on provider switch
jbg Aug 20, 2026
bebd866
fix(acp): reject unsupported thinking effort values
jbg Aug 20, 2026
6fe7c6e
fix(acp): refresh effort after loading session
jbg Aug 20, 2026
3482eb4
test(recipe): cover ACP thinking effort
jbg Aug 20, 2026
891830b
fix(acp): ignore stale session updates
jbg Aug 20, 2026
9b3ead3
fix(acp): preserve bootstrap effort updates
jbg Aug 20, 2026
6a5f97c
fix(acp): forward asynchronous effort updates
jbg Aug 20, 2026
3235faa
fix(acp): subscribe before fork effort snapshot
jbg Aug 20, 2026
36e60eb
fix(acp): resume provider before load response
jbg Aug 20, 2026
f1a1179
fix(acp): publish cleared effort state
jbg Aug 20, 2026
9cb8a6c
fix(acp): resume provider before fork response
jbg Aug 20, 2026
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
2 changes: 1 addition & 1 deletion crates/goose-provider-types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ serde = { workspace = true }
serde_json = { workspace = true }
strum = { workspace = true }
thiserror = { workspace = true }
tokio = { workspace = true, features = ["time"] }
tokio = { workspace = true, features = ["sync", "time"] }
tracing = { workspace = true }
unicode-normalization = { version = "0.1.22", default-features = false, features = ["std"] }
uuid = { workspace = true, features = ["v4", "std"] }
Expand Down
36 changes: 36 additions & 0 deletions crates/goose-provider-types/src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use serde::{Deserialize, Serialize};
use serde_json::Value;
use std::collections::HashMap;
use std::pin::Pin;
use tokio::sync::watch;

use crate::{
canonical::{catalog::ProviderSetupMetadata, map_to_canonical_model, CanonicalModelRegistry},
Expand All @@ -17,6 +18,7 @@ use crate::{
model::ModelConfig,
permission::PermissionConfirmation,
retry::RetryConfig,
thinking::ThinkingEffortSupport,
};

/// Metadata about a provider's configuration requirements and capabilities
Expand Down Expand Up @@ -646,6 +648,40 @@ pub trait Provider: Send + Sync {
Ok(())
}

/// How this provider participates in thinking-effort selection. Providers
/// that manage reasoning through an external harness report the harness's
/// advertised capability; the default keeps the model-name-based path.
fn thinking_effort_support(&self) -> ThinkingEffortSupport {
ThinkingEffortSupport::Unspecified
}

/// Subscribe to provider-managed thinking-effort capability changes.
/// Providers without an asynchronous capability source return `None`.
fn subscribe_thinking_effort_support(&self) -> Option<watch::Receiver<ThinkingEffortSupport>> {
None
}

/// Forward a thinking-effort selection to the provider. Returns `Ok(true)`
/// when the provider applied the value itself (no provider recreation
/// needed); `Ok(false)` when the caller should use the legacy path.
async fn set_thinking_effort(
&self,
_session_id: &str,
_value: &str,
) -> Result<bool, ProviderError> {
Ok(false)
}

/// Apply a session's model selection after the provider is installed.
/// Providers that manage their own model (e.g. ACP harnesses) override
/// this to sync the selection before the first prompt.
async fn apply_model_selection(
&self,
_model_config: &ModelConfig,
) -> Result<(), ProviderError> {
Ok(())
}

fn permission_routing(&self) -> PermissionRouting {
PermissionRouting::Noop
}
Expand Down
6 changes: 6 additions & 0 deletions crates/goose-provider-types/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ pub enum ProviderError {
#[error("Request failed: {0}")]
RequestFailed(String),

/// Bad input rather than an operational failure: retrying is pointless, but
/// a different value may succeed.
#[error("Invalid value: {0}")]
InvalidValue(String),

#[error("Execution error: {0}")]
ExecutionError(String),

Expand Down Expand Up @@ -69,6 +74,7 @@ impl ProviderError {
ProviderError::ServerError(_) => "server",
ProviderError::NetworkError(_) => "network",
ProviderError::RequestFailed(_) => "request",
ProviderError::InvalidValue(_) => "invalid_value",
ProviderError::ExecutionError(_) => "execution",
ProviderError::UsageError(_) => "usage",
ProviderError::NotImplemented(_) => "not_implemented",
Expand Down
30 changes: 29 additions & 1 deletion crates/goose-provider-types/src/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,10 @@ impl ModelConfig {
}

pub fn with_default_thinking_effort(mut self, effort: Option<ThinkingEffort>) -> Self {
if self.thinking_effort().is_none() {
// Guard on raw-param presence rather than parseability: a persisted
// harness value like "default" doesn't parse into ThinkingEffort but
// is still an explicit user pick that must not be overwritten.
if self.request_param::<String>("thinking_effort").is_none() {
Comment thread
jbg marked this conversation as resolved.
Resolved
if let Some(effort) = effort {
self = self.with_thinking_effort(effort);
}
Expand Down Expand Up @@ -387,6 +390,31 @@ mod tests {
);
}

#[test]
fn with_default_thinking_effort_preserves_unparseable_raw_param() {
let config = config_with_params(
"test",
HashMap::from([("thinking_effort".to_string(), serde_json::json!("default"))]),
)
.with_default_thinking_effort(Some(ThinkingEffort::High));

assert_eq!(
config
.request_params
.as_ref()
.and_then(|params| params.get("thinking_effort")),
Some(&serde_json::json!("default"))
);
}

#[test]
fn with_default_thinking_effort_applies_when_absent() {
let config =
ModelConfig::new("test").with_default_thinking_effort(Some(ThinkingEffort::High));

assert_eq!(config.thinking_effort(), Some(ThinkingEffort::High));
}

#[test]
fn preserves_explicit_thinking_effort() {
let previous = config_with_params(
Expand Down
28 changes: 28 additions & 0 deletions crates/goose-provider-types/src/thinking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,34 @@ impl fmt::Display for ThinkingEffort {
}
}

/// A single selectable effort value advertised by a provider-managed harness.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ThinkingEffortOption {
pub value: String,
pub label: String,
}

/// A harness-advertised effort config option mirrored verbatim into goose's
/// `thinking_effort` session option.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ThinkingEffortCapability {
/// The harness's config option id, e.g. "effort".
pub option_id: String,
pub values: Vec<ThinkingEffortOption>,
pub current: Option<String>,
}

/// How a provider participates in thinking-effort selection.
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum ThinkingEffortSupport {
/// The provider doesn't manage effort; callers keep the model-name-based path.
Unspecified,
/// The provider manages reasoning itself but has no effort knob for the current model.
Unsupported,
/// The provider passes through a harness-advertised effort option.
Options(ThinkingEffortCapability),
}

#[cfg(test)]
mod tests {
use super::*;
Expand Down
Loading
Loading