We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent faac835 commit acc5581Copy full SHA for acc5581
crates/goose/src/agents/agent.rs
@@ -394,6 +394,20 @@ impl Agent {
394
cancellation_token: Option<CancellationToken>,
395
session: &Session,
396
) -> (String, Result<ToolCallResult, ErrorData>) {
397
+ if session.session_type == crate::session::SessionType::SubAgent
398
+ && (tool_call.name == DYNAMIC_TASK_TOOL_NAME_PREFIX
399
+ || tool_call.name == SUBAGENT_EXECUTE_TASK_TOOL_NAME)
400
+ {
401
+ return (
402
+ request_id,
403
+ Err(ErrorData::new(
404
+ ErrorCode::INVALID_REQUEST,
405
+ "Subagents cannot create other subagents".to_string(),
406
+ None,
407
+ )),
408
+ );
409
+ }
410
+
411
if tool_call.name == PLATFORM_MANAGE_SCHEDULE_TOOL_NAME {
412
let arguments = tool_call
413
.arguments
0 commit comments