Skip to content

redesign: call_agent as context transfer / call_user as self-continuation removal #181

@emesal

Description

@emesal

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 prompt
  • call_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

  1. 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?
  2. does self-continuation (call_agent(context="self")) still make sense? or should it be removed entirely since the natural tool loop handles it?
  3. plumbing depthsend_prompt currently 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.
  4. should call_agent accept a prompt/message param too? e.g. call_agent(context="research", prompt="user wants X") — an initial prompt injected into the target context.

related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions