pub struct TaskRunParams {
pub session_id: String,
pub task: String,
pub agent_name: String,
pub binding: ProjectBinding,
pub agents_dir: PathBuf,
pub model_override: Option<String>,
pub mode: HarnessMode,
pub deadline_secs: Option<u64>,
pub telemetry_data_dir: Option<PathBuf>,
}Expand description
Inputs to start one background task execution.
Why: bundles everything spawn_task_run needs so task::protocol’s
handler stays a thin params-parsing shim.
What: session_id must already exist in the registry (created by the
caller — see task::protocol::task_run); agent_name is the top-level
(PM) agent, task is the free-form request text, agents_dir mirrors
run_task::RunTaskParams, and model_override pins the
DELEGATED ENGINEER’s model for this run only (mirrors run_task‘s
--engineer-model). mode (#2059) is the ALREADY-RESOLVED HarnessMode
(task::protocol::task_run resolves it via crate::mode::resolve_mode
before constructing this — resolution is a request-parsing concern, not
an execution one). binding replaces what was a required project: PathBuf; see [run_and_record]’s docs for what each of its three states
does to indexing, the memory palace, and the tools’ working root.
Fields§
§session_id: String§task: String§agent_name: String§binding: ProjectBindingThis run’s project binding — projectless, a non-git directory, or a git
repo. ProjectBinding::None is a fully supported state, not an error.
agents_dir: PathBuf§model_override: Option<String>§mode: HarnessMode§deadline_secs: Option<u64>Per-run wall-clock deadline override, in seconds (#2207). None
falls through to crate::provider::resolve_deadline_secs’s env-var
and default tiers — resolved once in run_and_record and applied to
BOTH the PM’s own loop and the delegated engineer’s loop.
telemetry_data_dir: Option<PathBuf>Test-only override for the PM loop’s AgentLoopConfig::telemetry_data_dir
(issue #3902). None on every production call site
(task::protocol::task_run) — falls through to
telemetry::default_data_dir() exactly as before this field existed.
A spawn_task_run test that runs enough turns to trip a real
cadence/threshold fire (this daemon path always sets cadence: Some(_) on the PM loop, see the cadence field’s docs below) MUST
set this — AgentLoop::telemetry_data_dir’s #[cfg(test)] guard
panics on the first un-injected fire rather than risk the #3902 race.
spawn_task_run immediately tokio::spawns the actual run, which
outlives the caller’s own stack frame, so the
telemetry::with_data_dir_env_fut pattern
compression_telemetry_tests.rs uses (hold a lock across one
.await) does not fit here — injecting through this field is the
only mechanism that reaches a detached background task correctly.
Trait Implementations§
Source§impl Clone for TaskRunParams
impl Clone for TaskRunParams
Source§fn clone(&self) -> TaskRunParams
fn clone(&self) -> TaskRunParams
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 Freeze for TaskRunParams
impl RefUnwindSafe for TaskRunParams
impl Send for TaskRunParams
impl Sync for TaskRunParams
impl Unpin for TaskRunParams
impl UnsafeUnpin for TaskRunParams
impl UnwindSafe for TaskRunParams
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
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