Gives agent the turns in fork as its history and makes parent its
owner, as parent$retain_agent() does; continue it with
parent$continue_agent(). agent must be a standalone Agent with an
empty chat of its own and no approval_dir or fallback chats. It keeps its
own tools, system prompt and permissions: the fork brings only the
conversation. See vignette("retained-agents").
Arguments
- parent
The
Agentthat will own the new conversation.- agent
A new
Agentwhose agent and session IDs differ fromparent's.- fork
A ContextFork.
A function that receives the fork as a plain list and checks that its source may be used. To allow it, return a list with exactly the fork's
owner_id,conversation_id,branch_idandrevision; returnNULLorFALSE, or throw an error, to deny it. It is called again before every continuation.- usage_limits
UsageLimits for all runs of the retained agent combined.
- max_runs
Maximum number of continuations. Defaults to 32.