Skip to content

feat(eve): plan subagents as background tasks - #1482

Open
ruiconti wants to merge 4 commits into
mainfrom
rui/subagents-as-tasks
Open

feat(eve): plan subagents as background tasks#1482
ruiconti wants to merge 4 commits into
mainfrom
rui/subagents-as-tasks

Conversation

@ruiconti

@ruiconti ruiconti commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

This is the contract for running subagents as durable background tasks after the agent-messaging stack lands. It changes no runtime behavior.

Today a subagent call leaves the model step as a private runtimeAction. eve starts the child, then keeps the parent turn open until every child in the batch finishes. Local children can forward input and authorization through that active turn; remote children can only report completion or failure.

That boundary works for synchronous delegation. It does not work for background work: the parent cannot move on while the child runs, progress has no shared local/remote path, and non-terminal communication depends on the original turn still being alive.

Proposed flow

With experimental.tasks, each subagent call creates a durable task. The original tool call receives one task receipt, closing that call. Progress, input requests, authorization, completion, failure, and cancellation then move over the task boundary without keeping the parent turn open.

parent model
    |
    v
parent harness ---- creates/indexes ----> task run
    |                                      | owns lifecycle state
    +---- resolves ---------------------> agent handle
    |                                      | owns child address
    +---- dispatches --------------------> child executor
                                           |
                                           +---- updates task run

parent returns to task through task_peek / task_await / notifications

The ownership split is the main design decision. The task run is the single writer for lifecycle transitions. The parent session stores only the taskId -> taskRunId index. Agent handles remain the source of child identity and routing. Credentials stay in private bindings and never enter model context or history.

The dedicated task run comes from the failure exposed by #1190: callback routes and child executors need to update task state, but neither owns the current threaded session snapshot. A separate durable run gives those writers a stable boundary and serializes competing updates.

Delivery shape

The rollout is additive. Flag plumbing, task storage, gated controls, and delegated execution land inert first. A later stage moves the six child flows onto the task wire and lets the flag select the new mode. Local/remote normalization and flag removal come last.

This plan assumes the agent-messaging stack #1328-#1331 as its addressing layer. Tasks compose with agent handles; they do not introduce another child-session identity or credential store.

The first implementation is subagents only. Authored tools, built-ins, connections, skills, dynamic workflows, and the public defineTool API stay unchanged. MCP Tasks provides lifecycle vocabulary and control semantics, not an MCP endpoint.

Review focus

  • Sequencing: the design and delivery plan currently disagree on whether agent messaging is already the baseline. They should both describe tasks as phase 2.
  • Creation: define the task shape before child acknowledgement, including local metadata and dispatch-start failure.
  • Wake policy: decide when terminal and input_required updates wake a parked parent instead of waiting for an explicit task control.
  • Busy semantics: decide whether task_send queues behind a running child or returns AGENT_BUSY.
  • Trust and retention: narrow which fields an executor may update, then define how long terminal tasks remain addressable.

Part of #1084.

Signed-off-by: Rui Conti <ruiconti@gmail.com>
@vercel

vercel Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
eve-docs Ready Ready Preview Jul 31, 2026 9:32pm
eve-docs-4759 Ready Ready Preview, v0 Jul 31, 2026 9:32pm

Close the gaps against the Tools as Tasks proposal's Phase 1:

- add the child task tools namespace (task_message) so a child can
  intentionally report progress; today no child-facing surface exists
- specify delegated execution as an inert runtime execution mode, not a
  defineTool change, resolving the tension with the authoring non-goal
- map the five transport-split flows onto the single task wire and add
  progress as the sixth flow
- resequence Delivery to mirror the proposal, including the final
  migration step that makes tasks the default and retires the flag

Signed-off-by: Rui Conti <ruiconti@gmail.com>
ruiconti added 2 commits July 31, 2026 21:30
Add an implementation-sequencing plan for the subagents-as-tasks design
(#1482): strictly additive stages behind experimental.tasks, with the
agent-messaging stack (am/01-04) as the addressing baseline instead of
a second session-addressing mechanism.

Signed-off-by: Rui Conti <ruiconti@gmail.com>
The design doc now ships in the same PR, so the cross-reference points at the sibling file instead of the PR that carried it.
Comment on lines +47 to +51
`task_send` follow-ups to a finished child require conversation-mode children and parked
handles, which `experimental.subagentPersistentSessions` gates today. `experimental.tasks`
therefore implies persistent-session children for subagent dispatch. Whether it sets the other
flag or simply selects the same behavior internally is a stage-4 decision; the two flags must
not produce a third hybrid mode.

@ruiconti ruiconti Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's defer tool async communication to after a2a communication stack lands i.e., phase 2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant