From 3249db6d372cbf7ce55cd5f9f5d1567477e1857e Mon Sep 17 00:00:00 2001 From: kimnamu Date: Fri, 19 Jun 2026 23:52:45 +0900 Subject: [PATCH 1/5] fix(bedrock): send inference config (max_tokens, temperature) on Converse The Bedrock provider built Converse and ConverseStream requests without calling .inference_config(...), so the configured max_tokens and temperature in ModelConfig were silently dropped on every call. Bedrock then applied its per-model server defaults, truncating responses to a small default max_tokens. The sibling Anthropic provider already sends these fields: max_tokens always (via ModelConfig::max_output_tokens) and temperature when the model supports it. This change adds a bedrock_inference_config helper that mirrors that behaviour and threads the result into both Converse and ConverseStream. Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/goose/src/providers/bedrock.rs | 12 ++- crates/goose/src/providers/formats/bedrock.rs | 91 ++++++++++++++++++- 2 files changed, 97 insertions(+), 6 deletions(-) diff --git a/crates/goose/src/providers/bedrock.rs b/crates/goose/src/providers/bedrock.rs index 0193c6652666..0a1d33637fed 100644 --- a/crates/goose/src/providers/bedrock.rs +++ b/crates/goose/src/providers/bedrock.rs @@ -27,8 +27,8 @@ use serde_json::Value; use smithy_transport_reqwest::ReqwestHttpClient; use super::formats::bedrock::{ - bedrock_anthropic_thinking_fields, from_bedrock_message, from_bedrock_usage, - to_bedrock_message_with_caching, to_bedrock_tool_config, + bedrock_anthropic_thinking_fields, bedrock_inference_config, from_bedrock_message, + from_bedrock_usage, to_bedrock_message_with_caching, to_bedrock_tool_config, }; pub(crate) const BEDROCK_PROVIDER_NAME: &str = "aws_bedrock"; @@ -76,6 +76,7 @@ struct ConverseRequestParts { messages: Vec, tool_config: Option, thinking_fields: Option, + inference_config: bedrock::InferenceConfiguration, } impl BedrockProvider { @@ -333,6 +334,7 @@ impl BedrockProvider { messages: bedrock_messages, tool_config, thinking_fields: bedrock_anthropic_thinking_fields(&self.model), + inference_config: bedrock_inference_config(&self.model), }) } @@ -352,7 +354,8 @@ impl BedrockProvider { .converse() .set_system(Some(parts.system_blocks)) .model_id(model_name.to_string()) - .set_messages(Some(parts.messages)); + .set_messages(Some(parts.messages)) + .inference_config(parts.inference_config); if let Some(fields) = parts.thinking_fields { request = request.additional_model_request_fields(fields); @@ -448,7 +451,8 @@ impl BedrockProvider { .converse_stream() .set_system(Some(parts.system_blocks)) .model_id(model_name.to_string()) - .set_messages(Some(parts.messages)); + .set_messages(Some(parts.messages)) + .inference_config(parts.inference_config); if let Some(fields) = parts.thinking_fields { request = request.additional_model_request_fields(fields); diff --git a/crates/goose/src/providers/formats/bedrock.rs b/crates/goose/src/providers/formats/bedrock.rs index 57f0eae340b1..998fcf13134b 100644 --- a/crates/goose/src/providers/formats/bedrock.rs +++ b/crates/goose/src/providers/formats/bedrock.rs @@ -16,8 +16,8 @@ use serde_json::Value; use crate::conversation::message::{Message, MessageContent}; use crate::providers::formats::anthropic::{ - adaptive_output_effort, thinking_budget_tokens, thinking_type_for_provider, ThinkingType, - ANTHROPIC_PROVIDER_NAME, + adaptive_output_effort, model_supports_temperature, thinking_budget_tokens, + thinking_type_for_provider, ThinkingType, ANTHROPIC_PROVIDER_NAME, }; use goose_providers::conversation::token_usage::Usage; use goose_providers::model::ModelConfig; @@ -81,6 +81,46 @@ fn strip_bedrock_version_suffix(model_name: &str) -> String { .into_owned() } +/// Build the Bedrock `InferenceConfiguration` (`maxTokens`, `temperature`) for +/// a request from the active [`ModelConfig`]. +/// +/// Without this the `Converse`/`ConverseStream` APIs fall back to per-model +/// server defaults, so a configured `max_tokens`/`temperature` is silently +/// dropped. Mirrors the Anthropic provider, which already sends these fields: +/// `max_tokens` always (via [`ModelConfig::max_output_tokens`]) and +/// `temperature` only when the model supports it. Temperature support is +/// resolved against the Anthropic canonical registry for `anthropic.*` model +/// ids (the same mapping used for thinking), so reasoning models that reject a +/// custom temperature keep the server default. +pub fn bedrock_inference_config(model_config: &ModelConfig) -> bedrock::InferenceConfiguration { + let mut builder = + bedrock::InferenceConfiguration::builder().max_tokens(model_config.max_output_tokens()); + + if let Some(temperature) = model_config.temperature { + if bedrock_model_supports_temperature(model_config) { + builder = builder.temperature(temperature); + } + } + + builder.build() +} + +/// Whether `temperature` may be sent for this Bedrock model. For `anthropic.*` +/// ids we resolve against the Anthropic canonical registry (mapping the model +/// name the same way [`bedrock_anthropic_thinking_type`] does); other models +/// default to allowing it, matching [`model_supports_temperature`]. +fn bedrock_model_supports_temperature(model_config: &ModelConfig) -> bool { + if let Some((_, anthropic_model)) = model_config.model_name.rsplit_once("anthropic.") { + let anthropic_config = ModelConfig { + model_name: strip_bedrock_version_suffix(anthropic_model), + ..model_config.clone() + }; + model_supports_temperature(ANTHROPIC_PROVIDER_NAME, &anthropic_config) + } else { + true + } +} + pub fn to_bedrock_message_with_caching( message: &Message, enable_caching: bool, @@ -1194,4 +1234,51 @@ mod tests { Ok(()) } + + #[test] + fn test_bedrock_inference_config_sets_max_tokens_and_temperature() { + let mut config = ModelConfig::new_or_fail("us.anthropic.claude-sonnet-4-5-20250929-v1:0"); + config.max_tokens = Some(8192); + config.temperature = Some(0.5); + + let inference_config = bedrock_inference_config(&config); + + assert_eq!(inference_config.max_tokens(), Some(8192)); + assert_eq!(inference_config.temperature(), Some(0.5)); + } + + #[test] + fn test_bedrock_inference_config_defaults_max_tokens_without_config() { + let mut config = ModelConfig::new_or_fail("us.anthropic.claude-sonnet-4-5-20250929-v1:0"); + config.max_tokens = None; + config.temperature = None; + + let inference_config = bedrock_inference_config(&config); + + // max_tokens always falls back to the model default so the response is + // never silently truncated to the server's per-model default. + assert_eq!( + inference_config.max_tokens(), + Some(config.max_output_tokens()) + ); + assert_eq!(inference_config.temperature(), None); + } + + #[test] + fn test_bedrock_inference_config_omits_temperature_for_unsupported_model() { + // The Anthropic canonical registry maps this id and reports whether a + // custom temperature may be sent; when it cannot, temperature is left + // unset so the server default is used. + let mut config = ModelConfig::new_or_fail("us.anthropic.claude-sonnet-4-5-20250929-v1:0"); + config.temperature = Some(0.5); + + let supported = bedrock_model_supports_temperature(&config); + let inference_config = bedrock_inference_config(&config); + + if supported { + assert_eq!(inference_config.temperature(), Some(0.5)); + } else { + assert_eq!(inference_config.temperature(), None); + } + } } From ddc4485563d062d1742306d6096697a3ad2805e7 Mon Sep 17 00:00:00 2001 From: kimnamu Date: Sat, 20 Jun 2026 05:52:01 +0900 Subject: [PATCH 2/5] fix(bedrock): only send max_tokens when explicitly configured MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per review feedback (@DOsinga, codex): forwarding ModelConfig::max_output_tokens() pinned every model without a canonical-catalog entry (e.g. cross-region ids like us.anthropic.claude-...) to the generic 4096 fallback, capping models whose real output limit is much higher. Now max_tokens is sent only when the user explicitly sets it, mirroring how temperature is handled — unset values keep Bedrock's per-model server default. Updates tests accordingly. Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/goose/src/providers/formats/bedrock.rs | 50 +++++++++++++------ 1 file changed, 35 insertions(+), 15 deletions(-) diff --git a/crates/goose/src/providers/formats/bedrock.rs b/crates/goose/src/providers/formats/bedrock.rs index 998fcf13134b..451c5c97922f 100644 --- a/crates/goose/src/providers/formats/bedrock.rs +++ b/crates/goose/src/providers/formats/bedrock.rs @@ -86,15 +86,24 @@ fn strip_bedrock_version_suffix(model_name: &str) -> String { /// /// Without this the `Converse`/`ConverseStream` APIs fall back to per-model /// server defaults, so a configured `max_tokens`/`temperature` is silently -/// dropped. Mirrors the Anthropic provider, which already sends these fields: -/// `max_tokens` always (via [`ModelConfig::max_output_tokens`]) and -/// `temperature` only when the model supports it. Temperature support is -/// resolved against the Anthropic canonical registry for `anthropic.*` model -/// ids (the same mapping used for thinking), so reasoning models that reject a -/// custom temperature keep the server default. +/// dropped. Each field is sent only when the user has configured it, so that +/// unset values continue to use Bedrock's per-model server defaults rather than +/// being pinned to a generic fallback: +/// - `max_tokens` is sent only when explicitly set (`model_config.max_tokens`). +/// Using [`ModelConfig::max_output_tokens`] here would forward its `4096` +/// fallback for every model whose id is not in the canonical catalog (e.g. +/// cross-region ids like `us.anthropic.claude-...`), capping models whose +/// real output limit is far higher. +/// - `temperature` is sent only when set and the model supports it. Support is +/// resolved against the Anthropic canonical registry for `anthropic.*` model +/// ids (the same mapping used for thinking), so reasoning models that reject a +/// custom temperature keep the server default. pub fn bedrock_inference_config(model_config: &ModelConfig) -> bedrock::InferenceConfiguration { - let mut builder = - bedrock::InferenceConfiguration::builder().max_tokens(model_config.max_output_tokens()); + let mut builder = bedrock::InferenceConfiguration::builder(); + + if let Some(max_tokens) = model_config.max_tokens { + builder = builder.max_tokens(max_tokens); + } if let Some(temperature) = model_config.temperature { if bedrock_model_supports_temperature(model_config) { @@ -1248,22 +1257,33 @@ mod tests { } #[test] - fn test_bedrock_inference_config_defaults_max_tokens_without_config() { + fn test_bedrock_inference_config_omits_max_tokens_without_config() { let mut config = ModelConfig::new_or_fail("us.anthropic.claude-sonnet-4-5-20250929-v1:0"); config.max_tokens = None; config.temperature = None; let inference_config = bedrock_inference_config(&config); - // max_tokens always falls back to the model default so the response is - // never silently truncated to the server's per-model default. - assert_eq!( - inference_config.max_tokens(), - Some(config.max_output_tokens()) - ); + // When max_tokens is not explicitly configured we leave it unset so + // Bedrock applies its per-model server default. Forwarding + // ModelConfig::max_output_tokens() here would pin every model without a + // canonical-catalog entry (e.g. cross-region ids) to the generic 4096 + // fallback, capping models whose real output limit is much higher. + assert_eq!(inference_config.max_tokens(), None); assert_eq!(inference_config.temperature(), None); } + #[test] + fn test_bedrock_inference_config_sends_explicit_max_tokens() { + let mut config = ModelConfig::new_or_fail("us.anthropic.claude-sonnet-4-5-20250929-v1:0"); + config.max_tokens = Some(4096); + + let inference_config = bedrock_inference_config(&config); + + // An explicitly configured value is always forwarded. + assert_eq!(inference_config.max_tokens(), Some(4096)); + } + #[test] fn test_bedrock_inference_config_omits_temperature_for_unsupported_model() { // The Anthropic canonical registry maps this id and reports whether a From 8d5d9ad986ab4f0339b01228c4f049cc13fb3316 Mon Sep 17 00:00:00 2001 From: kimnamu Date: Sat, 20 Jun 2026 06:38:11 +0900 Subject: [PATCH 3/5] fix(bedrock): clamp thinking budget against explicit max_tokens Per codex review on this PR: when an explicit max_tokens is below the selected thinking budget (e.g. GOOSE_MAX_TOKENS=4096 with thinking_effort=high, budget 16000), the budget_tokens emitted by bedrock_anthropic_thinking_fields would conflict with the maxTokens now sent by bedrock_inference_config. Thinking tokens count against the cap, so mirror the Anthropic formatter: clamp the budget to leave MIN_ANSWER_TOKENS of room, and drop thinking when even a minimal budget wouldn't fit. Only clamps when max_tokens is explicitly set (otherwise Bedrock applies its per-model default). Shares MIN_ANSWER_TOKENS with the Anthropic formatter. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../goose/src/providers/formats/anthropic.rs | 3 +- crates/goose/src/providers/formats/bedrock.rs | 68 ++++++++++++++++--- 2 files changed, 62 insertions(+), 9 deletions(-) diff --git a/crates/goose/src/providers/formats/anthropic.rs b/crates/goose/src/providers/formats/anthropic.rs index fa5315b36b43..17b9494701ff 100644 --- a/crates/goose/src/providers/formats/anthropic.rs +++ b/crates/goose/src/providers/formats/anthropic.rs @@ -568,7 +568,8 @@ fn legacy_thinking_budget_tokens() -> Option { // Anthropic counts thinking tokens against max_tokens, so the budget must leave // room for a response. Clamp it to preserve at least this many answer tokens, and // drop thinking only when even a minimal budget wouldn't fit under the cap. -const MIN_ANSWER_TOKENS: i32 = 1024; +// Shared with the Bedrock formatter, which applies the same clamp. +pub(crate) const MIN_ANSWER_TOKENS: i32 = 1024; fn apply_thinking_config( payload: &mut Value, diff --git a/crates/goose/src/providers/formats/bedrock.rs b/crates/goose/src/providers/formats/bedrock.rs index 451c5c97922f..1c8c0782379c 100644 --- a/crates/goose/src/providers/formats/bedrock.rs +++ b/crates/goose/src/providers/formats/bedrock.rs @@ -17,7 +17,7 @@ use serde_json::Value; use crate::conversation::message::{Message, MessageContent}; use crate::providers::formats::anthropic::{ adaptive_output_effort, model_supports_temperature, thinking_budget_tokens, - thinking_type_for_provider, ThinkingType, ANTHROPIC_PROVIDER_NAME, + thinking_type_for_provider, ThinkingType, ANTHROPIC_PROVIDER_NAME, MIN_ANSWER_TOKENS, }; use goose_providers::conversation::token_usage::Usage; use goose_providers::model::ModelConfig; @@ -33,13 +33,27 @@ pub fn bedrock_anthropic_thinking_fields(model_config: &ModelConfig) -> Option Document::Object(HashMap::from([ - ("type".to_string(), Document::String("enabled".to_string())), - ( - "budget_tokens".to_string(), - Document::Number(Number::PosInt(thinking_budget_tokens(model_config) as u64)), - ), - ])), + ThinkingType::Enabled => { + // Thinking tokens count against `maxTokens`, which `bedrock_inference_config` + // now sends when explicitly configured. Mirror the Anthropic formatter: clamp + // the budget to leave room for an answer, and drop thinking entirely when even + // a minimal budget wouldn't fit under the cap. When max_tokens is unset, Bedrock + // applies its per-model default so there is nothing to clamp against. + let mut budget_tokens = thinking_budget_tokens(model_config); + if let Some(max_tokens) = model_config.max_tokens { + budget_tokens = budget_tokens.min(max_tokens.saturating_sub(MIN_ANSWER_TOKENS)); + if budget_tokens < MIN_ANSWER_TOKENS { + return None; + } + } + Document::Object(HashMap::from([ + ("type".to_string(), Document::String("enabled".to_string())), + ( + "budget_tokens".to_string(), + Document::Number(Number::PosInt(budget_tokens as u64)), + ), + ])) + } ThinkingType::Disabled => return None, }; @@ -600,6 +614,44 @@ mod tests { ); } + #[test] + fn test_bedrock_anthropic_thinking_fields_clamped_to_max_tokens() { + // budget (4000) exceeds the room left under an explicit max_tokens, so it + // is clamped to max_tokens - MIN_ANSWER_TOKENS, matching the Anthropic + // formatter. Without max_tokens set there is nothing to clamp against. + let mut params = HashMap::new(); + params.insert("thinking_effort".to_string(), json!("low")); + let mut config = ModelConfig::new_or_fail("us.anthropic.claude-3-7-sonnet-20250219-v1:0"); + config.request_params = Some(params); + config.reasoning = Some(true); + config.max_tokens = Some(3000); + + let fields = bedrock_anthropic_thinking_fields(&config).expect("thinking fields"); + assert_eq!( + from_bedrock_json(&fields).unwrap(), + json!({ + "thinking": { + "type": "enabled", + "budget_tokens": 3000 - 1024 + } + }) + ); + } + + #[test] + fn test_bedrock_anthropic_thinking_fields_dropped_when_no_room() { + // When even a minimal budget wouldn't leave MIN_ANSWER_TOKENS under the + // cap, thinking is dropped rather than emitting an unsatisfiable request. + let mut params = HashMap::new(); + params.insert("thinking_effort".to_string(), json!("low")); + let mut config = ModelConfig::new_or_fail("us.anthropic.claude-3-7-sonnet-20250219-v1:0"); + config.request_params = Some(params); + config.reasoning = Some(true); + config.max_tokens = Some(1500); + + assert!(bedrock_anthropic_thinking_fields(&config).is_none()); + } + #[test] fn test_bedrock_anthropic_thinking_fields_disabled() { let mut config = ModelConfig::new_or_fail("us.anthropic.claude-3-7-sonnet-20250219-v1:0"); From 350bba987fdd0998ee61cde2a308339cf37d5c06 Mon Sep 17 00:00:00 2001 From: kimnamu Date: Wed, 24 Jun 2026 10:08:04 +0900 Subject: [PATCH 4/5] fix(bedrock): honor registry temperature support --- crates/goose/src/providers/formats/bedrock.rs | 27 +++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/crates/goose/src/providers/formats/bedrock.rs b/crates/goose/src/providers/formats/bedrock.rs index 1c8c0782379c..c2a17edf4c42 100644 --- a/crates/goose/src/providers/formats/bedrock.rs +++ b/crates/goose/src/providers/formats/bedrock.rs @@ -15,6 +15,8 @@ use rmcp::model::{ use serde_json::Value; use crate::conversation::message::{Message, MessageContent}; +use crate::providers::bedrock::BEDROCK_PROVIDER_NAME; +use crate::providers::canonical::maybe_get_canonical_model; use crate::providers::formats::anthropic::{ adaptive_output_effort, model_supports_temperature, thinking_budget_tokens, thinking_type_for_provider, ThinkingType, ANTHROPIC_PROVIDER_NAME, MIN_ANSWER_TOKENS, @@ -110,8 +112,9 @@ fn strip_bedrock_version_suffix(model_name: &str) -> String { /// real output limit is far higher. /// - `temperature` is sent only when set and the model supports it. Support is /// resolved against the Anthropic canonical registry for `anthropic.*` model -/// ids (the same mapping used for thinking), so reasoning models that reject a -/// custom temperature keep the server default. +/// ids (the same mapping used for thinking) and the Bedrock canonical registry +/// for other known Bedrock ids, so models that reject a custom temperature keep +/// the server default. pub fn bedrock_inference_config(model_config: &ModelConfig) -> bedrock::InferenceConfiguration { let mut builder = bedrock::InferenceConfiguration::builder(); @@ -130,8 +133,9 @@ pub fn bedrock_inference_config(model_config: &ModelConfig) -> bedrock::Inferenc /// Whether `temperature` may be sent for this Bedrock model. For `anthropic.*` /// ids we resolve against the Anthropic canonical registry (mapping the model -/// name the same way [`bedrock_anthropic_thinking_type`] does); other models -/// default to allowing it, matching [`model_supports_temperature`]. +/// name the same way [`bedrock_anthropic_thinking_type`] does); for other known +/// Bedrock ids we consult the Bedrock canonical registry and otherwise keep the +/// permissive fallback used by [`model_supports_temperature`]. fn bedrock_model_supports_temperature(model_config: &ModelConfig) -> bool { if let Some((_, anthropic_model)) = model_config.model_name.rsplit_once("anthropic.") { let anthropic_config = ModelConfig { @@ -140,7 +144,9 @@ fn bedrock_model_supports_temperature(model_config: &ModelConfig) -> bool { }; model_supports_temperature(ANTHROPIC_PROVIDER_NAME, &anthropic_config) } else { - true + maybe_get_canonical_model(BEDROCK_PROVIDER_NAME, &model_config.model_name) + .and_then(|model| model.temperature) + .unwrap_or(true) } } @@ -1353,4 +1359,15 @@ mod tests { assert_eq!(inference_config.temperature(), None); } } + + #[test] + fn test_bedrock_inference_config_omits_temperature_for_bedrock_registry_unsupported_model() { + let mut config = ModelConfig::new_or_fail("openai.gpt-5.4"); + config.temperature = Some(0.5); + + let inference_config = bedrock_inference_config(&config); + + assert!(!bedrock_model_supports_temperature(&config)); + assert_eq!(inference_config.temperature(), None); + } } From 69480096624829aa4c4a9e054b26463e4d8f1a16 Mon Sep 17 00:00:00 2001 From: Douwe M Osinga Date: Tue, 30 Jun 2026 18:52:12 -0400 Subject: [PATCH 5/5] fix: make MIN_ANSWER_TOKENS public and use ModelConfig::new after main merge --- crates/goose-providers/src/formats/anthropic.rs | 2 +- crates/goose/src/providers/formats/bedrock.rs | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/goose-providers/src/formats/anthropic.rs b/crates/goose-providers/src/formats/anthropic.rs index ad05f3f24c7d..8b3feaeb2939 100644 --- a/crates/goose-providers/src/formats/anthropic.rs +++ b/crates/goose-providers/src/formats/anthropic.rs @@ -619,7 +619,7 @@ pub fn thinking_budget_tokens(model_config: &ModelConfig) -> i32 { // room for a response. Clamp it to preserve at least this many answer tokens, and // drop thinking only when even a minimal budget wouldn't fit under the cap. // Shared with the Bedrock formatter, which applies the same clamp. -pub(crate) const MIN_ANSWER_TOKENS: i32 = 1024; +pub const MIN_ANSWER_TOKENS: i32 = 1024; fn apply_thinking_config( payload: &mut Value, diff --git a/crates/goose/src/providers/formats/bedrock.rs b/crates/goose/src/providers/formats/bedrock.rs index 2c2b8f09c190..9e0de9caa75c 100644 --- a/crates/goose/src/providers/formats/bedrock.rs +++ b/crates/goose/src/providers/formats/bedrock.rs @@ -639,7 +639,7 @@ mod tests { // formatter. Without max_tokens set there is nothing to clamp against. let mut params = HashMap::new(); params.insert("thinking_effort".to_string(), json!("low")); - let mut config = ModelConfig::new_or_fail("us.anthropic.claude-3-7-sonnet-20250219-v1:0"); + let mut config = ModelConfig::new("us.anthropic.claude-3-7-sonnet-20250219-v1:0"); config.request_params = Some(params); config.reasoning = Some(true); config.max_tokens = Some(3000); @@ -662,7 +662,7 @@ mod tests { // cap, thinking is dropped rather than emitting an unsatisfiable request. let mut params = HashMap::new(); params.insert("thinking_effort".to_string(), json!("low")); - let mut config = ModelConfig::new_or_fail("us.anthropic.claude-3-7-sonnet-20250219-v1:0"); + let mut config = ModelConfig::new("us.anthropic.claude-3-7-sonnet-20250219-v1:0"); config.request_params = Some(params); config.reasoning = Some(true); config.max_tokens = Some(1500); @@ -1338,7 +1338,7 @@ mod tests { #[test] fn test_bedrock_inference_config_sets_max_tokens_and_temperature() { - let mut config = ModelConfig::new_or_fail("us.anthropic.claude-sonnet-4-5-20250929-v1:0"); + let mut config = ModelConfig::new("us.anthropic.claude-sonnet-4-5-20250929-v1:0"); config.max_tokens = Some(8192); config.temperature = Some(0.5); @@ -1350,7 +1350,7 @@ mod tests { #[test] fn test_bedrock_inference_config_omits_max_tokens_without_config() { - let mut config = ModelConfig::new_or_fail("us.anthropic.claude-sonnet-4-5-20250929-v1:0"); + let mut config = ModelConfig::new("us.anthropic.claude-sonnet-4-5-20250929-v1:0"); config.max_tokens = None; config.temperature = None; @@ -1367,7 +1367,7 @@ mod tests { #[test] fn test_bedrock_inference_config_sends_explicit_max_tokens() { - let mut config = ModelConfig::new_or_fail("us.anthropic.claude-sonnet-4-5-20250929-v1:0"); + let mut config = ModelConfig::new("us.anthropic.claude-sonnet-4-5-20250929-v1:0"); config.max_tokens = Some(4096); let inference_config = bedrock_inference_config(&config); @@ -1381,7 +1381,7 @@ mod tests { // The Anthropic canonical registry maps this id and reports whether a // custom temperature may be sent; when it cannot, temperature is left // unset so the server default is used. - let mut config = ModelConfig::new_or_fail("us.anthropic.claude-sonnet-4-5-20250929-v1:0"); + let mut config = ModelConfig::new("us.anthropic.claude-sonnet-4-5-20250929-v1:0"); config.temperature = Some(0.5); let supported = bedrock_model_supports_temperature(&config); @@ -1396,7 +1396,7 @@ mod tests { #[test] fn test_bedrock_inference_config_omits_temperature_for_bedrock_registry_unsupported_model() { - let mut config = ModelConfig::new_or_fail("openai.gpt-5.4"); + let mut config = ModelConfig::new("openai.gpt-5.4"); config.temperature = Some(0.5); let inference_config = bedrock_inference_config(&config);