Part 3 of 11 · 2 min read
What a sub-agent returns decides what the parent ever knows
The parent cannot see a sub-agent's work -- only whatever the result strategy hands back.
Think of a courier who delivers a sealed envelope: however much the sender wrote, the recipient only ever has what fit inside the envelope that actually arrived.
In plain words: a result strategy is the rule for what part of a sub-agent's run becomes its tool result -- its final message, its last few messages, everything it said, or a custom extractor -- and this handoff is the only channel between parent and child, so anything the strategy leaves out is lost to the parent even though the sub-agent "knew" it.
A worked example. Two of the four scripted sub-agents end their run with a bare "Done!" as their final message. Taking the last message as the result strategy therefore returns only 2 of 4 findings to the parent -- the two sub-agents that happened to put their answer in the last line, and nothing from the other two, even though every sub-agent actually found its number by step 6.
The key lines. From code/mini-subagents/agents.py:
# from code/mini-subagents/agents.py
def handoff(sub: W.SubTask, strategy: str) -> str:
if strategy == "sub_last_message":
return sub.final
if strategy == "sub_last3":
return "\n".join(m.text for m in (sub.messages + [W.Msg("assistant", sub.final)])[-3:])
if strategy == "sub_all":
return "\n".join(m.text for m in sub.messages) + "\n" + sub.final
Read it as: sub_last_message returns exactly one string, sub.final, and nothing else the sub-agent ever said. Whatever finding, caveat, or warning appeared earlier in the run simply never reaches this return value. That holds however important it was.
Agents as tools, result strategy, handoff
Agents as tools means a sub-agent is wrapped as a tool: the parent calls it with a task string and gets a string back. A result strategy is the rule for what part of the sub-agent's run becomes that returned string. A handoff is the information actually passed between agents in either direction; anything not handed off is lost to the receiver.
Example: the "last message" strategy and the "everything" strategy are two different handoffs over the identical sub-agent run -- the run never changes, only what crosses the boundary does.