Repository navigation
Replies: 1 comment
|
On a long research thread, the parent should hand the researcher a short task for the three shortlisted vendors, not the whole transcript of search results and document extracts. For that private temporary note, the parent can create the bridge itself at https://meld.mergeinc.workers.dev. Say what it is for and what it is not for, and send the URL privately. It stays open 36 hours until the first reply. Each later reply resets 24 hours. The conversation stays on that same link. It is free, and there is no billing. It is not the subagent runtime, and it will not trim the parent transcript for you. |
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.
Use case
A research assistant with long threads. Over 30+ turns the user pulls in documents, runs searches and narrows a list of vendors. Many of those turns carry large tool results (search results, document extracts).
Then the user asks for something that suits a focused child agent, e.g. "compare pricing for the three vendors we shortlisted". We want the parent to delegate to a
researchersubagent with a short, self-contained brief it writes itself:This is how Claude Code's Task tool and the OpenAI Agents SDK's
Agent.as_tool()work: the parent writes the child's input.How
defineAgentfalls short (0.61.0)inputSchema(spawn.ts#L720-L725), so the model sees a tool with no parameters.executeignores its input anyway (execute: async (_input, context)).ctx.messagesis the parent conversation up to the tool call (messagesBeforeCall, spawn.ts#L662). In our example that's 30+ turns and every earlier tool result. The child has to work out which request is its job.order: 'sequence'each child also gets the text of the children before it.Workarounds we looked at
ctx.messagesinsiderun(trim, or summarise with a cheap model). The child still has to guess its task, and the summary can drop the one detail it needs. It also breaks resume: on a resumectx.messagesis[...parent, ...child's own messages](spawn.ts#L243), so trimming can cut the child's own tool-call history.messagesBeforeCallkeeps the text of the message that carries the call, soruncould treat it as the brief. That only works if the model writes the text every time, and the user sees it streamed.defineAgentand use a plain server tool with ataskinput that runs a childchat(). This gives us the brief but loses what feat: add AG-UI subagents to chat() and useChat #1438 added: subagent cards, live child streaming, child interrupt resume and usage roll-up. Discussion Support AG-UI projection for Agent-as-Tool / nested agent runs #1335 describes the same trade-off.Proposal
An optional
inputSchemaondefineAgent. When set, the generated tool exposes it, andexecutepasses the validated input torunasctx.input:inputSchemabehave as they do now.ctx.messagesstays, soruncan still add context from the parent if it wants.Open question: router mode has no tool call, so
ctx.inputwould beundefinedthere unless the router can return input with its pick (e.g.{ names, input }).All reactions