pub struct RunTaskParams {
pub agent: String,
pub task: String,
pub project: PathBuf,
pub agents_dir: PathBuf,
pub engineer_model: Option<String>,
pub pm_model: Option<String>,
pub max_turns: Option<u32>,
pub deadline_secs: Option<u64>,
pub permission_mode: PermissionMode,
pub no_delegate: bool,
}Expand description
Inputs to a single run-task invocation, parsed from the CLI.
Why: Bundling the inputs keeps execute_run_task’s signature stable as flags
are added and lets the binary layer construct one value from clap.
What: agent is the top-level (PM) agent name; task is the request; project
is the canonical project root; agents_dir is where <agent>.md live;
engineer_model is the optional per-run engineer model override (#1035).
Test: run_task::tests build these directly.
Fields§
§agent: StringTop-level agent name (typically "pm").
task: StringFree-form task description.
project: PathBufCanonical project root.
agents_dir: PathBufDirectory holding <agent>.md configs.
engineer_model: Option<String>Optional per-run engineer model override (#1035). None routes the
engineer via its own config model.
pm_model: Option<String>(#8030) Optional per-run override for the TOP-LEVEL agent’s own model.
Why: --engineer-model only rewired the delegated runner, so the
top-level agent’s calls could be repointed only by hand-editing the
deployed <agent>.md. This is the CLI/API-reachable half #8030 names.
What: already through crate::provider::resolve_pm_model_override’s
flag-then-env tiers by the time it reaches here; None leaves
crate::provider::resolve_model’s own ladder (front matter, then
DEFAULT_MODEL) untouched. A short alias (opus/sonnet/haiku) is
normalised at the point of use, same as engineer_model.
Test: run_task::tests::pm_model_override_pins_the_pm_loops_model,
run_task::tests::absent_pm_model_override_uses_the_agent_config_model.
max_turns: Option<u32>(#8128) Optional per-run override for the PM loop’s turn cap. None
keeps crate::agent_loop::AgentLoopConfig’s built-in 8, so an
absent flag changes nothing. Already validated (non-zero) by
crate::provider::resolve_max_turns before it reaches here.
Test: run_task::tests::max_turns_override_raises_the_pm_turn_cap.
deadline_secs: Option<u64>Optional per-run wall-clock deadline override, in seconds (#2207).
None falls through to crate::provider::resolve_deadline_secs’s
env-var/default tiers — see that function’s docs for the full
precedence. Applied to BOTH the PM’s own loop and the delegated
engineer’s loop (build_engineer_runner).
permission_mode: PermissionMode(#7948) What this HEADLESS run does with an agent’s ask rule. A
one-shot CLI run has no client, so PermissionMode::Default refuses
the call and AllowAsks (--permission-mode allow-asks or
TCODE_PERMISSION_MODE=allow-asks) permits it. A deny is refused
either way.
no_delegate: bool(#8031) Run the named top-level agent ALONE: true swaps
DelegateToAgentTool on the PM registry for that agent’s own tcode
tools.
Why: run-task engineer <task> still advertised delegate_to_agent,
and the model self-delegated read/write work instead of doing it — a
guaranteed single-agent run was not expressible. Dropping the tool
alone is not enough: read_file, write_file, edit and bash only
ever existed on the DELEGATED agent’s per-delegation registry.
What: true skips the delegate tool and merges in the set
[crate::runner::agent_registry] builds for Self::agent — the SAME
ProjectToolFactory output, narrowed by the SAME tools.allowed gate,
a delegation of that agent would get; the loop’s existing
PermissionGate (already minted from this agent’s config) then decides
each call. false (the default every pre-#8031 caller gets) registers
the delegate tool exactly as before and merges nothing.
Test: run_task::tests::no_delegate_run_omits_delegate_tool,
run_task::tests::no_delegate_run_registers_the_agents_own_tools,
run_task::tests::default_run_registers_delegate_tool.
Trait Implementations§
Source§impl Clone for RunTaskParams
impl Clone for RunTaskParams
Auto Trait Implementations§
impl Freeze for RunTaskParams
impl RefUnwindSafe for RunTaskParams
impl Send for RunTaskParams
impl Sync for RunTaskParams
impl Unpin for RunTaskParams
impl UnsafeUnpin for RunTaskParams
impl UnwindSafe for RunTaskParams
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