pub struct SubprocessSpawnConfig {
pub cli_command: String,
pub cli_args: Vec<String>,
pub working_dir: String,
pub env_vars: HashMap<String, String>,
pub message: String,
pub resume_flag: String,
pub session_id_field: String,
pub message_id: Option<String>,
pub session_id: Option<String>,
}Expand description
Configuration for spawning a subprocess turn.
Fields§
§cli_command: StringCLI executable (e.g., “claude”).
cli_args: Vec<String>CLI arguments (e.g., [“-p”, “–output-format”, “stream-json”, …]).
working_dir: StringWorking directory for the subprocess.
env_vars: HashMap<String, String>Environment variables to set.
message: StringThe user’s JSON message to write to stdin.
resume_flag: StringFlag used to resume a previous session, e.g. “–resume” (Claude), “-r” (Gemini). Empty string means this provider does not support simple-flag resume.
session_id_field: StringJSON field name in the CLI’s init event that contains the session/thread ID. e.g. “session_id” (Claude/Gemini) or “thread_id” (Codex).
message_id: Option<String>Optional client-supplied message id. Echoed back via the
agent-message-accepted event when this config transitions from
queued → running so the frontend can pair the event with a
pending PendingMessage. None means no feedback is emitted.
session_id: Option<String>Session id to hydrate inner.session_id with BEFORE the first
turn — used by the picker “My Agents” reattach path. The
caller reads this from block.meta["agent:sessionid"] which
the frontend pre-populates from the prior block’s session id
when launching with continueOfInstanceId. Without this
hydration spawn_turn would only see the captured session id
AFTER the first turn — meaning the first turn always launches
the CLI fresh (no --resume <sid>) and starts a new
conversation that re-injects the startup context.
Empty / None means “no prior session” (greenfield launch).
Best-effort, not authoritative: if the hydrated id is stale,
the CLI’s stdout-emitted session id always overwrites it at
capture time (see spawn_turn’s stdout-reader block). The
reattach turn passes the (possibly stale) hydrated id via
--resume; the CLI either accepts it or starts a new
session and emits its own id, which then becomes the in-
memory authority for every subsequent turn.
Trait Implementations§
Source§impl Clone for SubprocessSpawnConfig
impl Clone for SubprocessSpawnConfig
Source§fn clone(&self) -> SubprocessSpawnConfig
fn clone(&self) -> SubprocessSpawnConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for SubprocessSpawnConfig
impl RefUnwindSafe for SubprocessSpawnConfig
impl Send for SubprocessSpawnConfig
impl Sync for SubprocessSpawnConfig
impl Unpin for SubprocessSpawnConfig
impl UnwindSafe for SubprocessSpawnConfig
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,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.