pub struct SessionOptions { /* private fields */ }Expand description
Creation-time settings for Runtime::open.
Implementations§
Source§impl SessionOptions
impl SessionOptions
Sourcepub fn in_dir(cwd: impl Into<PathBuf>) -> Self
pub fn in_dir(cwd: impl Into<PathBuf>) -> Self
Working directory the agent runs in. Required. A relative path is made absolute (lexically, no disk access): some agents reject a relative cwd.
Sourcepub fn configure(
self,
id: impl Into<ConfigId>,
value: impl Into<ConfigValue>,
) -> Self
pub fn configure( self, id: impl Into<ConfigId>, value: impl Into<ConfigValue>, ) -> Self
Set an advertised config option at creation — the path for options
with live: false (e.g. a non-live model). open fails with
InvalidConfiguration when the agent refuses the value.
Sourcepub fn resume(self, token: ResumeToken) -> Self
pub fn resume(self, token: ResumeToken) -> Self
Resume a provider session instead of creating a new one.
Sourcepub fn fork_from(self, token: ResumeToken, at: Option<MessageId>) -> Self
pub fn fork_from(self, token: ResumeToken, at: Option<MessageId>) -> Self
Branch a provider session into a new one that starts with its
conversation; the original stays untouched. None forks at the tip.
at cuts the copied history after that message, in the id currency
the adapter documents (claude: the claude/fork_point extension on
MessageEnded). Requires Capability::Fork; open fails typed
without it.
Sourcepub fn mcp_server(self, server: McpServer) -> Self
pub fn mcp_server(self, server: McpServer) -> Self
Forward a client-owned MCP server. open fails with
UnsupportedFeature when the agent lacks the server’s transport.
Sourcepub fn permission_mode(self, mode: PermissionMode) -> Self
pub fn permission_mode(self, mode: PermissionMode) -> Self
How tool permission requests are handled; Ask by default.
Sourcepub fn config_home(self, dir: impl Into<PathBuf>) -> Self
pub fn config_home(self, dir: impl Into<PathBuf>) -> Self
Point the agent at a separate config directory so one machine can hold
several logins side by side (claude: CLAUDE_CONFIG_DIR, codex:
CODEX_HOME). This is the supported way to keep logins apart;
credential copying stays the application’s job. open fails with
InvalidConfiguration on an agent that has no known config-home
variable, rather than silently ignoring the request.
Sourcepub fn record_wire(self, path: impl Into<PathBuf>) -> Self
pub fn record_wire(self, path: impl Into<PathBuf>) -> Self
Tee every raw protocol frame, both directions, to path for bug
reports: one JSON object per line, {"dir":"in"|"out","frame":<frame>},
append-only and flushed per line. A recording failure never fails a
turn. Unset (the default) records nothing.
The file is unredacted — prompts, file contents, command output, and possibly secrets — so treat it as sensitive and delete it after use.
Sourcepub fn quiet_window(self, window: Duration) -> Self
pub fn quiet_window(self, window: Duration) -> Self
Overrides the quiet window used to infer turn end on agents whose wire does not end turns deterministically. Diagnostics only.
Sourcepub fn stall_after(self, after: Duration) -> Self
pub fn stall_after(self, after: Duration) -> Self
How long the agent may stay silent mid-turn before a stall warning
Diagnostic (default 120 s). It warns once per silence; never ends
the turn.
Trait Implementations§
Source§impl Clone for SessionOptions
impl Clone for SessionOptions
Source§fn clone(&self) -> SessionOptions
fn clone(&self) -> SessionOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more