fix: when auto_continue is disabled via the .set auto_continue false command, it should strip the todo functions from the list of functions

This commit is contained in:
2026-06-10 19:31:19 -06:00
parent 218750cc1e
commit 1931331163
2 changed files with 12 additions and 3 deletions
+7 -3
View File
@@ -2041,11 +2041,15 @@ impl RequestContext {
} else {
self.update_app_config(|app| app.auto_continue = value);
}
if value
let should_register = self.agent.is_none()
&& self.app.config.function_calling_support
&& !self.tool_scope.functions.contains("todo__init")
{
&& self.auto_continue_config().enabled;
let already_registered = self.tool_scope.functions.contains("todo__init");
if should_register && !already_registered {
self.tool_scope.functions.append_todo_functions();
} else if !should_register && already_registered {
self.tool_scope.functions.remove_todo_functions();
}
}
"max_auto_continues" => {
+5
View File
@@ -357,6 +357,11 @@ impl Functions {
self.declarations.extend(todo::todo_function_declarations());
}
pub fn remove_todo_functions(&mut self) {
self.declarations
.retain(|f| !f.name.starts_with(TODO_FUNCTION_PREFIX));
}
pub fn append_memory_functions(&mut self) {
self.declarations
.extend(memory::memory_function_declarations());