-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Unify subrecipe and subagent execution through shared recipe pipeline #5082
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
29f72b4
26057d2
f20425a
f03fc85
b3f7293
42f1591
882bfcf
ff9bfb8
022cf2a
155bb3c
2aa0d34
76fa1aa
eea5c5f
d9e552b
47fcb80
1feb393
a531e4f
a731d4f
ba1991c
3589e67
c344549
f07b81e
525766f
53b697f
b1d1cad
15e16ae
bccd42d
dde49b5
fad7259
f298593
7b9581f
82d2c66
6eabf57
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,7 @@ use crate::agents::extension::ExtensionConfig; | |
| use crate::agents::subagent_execution_tool::tasks_manager::TasksManager; | ||
| use crate::agents::subagent_execution_tool::{ | ||
| lib::ExecutionMode, | ||
| task_types::{Task, TaskType}, | ||
| task_types::{Task, TaskPayload}, | ||
| }; | ||
| use crate::agents::tool_execution::ToolCallResult; | ||
| use crate::config::GooseMode; | ||
|
|
@@ -81,9 +81,6 @@ pub struct TaskParameter { | |
| #[serde(skip_serializing_if = "Option::is_none")] | ||
| pub retry: Option<JsonObject>, | ||
|
|
||
| #[serde(skip_serializing_if = "Option::is_none")] | ||
| pub context: Option<Vec<String>>, | ||
|
|
||
| #[serde(skip_serializing_if = "Option::is_none")] | ||
| pub activities: Option<Vec<String>>, | ||
|
|
||
|
|
@@ -116,7 +113,7 @@ pub fn create_dynamic_task_tool() -> Tool { | |
|
|
||
| Tool::new( | ||
| DYNAMIC_TASK_TOOL_NAME_PREFIX.to_string(), | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. above, can you remove the .expects()? it would crash the server if that broke
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This ends up opening a bit of a can of worms. This should get looked at when we move the tools to a platform extension |
||
| "Create tasks with instructions or prompt. For simple tasks, only include the instructions field. Extensions control: omit field = use all current extensions; empty array [] = no extensions; array with names = only those extensions. Specify extensions as shortnames (the prefixes for your tools). Specify return_last_only as true and have your subagent summarize its work in its last message to conserve your own context. Optional: title, description, extensions, settings, retry, response schema, context, activities. Arrays for multiple tasks.".to_string(), | ||
| "Create tasks with instructions or prompt. For simple tasks, only include the instructions field. Extensions control: omit field = use all current extensions; empty array [] = no extensions; array with names = only those extensions. Specify extensions as shortnames (the prefixes for your tools). Specify return_last_only as true and have your subagent summarize its work in its last message to conserve your own context. Optional: title, description, extensions, settings, retry, response schema, activities. Arrays for multiple tasks.".to_string(), | ||
| input_schema, | ||
| ).annotate(ToolAnnotations { | ||
| title: Some("Create Dynamic Tasks".to_string()), | ||
|
|
@@ -228,7 +225,6 @@ pub fn task_params_to_inline_recipe( | |
| builder = apply_if_ok(builder, task_param.get("settings"), RecipeBuilder::settings); | ||
| builder = apply_if_ok(builder, task_param.get("response"), RecipeBuilder::response); | ||
| builder = apply_if_ok(builder, task_param.get("retry"), RecipeBuilder::retry); | ||
| builder = apply_if_ok(builder, task_param.get("context"), RecipeBuilder::context); | ||
| builder = apply_if_ok( | ||
| builder, | ||
| task_param.get("activities"), | ||
|
|
@@ -297,17 +293,6 @@ pub async fn create_dynamic_task( | |
| // All tasks must use the new inline recipe path | ||
| match task_params_to_inline_recipe(task_param, &loaded_extensions) { | ||
| Ok(recipe) => { | ||
| let recipe_json = match serde_json::to_value(&recipe) { | ||
| Ok(json) => json, | ||
| Err(e) => { | ||
| return ToolCallResult::from(Err(ErrorData { | ||
| code: ErrorCode::INTERNAL_ERROR, | ||
| message: Cow::from(format!("Failed to serialize recipe: {}", e)), | ||
| data: None, | ||
| })); | ||
| } | ||
| }; | ||
|
|
||
| // Extract return_last_only flag if present | ||
| let return_last_only = task_param | ||
| .get("return_last_only") | ||
|
|
@@ -316,11 +301,12 @@ pub async fn create_dynamic_task( | |
|
|
||
| let task = Task { | ||
| id: uuid::Uuid::new_v4().to_string(), | ||
| task_type: TaskType::InlineRecipe, | ||
| payload: json!({ | ||
| "recipe": recipe_json, | ||
| "return_last_only": return_last_only | ||
| }), | ||
| payload: TaskPayload { | ||
| recipe, | ||
| return_last_only, | ||
| sequential_when_repeated: false, | ||
| parameter_values: None, | ||
| }, | ||
| }; | ||
| tasks.push(task); | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.