fix: Do not inject tools when models don't support them; detect this conflict before API calls happen

This commit is contained in:
2026-03-17 09:35:51 -06:00
parent f41c85b703
commit d43c4232a2
3 changed files with 20 additions and 5 deletions
+6
View File
@@ -1842,6 +1842,12 @@ impl Config {
bail!("Already in an agent, please run '.exit agent' first to exit the current agent.");
}
let agent = Agent::init(config, agent_name, abort_signal.clone()).await?;
if !agent.model().supports_function_calling() {
eprintln!(
"Warning: The model '{}' does not support function calling. Agent tools (including todo, spawning, and user interaction) will not be available.",
agent.model().id()
);
}
let session = session_name.map(|v| v.to_string()).or_else(|| {
if config.read().macro_flag {
None