Conversation
Let main agents reuse a child's accumulated context through spawn_agent's optional chat_id instead of recreating the conversation for every task. Preserve the original model settings and enforce same-parent ownership, session-local authorization, and non-overlapping invocations. Allow cancelled and provider-failed runs to continue after their work has settled, and wait for dispatched tools and cleanup hooks before reuse. Cover retained history, validation, retry, and cancellation races with regression tests and document the continuation interface. 🤖 Generated with [ECA](https://eca.dev) (openai/gpt-6-astra - xhigh) Co-Authored-By: eca-agent <git@eca.dev>
itkonen
marked this pull request as ready for review
September 20, 2026 12:39
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR allows main agents to reuse subagents and their accumulated context to speed up orchestration. Similar features exist in harnesses such as OpenCode, Codex, and Claude Code. Here, this is implemented by allowing the
spawn_agenttool to accept thechat_idof an earlier subagent. When achat_idis provided, the subagent continues its conversation from where it left off.This supports several communication patterns. For example, a subagent can request more details from the main agent and return. The main agent can then answer through the
taskargument, usingchat_idto continue that same subagent conversation.AI summary
Implementation
chat_idtospawn_agent. Calls without it continue to create fresh subagents.agentandtaskremain required.Ownership and lifecycle safeguards
Continuation is limited to the same parent chat and server session. Invalid, foreign, or unauthorized IDs are rejected without silently creating a fresh child. Changes to configuration, workspace, or trust also require a fresh subagent. History replay checks child ownership before expanding referenced conversations.
Session-local bookkeeping prevents overlapping invocations and waits for prompt workers and tool cleanup to finish. Cancelled or provider-failed runs can be continued once their previous work has settled; active tools or unfinished cleanup still block continuation.
The patch also makes targeted corrections to existing cancellation handling:
There is no new messaging protocol, scheduler, or dedicated parent-question tool. Fork-aware continuation and persistence across server restarts are outside scope.
Validation
Regression coverage includes retained conversation and tool history, fresh-child behavior, invalid and unauthorized IDs, parameter ordering, model preservation, step-limit continuation, truncated results, transient provider failures, cancellation races, and rejection while old work remains active.
🤖 Generated with ECA (openai/gpt-6-astra - xhigh)