pub struct TaskLaunchInput {Show 13 fields
pub blueprint: Blueprint,
pub operator_id: String,
pub role: Role,
pub ttl: Duration,
pub operator_kind: Option<OperatorKind>,
pub bridge_id: Option<String>,
pub hook_id: Option<String>,
pub operator_sid: Option<String>,
pub operator_kind_overrides: HashMap<String, OperatorKind>,
pub init_ctx: Value,
pub task_input: Option<TaskInputSpec>,
pub run_ctx: Option<RunContext>,
pub check_policy: Option<CheckPolicy>,
}Expand description
Input to TaskLaunchService::launch.
Fields§
§blueprint: BlueprintThe Blueprint to compile, link, and run.
operator_id: StringCaller-supplied id for the Operator that owns this run.
role: RoleThe Operator’s role for this run.
ttl: DurationHow long the attached session is allowed to live.
operator_kind: Option<OperatorKind>“Runtime Global” tier of the OperatorKind cascade. Some(_) is
always an explicit request — including Some(OperatorKind::Automate)
— that outranks the BP-level tiers (OperatorDef.kind /
Blueprint.default_operator_kind); None leaves it unspecified so
those tiers / the final default decide. Under MainAi or
Composite, MainAIMiddleware’s spawn_hook before/after
callbacks become effective. See
crate::core::ctx::collapse_operator_kind.
bridge_id: Option<String>SeniorBridge registry ID. None — no bridge; Some(id) —
attach a bridge previously registered via
engine.register_senior_bridge.
hook_id: Option<String>SpawnHook registry ID. Same shape as above, via
engine.register_spawn_hook.
operator_sid: Option<String>The one Operator this launch names — a session id (S-<hex>), or
any other key an embedder registered with engine.register_operator.
§One input, both axes
This used to be two fields, operator_backend_id and
operator_pin, and every caller set them from the same value:
- Delegate axis. Gone. The value was stored on
LaunchEnvelope.operator_backend_idand resolved byOperatorDelegateMiddleware, which bypassedinner.spawnwhen the Blueprint opted into theoperator_delegatelayer. That layer was removed (it read a launch-time destination and so could not follow a seat handover, and it carried nosystem_prompt); the envelope field outlives it only as the persisted session shape and the launch-time “is this a live session” guard key. - AgentSpec axis. The binding provider attests this launch’s
manifests through that session
(
crate::binding::AgentBindingProvider::pinned_to_session), and the host records the same id as the Run’s firstAssign(RunStore::acquire_assignee) — which is what a dispatch resolves its destination from, freshly each time, so a later handover moves the destination without recompiling anything.
Keeping them apart let a launch say two different things about who
it belonged to, and nothing above ever wanted to: POST /v1/tasks
wrote the same sid into both, and POST /v1/tasks/:id/runs had only
one value to write. Two axes still read it — that is a fact about
how a launch reaches an operator, not a reason for the launch to
carry the answer twice.
The compile deliberately does not see this value: baking the
pinned session into routes[agent_name] is exactly the frozen
destination the per-dispatch lookup replaced.
None (the default via Self::automate) names no operator: the
binding provider has nothing to attest through (it reports
Unbound). A value that is not a live session id reaches the same
outcome — with the delegate axis gone, a backend id that names no
live session no longer has a second path it can still resolve on.
operator_kind_overrides: HashMap<String, OperatorKind>“Runtime Agent-level” tier (highest priority) of the OperatorKind
cascade — per-agent override, keyed by AgentDef.name. Empty by
default (no override for any agent). See
crate::core::ctx::collapse_operator_kind for the full tier list.
init_ctx: ValueThe initial ctx (JSON Value) that flow.ir’s eval_async
starts from. Every Step.in $.<path> reference reads from
here. Issue #19 ST2: a pure flow-ir eval seed — no Task-level
field is folded into it anymore; see Self::task_input.
task_input: Option<TaskInputSpec>Task-level canonical fields (issue #19 ST2). Some layers a
crate::middleware::task_input::TaskInputMiddleware (built via
crate::middleware::task_input::TaskInputMiddleware::new_from_fields)
onto the spawner stack just before spawn; None is a no-op,
identical to today’s behavior for callers with no Task-level
fields to propagate.
run_ctx: Option<RunContext>Issue #13 run_id propagation: when Some, every step this launch
dispatches is traced into RunRecord.step_entries and exposes its
run_id via Ctx.meta.runtime["run_id"] (see
EngineDispatcher::with_run). None (the default via
Self::automate) preserves the pre-existing behavior — no run
tracing.
check_policy: Option<CheckPolicy>The “launch request” tier (tier 1, highest
priority) of the check_policy cascade
(launch request > blueprint > server config).
TaskLaunchService::launch
collapses check_policy.or(blueprint.check_policy) exactly once and
threads the result into every spawned step’s TaskSpec.check_policy.
None (the default via Self::automate) leaves this tier
unspecified so the Blueprint tier / server-wide default decide —
backward-compat with every pre-cascade caller.
TaskLaunchService::launch also collapses this same cascade one
step further
(adding the server-wide EngineCfg.check_policy tier) into a
pre-dispatch guard: when the resulting effective policy is
CheckPolicy::Strict and neither Self::task_input’s
project_root nor work_dir is set, the launch is rejected with
TaskLaunchError::PreDispatch before any step is dispatched — a
strict task with no resolvable root would deterministically fail
at its first submit-time file materialize anyway. Setting this
field to Some(CheckPolicy::Warn) on the launch-request tier is
the escape hatch: it outranks a Blueprint- or server-declared
Strict and lets the guard pass.
Implementations§
Source§impl TaskLaunchInput
impl TaskLaunchInput
Sourcepub fn automate(
blueprint: Blueprint,
operator_id: impl Into<String>,
role: Role,
ttl: Duration,
init_ctx: Value,
) -> Self
pub fn automate( blueprint: Blueprint, operator_id: impl Into<String>, role: Role, ttl: Duration, init_ctx: Value, ) -> Self
Helper for existing callers on the default path — no hooks and no
per-agent OperatorKind overrides. Leaves the “Runtime Global” tier
unspecified (None), so the BP-level tiers / final default
(OperatorKind::Automate) decide — this preserves today’s
behaviour for every existing caller without silently forcing
Automate as an explicit override that would outrank a BP-declared
MainAi/Composite kind. run_ctx and task_input both default
to None (no run tracing, no Task-level fields); construct the
struct literal directly to set either.
Trait Implementations§
Source§impl Clone for TaskLaunchInput
impl Clone for TaskLaunchInput
Source§fn clone(&self) -> TaskLaunchInput
fn clone(&self) -> TaskLaunchInput
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for TaskLaunchInput
impl !UnwindSafe for TaskLaunchInput
impl Freeze for TaskLaunchInput
impl Send for TaskLaunchInput
impl Sync for TaskLaunchInput
impl Unpin for TaskLaunchInput
impl UnsafeUnpin for TaskLaunchInput
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more