Skip to main content

call_agent

Function call_agent 

Source
pub async fn call_agent(
    name: &str,
    adapter: AgentAdapterConfig,
    cwd: &Path,
    arguments: Value,
    timeout: Duration,
    delegation: DelegationContext,
    interrupted: impl Future<Output = ()>,
) -> Result<Value, String>
Expand description

Make one agent call to name from cwd, as a session’s agent tool makes it, for scv agents check. The call runs in the foreground and may take timeout; when interrupted completes first, it is cancelled. The agent’s model list decides, not a saved one. The run is recorded under delegation, like a session’s, and this returns only once the agent’s process group is gone. The result is the tool’s JSON result, or SCV’s own error when the call was refused or nothing could run.