Changes the active agent for a given client session in a swarm.
This function facilitates switching the active agent in a swarm session, validating the session and agent dependencies,
logging the operation if enabled, and executing the change using a TTL-limited, queued runner.
The execution is wrapped in beginContext to ensure it runs outside of existing method and execution contexts.
Parameters
agentName: string
The name of the agent to switch to.
clientId: string
The unique identifier of the client session.
Returns Promise<boolean>
A promise that resolves when the agent change is complete. If it resolved false, the navigation is canceled due to recursion
Throws
If session or agent validation fails, or if the agent change process encounters an error.
Changes the active agent for a given client session in a swarm.
This function facilitates switching the active agent in a swarm session, validating the session and agent dependencies, logging the operation if enabled, and executing the change using a TTL-limited, queued runner. The execution is wrapped in
beginContext
to ensure it runs outside of existing method and execution contexts.