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>,
)
| 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 | /// |