Skip to main content

SessionSpec

Struct SessionSpec 

Source
pub struct SessionSpec {
Show 19 fields pub cwd: PathBuf, pub prompt: PromptMode, pub append_system_prompt: Option<String>, pub model: String, pub effort: String, pub session_id: String, pub resume: Option<String>, pub permission_mode: Option<String>, pub allowed_tools: Vec<String>, pub disallowed_tools: Vec<String>, pub tools: Vec<String>, pub writable: bool, pub settings_json: Option<Value>, pub json_schema: Option<Value>, pub max_budget_usd: Option<f64>, pub max_turns: Option<u32>, pub env: HashMap<String, String>, pub sandbox: Option<ResolvedSandbox>, pub hook_status: Option<HookStatusSeed>,
}
Expand description

Everything needed to spawn one agent session.

Fields§

§cwd: PathBuf

Working directory (target repo root) — project config loads from here.

§prompt: PromptMode§append_system_prompt: Option<String>

Appended to the default Claude Code system prompt (role prompt).

Claude-CLI-ism: --append-system-prompt has no equivalent on other backends, which may ignore this field.

§model: String

Model alias or full id (passed to –model).

§effort: String

low | medium | high | xhigh | max (passed to –effort).

Claude-CLI-ism: --effort is a Claude Code flag; a non-claude backend may ignore this field.

§session_id: String

Engine-chosen session UUID (passed to –session-id) so resume bookkeeping never depends on parsing CLI output.

§resume: Option<String>

When set, resume this previous session id instead of starting fresh.

Claude-CLI-ism: session resume is a Claude Code capability; a non-claude backend may ignore (or reject) this field.

§permission_mode: Option<String>

Passed to –permission-mode (e.g. “acceptEdits”, “plan”, “dontAsk”).

Claude-CLI-ism: --permission-mode has no equivalent on other backends, which may ignore this field.

§allowed_tools: Vec<String>

Passed to –allowedTools (patterns like “Bash(npm test*)”).

Claude-CLI-ism: --allowedTools is a Claude Code permission concept; a non-claude backend may ignore this field.

§disallowed_tools: Vec<String>

Passed to –disallowedTools (patterns like “Bash(git push*)”).

Claude-CLI-ism: --disallowedTools is a Claude Code permission concept; a non-claude backend may ignore this field.

§tools: Vec<String>

Passed to --tools (the built-in exclusive tool allow-list): empty = CLI default set, no flag emitted. Distinct from allowed_tools/disallowed_tools, which are permission patterns.

Claude-CLI-ism: --tools is a Claude Code flag; a non-claude backend may ignore this field.

§writable: bool

Whether this session’s role is expected to edit the working tree.

Non-Claude backends use this to select a write-capable local workspace mode for workers while keeping validators and orchestrators read-only. Claude continues to use permission_mode/tool rules and ignores this.

§settings_json: Option<Value>

Extra settings JSON (hooks etc.) passed via –settings.

Claude-CLI-ism: --settings (hooks, etc.) is a Claude Code concept; a non-claude backend may ignore this field.

§json_schema: Option<Value>

JSON Schema enforced on the session’s structured output (–json-schema).

Claude-CLI-ism: --json-schema is a Claude Code flag; a non-claude backend may ignore this field.

§max_budget_usd: Option<f64>

Hard dollar cap for the run (–max-budget-usd).

Claude-CLI-ism: --max-budget-usd is a Claude Code flag; a non-claude backend may ignore this field (and should enforce cost caps engine-side via its own pricing table instead).

§max_turns: Option<u32>

Soft turn budget: the engine counts assistant turns and aborts the session when exceeded (the CLI no longer has –max-turns).

§env: HashMap<String, String>

Extra environment variables for the child process.

§sandbox: Option<ResolvedSandbox>

Resolved OS sandbox, when the role opted into enforcement and the platform supports it (None otherwise).

Additive field (docs/scoping/worker-sandboxing.md): populated by runner.rs for worker/validator sessions. Non-claude backends ignore it.

§hook_status: Option<HookStatusSeed>

Hook-status lane seed (ticket agent-hooks-status-signals): when the mission config opts in AND the role’s backend is hook-capable (crate::types::BackendKind::supports_hook_status_signals), the runner registers a per-run capability token and carries it here so the backend can install its lifecycle-hook projection at spawn. Backends without a hook surface ignore this field exactly like settings_json — a Some on them is a byte-identical no-op.

Trait Implementations§

Source§

impl Clone for SessionSpec

Source§

fn clone(&self) -> SessionSpec

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SessionSpec

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more