feat: exclude subagent tool from code_execution filtering (#6531)

Signed-off-by: rabi <ramishra@redhat.com>
This commit is contained in:
Rabi Mishra
2026-01-21 02:38:21 +05:30
committed by GitHub
parent 60891d379f
commit a05f5a3103
+4 -1
View File
@@ -17,6 +17,7 @@ use crate::providers::toolshim::{
};
use crate::agents::code_execution_extension::EXTENSION_NAME as CODE_EXECUTION_EXTENSION;
use crate::agents::subagent_tool::SUBAGENT_TOOL_NAME;
#[cfg(test)]
use crate::session::SessionType;
use rmcp::model::Tool;
@@ -128,7 +129,9 @@ impl Agent {
.await;
if code_execution_active {
let code_exec_prefix = format!("{CODE_EXECUTION_EXTENSION}__");
tools.retain(|tool| tool.name.starts_with(&code_exec_prefix));
tools.retain(|tool| {
tool.name.starts_with(&code_exec_prefix) || tool.name == SUBAGENT_TOOL_NAME
});
}
// Stable tool ordering is important for multi session prompt caching.