A delegation that returns, then a move that stays
Four lifelines: you running docker-agent run with exec, root, writer, and reviewer from team.yaml. Message 1 asks root for one sentence from the writer. Root calls transfer_task with agent writer, a task and an expected output, the writer runs in its own sub-session that holds only the task, and its sentence, MicroVMs are lightweight virtual machines, returns to root as the tool response. Root then calls the session-moving tool with agent reviewer, and reviewer answers APPROVED with the sentence. Message 2 goes straight to reviewer, which answers the same way, and root is not asked again.
you, --exec
root
writer
reviewer
1
Ask the writer for one sentence
message 1
2
transfer_task
agent: writer, task, expected_output
sub-session
task only
3
MicroVMs are lightweight
the sentence returns to root
4
{"agent": "reviewer"}
the session moves to reviewer
5
APPROVED: MicroVMs are lightweight
answered by reviewer
6
Now hand the conversation to the reviewer.
message 2
7
APPROVED: MicroVMs are lightweight
root is not asked again