protocol: make user-turn sandbox policy optional

This commit is contained in:
Michael Bolin
2026-04-30 07:35:34 -07:00
parent 2e8a66d44c
commit 0259075ce6
9 changed files with 44 additions and 56 deletions

View File

@@ -529,7 +529,7 @@ pub enum Op {
/// User input items, see `InputItem`
items: Vec<UserInput>,
/// `cwd` to use with the [`SandboxPolicy`] and potentially tool calls
/// `cwd` to use with the permissions profile and potentially tool calls
/// such as `local_shell`.
cwd: PathBuf,
@@ -541,8 +541,13 @@ pub enum Op {
/// When omitted, the session keeps the current setting
approvals_reviewer: Option<ApprovalsReviewer>,
/// Policy to use for tool calls such as `local_shell`.
sandbox_policy: SandboxPolicy,
/// Legacy sandbox policy to use for tool calls such as `local_shell`.
///
/// When omitted, `permission_profile` is used as the canonical source
/// of permissions. This field is kept only as a compatibility fallback
/// for older callers that have not migrated to `permission_profile`.
#[serde(default, skip_serializing_if = "Option::is_none")]
sandbox_policy: Option<SandboxPolicy>,
/// Full permissions profile to use for tool calls such as `local_shell`.
///