From 87ec6022fa31db40996e5b0766f6ade8ced30e17 Mon Sep 17 00:00:00 2001 From: ehushubhamshaw Date: Sat, 14 Mar 2026 17:07:59 -0400 Subject: [PATCH] fix: resolve post-merge compilation errors - Add TOOL_CHOICE_OVERRIDE task_local to agent/loop_.rs (used by anthropic provider) - Gate create_board_info_tools behind hardware feature in peripherals/mod.rs - Add missing tool_choice field to NativeChatRequest test in anthropic.rs --- src/agent/loop_.rs | 4 ++++ src/peripherals/mod.rs | 6 ++++++ src/providers/anthropic.rs | 1 + 3 files changed, 11 insertions(+) diff --git a/src/agent/loop_.rs b/src/agent/loop_.rs index 07fd02fa3..c464dc044 100644 --- a/src/agent/loop_.rs +++ b/src/agent/loop_.rs @@ -336,6 +336,10 @@ tokio::task_local! { static TOOL_LOOP_CANARY_TOKENS_ENABLED: bool; } +tokio::task_local! { + pub(crate) static TOOL_CHOICE_OVERRIDE: Option; +} + const AUTO_CRON_DELIVERY_CHANNELS: &[&str] = &[ "telegram", "discord", diff --git a/src/peripherals/mod.rs b/src/peripherals/mod.rs index 078e6f9cb..6b3c21601 100644 --- a/src/peripherals/mod.rs +++ b/src/peripherals/mod.rs @@ -236,6 +236,7 @@ pub async fn create_peripheral_tools(_config: &PeripheralsConfig) -> Result Vec> { if !config.enabled || config.boards.is_empty() { return Vec::new(); @@ -248,6 +249,11 @@ pub fn create_board_info_tools(config: &PeripheralsConfig) -> Vec> ] } +#[cfg(not(feature = "hardware"))] +pub fn create_board_info_tools(_config: &PeripheralsConfig) -> Vec> { + Vec::new() +} + #[cfg(test)] mod tests { use super::*; diff --git a/src/providers/anthropic.rs b/src/providers/anthropic.rs index e8004d6ae..0a77e75c8 100644 --- a/src/providers/anthropic.rs +++ b/src/providers/anthropic.rs @@ -1239,6 +1239,7 @@ mod tests { }], temperature: 0.7, tools: None, + tool_choice: None, }; let json = serde_json::to_string(&req).unwrap();