some manual fixes after rebase

This commit is contained in:
Jochen
2025-12-09 17:11:19 +11:00
parent 633da0d8a6
commit a9dbe5f7d3
2 changed files with 6 additions and 4 deletions

View File

@@ -1472,7 +1472,7 @@ impl<W: UiWriter> Agent<W> {
// For Anthropic with thinking enabled, ensure max_tokens is sufficient // For Anthropic with thinking enabled, ensure max_tokens is sufficient
// Anthropic requires: max_tokens > thinking.budget_tokens // Anthropic requires: max_tokens > thinking.budget_tokens
if provider_name == "anthropic" { if provider_name == "anthropic" {
if let Some(budget) = self.get_thinking_budget_tokens() { if let Some(budget) = self.get_thinking_budget_tokens(provider_name) {
let minimum_for_thinking = budget + 1024; let minimum_for_thinking = budget + 1024;
return base.max(minimum_for_thinking); return base.max(minimum_for_thinking);
} }
@@ -1565,7 +1565,7 @@ impl<W: UiWriter> Agent<W> {
// but ensure we don't go below thinking budget floor for Anthropic // but ensure we don't go below thinking budget floor for Anthropic
let proposed_max_tokens = available.min(configured_max_tokens); let proposed_max_tokens = available.min(configured_max_tokens);
let proposed_max_tokens = if provider_name == "anthropic" { let proposed_max_tokens = if provider_name == "anthropic" {
if let Some(budget) = self.get_thinking_budget_tokens() { if let Some(budget) = self.get_thinking_budget_tokens(provider_name) {
proposed_max_tokens.max(budget + 1024) proposed_max_tokens.max(budget + 1024)
} else { } else {
proposed_max_tokens proposed_max_tokens
@@ -2577,7 +2577,7 @@ impl<W: UiWriter> Agent<W> {
// Determine if we need to disable thinking mode for this request // Determine if we need to disable thinking mode for this request
// Anthropic requires: max_tokens > thinking.budget_tokens + 1024 // Anthropic requires: max_tokens > thinking.budget_tokens + 1024
let disable_thinking = self.get_thinking_budget_tokens().map_or(false, |budget| { let disable_thinking = self.get_thinking_budget_tokens(provider.name()).map_or(false, |budget| {
let minimum_for_thinking = budget + 1024; let minimum_for_thinking = budget + 1024;
let should_disable = summary_max_tokens <= minimum_for_thinking; let should_disable = summary_max_tokens <= minimum_for_thinking;
if should_disable { if should_disable {
@@ -3611,7 +3611,7 @@ impl<W: UiWriter> Agent<W> {
// Determine if we need to disable thinking mode for this request // Determine if we need to disable thinking mode for this request
// Anthropic requires: max_tokens > thinking.budget_tokens + 1024 // Anthropic requires: max_tokens > thinking.budget_tokens + 1024
let disable_thinking = self.get_thinking_budget_tokens().map_or(false, |budget| { let disable_thinking = self.get_thinking_budget_tokens(provider.name()).map_or(false, |budget| {
let minimum_for_thinking = budget + 1024; let minimum_for_thinking = budget + 1024;
let should_disable = summary_max_tokens <= minimum_for_thinking; let should_disable = summary_max_tokens <= minimum_for_thinking;
if should_disable { if should_disable {

View File

@@ -122,6 +122,7 @@ pub async fn generate_requirements_summary(
temperature: Some(0.3), // Low temperature for consistent output temperature: Some(0.3), // Low temperature for consistent output
stream: false, stream: false,
tools: None, tools: None,
disable_thinking: false,
}; };
let response = provider let response = provider
@@ -170,6 +171,7 @@ pub async fn generate_commit_message(
temperature: Some(0.3), temperature: Some(0.3),
stream: false, stream: false,
tools: None, tools: None,
disable_thinking: false,
}; };
let response = provider let response = provider