You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Opt-in parent conversation context for delegate_task children
#16189
Let an agent ask delegate_task to seed the child with a budgeted, attributed summary of the parent conversation, using the existing portable context handoff, while keeping today's prompt-only behavior as the default.
Problem to solve
A delegated child receives only the task prompt; the tool description says it runs "with only the supplied task prompt, without copying parent conversation history". That isolation is a good default, but many delegations depend on a long preceding discussion: decisions the user made, constraints they stated, findings from earlier turns, and rejected approaches. Today the parent must restate all of that in a self-contained brief. That costs tokens, depends on the parent's paraphrase, and drifts from what the user actually said, which matters most for cross-provider review where the reviewer should see the original requirements. t3_thread_fork does carry history into a new thread through native or portable context, but a fork has no task identity, task_status, or automatic completion delivery to the parent.
Proposed behavior
delegate_task accepts an optional context choice. The default keeps today's behavior exactly: the child sees only the task prompt. When the agent opts in, the child's first turn also receives a portable handoff of the parent conversation up to the delegating turn, built and budgeted by the same mechanism used for forks and provider switches, attributed and kept separate from the task prompt. The task lifecycle (taskId, task_status, task_cancel, automatic completion delivery) is unchanged.
Acceptance criteria
A delegate_task call without the new option produces a child whose input contains only the task prompt, as asserted by the existing prompt-isolation integration test.
With the option set, the child receives the task prompt plus a portable summary of the parent conversation that contains a distinctive statement the user made earlier in the parent thread.
The handoff respects the existing handoff budget (T3CODE_CONTEXT_HANDOFF_TOKEN_CAP), and the child can retrieve omitted history through the same retrieval references a portable fork provides.
The transfer appears in t3_thread_transfers for the child with its resolution.
The option works for same-provider and cross-provider targets.
Affected area
The delegate_task contract in packages/contracts/src/orchestratorMcp.ts and its description in apps/server/src/mcp/toolkits/orchestrator/tools.ts (L61), child creation in apps/server/src/orchestration-v2/Orchestrator.ts, and the existing portable handoff machinery (ContextHandoffBudget.ts, portable context transfers).
Non-goals
Changing the default isolation of delegated children.
Copying native provider state, reasoning, tool-call state, or attachments into the child.
Keep self-contained briefs only: works, but repeats the parent's paraphrasing cost and drift on every delegation.
Fork the parent and track the fork manually: carries history but loses the delegated-task lifecycle.
Supporting context
The handoff budget is defined at ContextHandoffBudget.ts:14. No existing request for parent-context seeding of delegated tasks was found; discussion #6689 has a related comment about subagents that share existing context.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Summary
Let an agent ask
delegate_taskto seed the child with a budgeted, attributed summary of the parent conversation, using the existing portable context handoff, while keeping today's prompt-only behavior as the default.Problem to solve
A delegated child receives only the task prompt; the tool description says it runs "with only the supplied task prompt, without copying parent conversation history". That isolation is a good default, but many delegations depend on a long preceding discussion: decisions the user made, constraints they stated, findings from earlier turns, and rejected approaches. Today the parent must restate all of that in a self-contained brief. That costs tokens, depends on the parent's paraphrase, and drifts from what the user actually said, which matters most for cross-provider review where the reviewer should see the original requirements.
t3_thread_forkdoes carry history into a new thread through native or portable context, but a fork has no task identity,task_status, or automatic completion delivery to the parent.Proposed behavior
delegate_taskaccepts an optional context choice. The default keeps today's behavior exactly: the child sees only the task prompt. When the agent opts in, the child's first turn also receives a portable handoff of the parent conversation up to the delegating turn, built and budgeted by the same mechanism used for forks and provider switches, attributed and kept separate from the task prompt. The task lifecycle (taskId,task_status,task_cancel, automatic completion delivery) is unchanged.Acceptance criteria
delegate_taskcall without the new option produces a child whose input contains only the task prompt, as asserted by the existing prompt-isolation integration test.T3CODE_CONTEXT_HANDOFF_TOKEN_CAP), and the child can retrieve omitted history through the same retrieval references a portable fork provides.t3_thread_transfersfor the child with its resolution.Affected area
The
delegate_taskcontract inpackages/contracts/src/orchestratorMcp.tsand its description inapps/server/src/mcp/toolkits/orchestrator/tools.ts(L61), child creation inapps/server/src/orchestration-v2/Orchestrator.ts, and the existing portable handoff machinery (ContextHandoffBudget.ts, portable context transfers).Non-goals
Alternatives considered
Supporting context
The handoff budget is defined at ContextHandoffBudget.ts:14. No existing request for parent-context seeding of delegated tasks was found; discussion #6689 has a related comment about subagents that share existing context.
All reactions