Unify Agent Execution: per‑session agents, unified tasks/recipes/scheduler #4389
tlongwell-block
started this conversation in
General
Replies: 4 comments
-
|
Thank you for sharing this! Love seeing the work into making goose session-aware already. Curious to see what others think! Treating everything as a recipe could work really well! |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Working in #4684 |
Beta Was this translation helpful? Give feedback.
0 replies
-
Beta Was this translation helpful? Give feedback.
0 replies
-
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Today we have several parallel ways to run “the same thing” (an agent doing work):
run_scheduled_job_internalincrates/goose/src/scheduler.rs).subagent_handler.rs), often via thedynamic_task__create_tasktool.goose run --recipe …)This creates duplicated code paths, inconsistent behavior, and hard‑to‑debug concurrency issues:
We want one clear model that scales: agent per session, multiple simultaneous sessions, ad‑hoc dynamic tasks, and a single execution pipeline used by chat, scheduler, and recipes.
Goals
What this looks like (examples)
{ "tool": "dynamic_task__create_task", "arguments": { "task_parameters": [ { "instructions": "Write a quick unit test for foo()", "extensions": ["developer"] }, { "instructions": "Consider the implications of this new feature: ...", "extensions": [] } ], "execution_mode": "parallel" } }execution_mode=background, and records a normal session file withschedule_idin metadata. The session can be inspected with the same APIs/UI as chat.Proposed implementation
Introduce a unified execution layer in the goose crate and route all surfaces through it.
inline_recipe(seedynamic_task_tools.rs).Backgroundmode, generating a normal session.goose-serverwith AgentManager.dynamic_task__create_taskcontinues to exist.inline_recipetasks executed by the same unified executor in the parent session, optionally as SubTask mode with scoped extensions.Agent::new()in the scheduler with calls into AgentManager.schedule_idin session metadata (this already exists today).Benefits
Acceptance criteria
Open questions
Notes from the current codebase
crates/goose-server/src/state.rskeeps a singleAgentReffor all requests.crates/goose/src/scheduler.rs(run_scheduled_job_internal).inline_recipeand convert arguments to a Recipe:crates/goose/src/agents/recipe_tools/dynamic_task_tools.rsand.../subagent_execution_tool/tasks.rs.goose run --recipe …in some paths:crates/goose/src/agents/subagent_execution_tool/tasks.rs.By centralizing agent lifecycle per session and pushing all execution through the same path, we get predictability, easier debugging, and a strong base for future features (e.g., quotas, pre‑warmed agents, richer scheduling, better metrics).
Work on session-aware Agents has begun in #4216
Work has already begun on
inline_recipesin #4311Beta Was this translation helpful? Give feedback.
All reactions