Commits the output of a tool execution to the active agent in a swarm session.
This function ensures that the tool output is committed only if the specified agent is still the active agent in the swarm session.
It performs validation checks on the agent, session, and swarm, logs the operation if enabled, and delegates the commit operation to the session public service.
The execution is wrapped in beginContext to ensure it runs outside of existing method and execution contexts, providing a clean execution environment.
Parameters
toolId: string
The unique identifier of the tool call.
content: string
The content to be processed or stored.
clientId: string
The unique identifier of the client session.
agentName: string
The name of the agent to use or reference.
Returns Promise<void>
Throws
If validation fails (e.g., invalid agent, session, or swarm) or if the session public service encounters an error during the commit operation.
Commits the output of a tool execution to the active agent in a swarm session.
This function ensures that the tool output is committed only if the specified agent is still the active agent in the swarm session. It performs validation checks on the agent, session, and swarm, logs the operation if enabled, and delegates the commit operation to the session public service. The execution is wrapped in
beginContext
to ensure it runs outside of existing method and execution contexts, providing a clean execution environment.