-
Notifications
You must be signed in to change notification settings - Fork 1
Description
background
from investigation of #179 — the current call_agent / call_user semantics were reviewed against established conventions (OpenAI Swarm, OpenAI Agents SDK, Google ADK, LangGraph).
current behaviour
call_agent(prompt)— re-engage self for another turn with a continuation promptcall_user(message)— signal intent to end turn (but model gets one more API call after)
problem
call_agent as self-continuation is essentially meaningless — the model already gets another turn whenever it makes tool calls. the continuation prompt is the only value-add, and it's marginal.
proposed redesign
call_agent(context) becomes a true context transfer:
the model says "you should be talking to my colleague" and the conversation transfers to the specified context, which from that point on interacts with the actual user. like running chibi -c <context> mid-conversation. this matches the OpenAI Swarm transfer_to_<agent> convention.
tool landscape after redesign:
| tool | semantics |
|---|---|
call_user(message) |
end turn, deliver message to user (being fixed in #179) |
call_agent(context) |
transfer conversation to another context — user talks to them now |
spawn_agent(...) |
ephemeral sub-agent, result comes back to caller |
send_message(to, content) |
async inbox drop |
four distinct operations, no overlap.
open design questions
- what happens to the originating context? one-way transfer, or can control return? does the source context get notified when the target eventually calls
call_user? - does self-continuation (
call_agent(context="self")) still make sense? or should it be removed entirely since the natural tool loop handles it? - plumbing depth —
send_promptcurrently assumes it stays in one context. a mid-turn context switch means the caller (CLI/JSON binary) needs to know the active context changed. this may require a new return variant from the agentic loop. - should
call_agentaccept a prompt/message param too? e.g.call_agent(context="research", prompt="user wants X")— an initial prompt injected into the target context.
related
- review: agentic loop + call_user/call_agent semantics and naming #179 —
call_userimmediate-end-turn fix (in progress) - spawned from the same investigation