pub struct RunSpec { /* private fields */ }Expand description
One task’s worth of spawn request: basis::RunSpec’s per-run intent,
plus the workspace-level overrides a basis::Workspace normally fixes
once, and the facts a task that may run unattended, in another process,
additionally needs recorded.
Implementations§
Source§impl RunSpec
impl RunSpec
pub fn new(prompt: impl Into<String>) -> Self
pub fn with_provider(self, provider: impl Into<String>) -> Self
pub fn with_base_url(self, base_url: impl Into<String>) -> Self
pub fn with_model(self, model: impl Into<String>) -> Self
Sourcepub fn without_shell(self) -> Self
pub fn without_shell(self) -> Self
Refuses the task shell access — sugar over the workspace’s own
ShellAccess::from_flag.
pub fn with_system_prompt(self, system_prompt: SystemPrompt) -> Self
pub fn with_effort(self, effort: Effort) -> Self
Sourcepub fn with_approve(self, approve: Approve) -> Self
pub fn with_approve(self, approve: Approve) -> Self
Every consequential call this task’s turns make is put to this.
Sourcepub fn with_deadline(self, deadline: Duration) -> Self
pub fn with_deadline(self, deadline: Duration) -> Self
Gives up on the task after deadline, counted from spawn. Defaults to
DEFAULT_DEADLINE when never set — an unattended task always gets a
finite service bound.
Sourcepub fn with_not_after_ms(self, not_after_ms: u64) -> Self
pub fn with_not_after_ms(self, not_after_ms: u64) -> Self
Never gives the task longer than the instant not_after_ms
(milliseconds since the epoch), whatever with_deadline
adds up to.
For a deadline that is someone else’s: a caller over A2A says when it stops waiting, as an instant, and re-anchoring that as a duration at spawn would hand the task a little more than the caller has.
pub fn with_tool_budget(self, tool_budget: usize) -> Self
pub fn with_token_budget(self, token_budget: u64) -> Self
Sourcepub fn detached(self) -> Self
pub fn detached(self) -> Self
Spawns outside the calling task’s ownership tree even when this
process is itself executing one — see crate::current_task. A
detached task inherits no scope: nothing cancels it downward, and
nothing waits for it before its would-be parent settles.
Sourcepub fn with_hop(self, hop: u32) -> Self
pub fn with_hop(self, hop: u32) -> Self
How many agent-to-agent hops away from a top-level caller this task’s
work arrived — 0 (the default) for work nobody handed over a wire.
A host serving tasks to other agents records the hop a request came
in at, so the task’s own delegations can say how far along they are
(ADR-0030 §9). Recorded at spawn, published to the task’s commands as
BASIS_HOP, and inherited by its children, which
are the same work one level down in-process, not a hop further.
Sourcepub fn continuing(self, continuation: Continuation) -> Self
pub fn continuing(self, continuation: Continuation) -> Self
Picks up an existing conversation instead of opening a new one.