MCPcopy Index your code
hub / github.com/AI45Lab/Code / session_for_worker

Method session_for_worker

core/src/agent_api.rs:412–420  ·  view source on GitHub ↗

Create a session from a reproducible disposable worker recipe. This is the cattle-mode companion to [`Agent::session_for_agent`]: callers provide a small [`WorkerAgentSpec`](crate::subagent::WorkerAgentSpec), and A3S Code compiles it into the same runtime definition used by delegated agents.

(
        &self,
        workspace: impl Into<String>,
        spec: crate::subagent::WorkerAgentSpec,
        extra: Option<SessionOptions>,
    )

Source from the content-addressed store, hash-verified

410 /// provide a small [`WorkerAgentSpec`](crate::subagent::WorkerAgentSpec), and
411 /// A3S Code compiles it into the same runtime definition used by delegated agents.
412 pub fn session_for_worker(
413 &self,
414 workspace: impl Into<String>,
415 spec: crate::subagent::WorkerAgentSpec,
416 extra: Option<SessionOptions>,
417 ) -> Result<AgentSession> {
418 let def = spec.into_agent_definition();
419 self.session_for_agent(workspace, &def, extra)
420 }
421
422 /// Resume a previously saved session by ID.
423 ///

Calls 2

into_agent_definitionMethod · 0.80
session_for_agentMethod · 0.45