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: PathBufWorking 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: StringModel alias or full id (passed to –model).
effort: Stringlow | 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: StringEngine-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: boolWhether 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
impl Clone for SessionSpec
Source§fn clone(&self) -> SessionSpec
fn clone(&self) -> SessionSpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more