Move workspace roots onto thread/session state and stop using active permission profile modifications as an overlay for writable roots. Existing app-server threads now preserve their persisted PermissionProfile value across resume, fork, and turn updates; permissions requests on existing threads only update the active named profile after validating it exists. Workspace roots can be updated independently, and SandboxPolicy::WorkspaceWrite no longer stores its own writable_roots.

This commit is contained in:
Michael Bolin
2026-05-11 15:23:16 -07:00
parent 3e10e09e24
commit 6579ec2f9d
141 changed files with 2384 additions and 2210 deletions
@@ -309,6 +309,7 @@ mod tests {
permission_profile: PermissionProfile::read_only(),
active_permission_profile: None,
cwd: test_path_buf("/home/user/project").abs(),
workspace_roots: Vec::new(),
reasoning_effort: Some(ReasoningEffort::default()),
initial_messages: None,
network_proxy: None,
@@ -354,6 +355,7 @@ mod tests {
permission_profile: PermissionProfile::read_only(),
active_permission_profile: None,
cwd: test_path_buf("/home/user/project").abs(),
workspace_roots: Vec::new(),
reasoning_effort: Some(ReasoningEffort::default()),
initial_messages: None,
network_proxy: None,
@@ -392,6 +394,7 @@ mod tests {
"approvals_reviewer": "user",
"permission_profile": session_configured_event.permission_profile,
"cwd": test_path_buf("/home/user/project"),
"workspace_roots": [],
"reasoning_effort": session_configured_event.reasoning_effort,
"rollout_path": rollout_file.path().to_path_buf(),
}
@@ -421,6 +424,7 @@ mod tests {
permission_profile: PermissionProfile::read_only(),
active_permission_profile: None,
cwd: test_path_buf("/home/user/project").abs(),
workspace_roots: Vec::new(),
reasoning_effort: Some(ReasoningEffort::default()),
initial_messages: None,
network_proxy: None,
@@ -460,6 +464,7 @@ mod tests {
"approvals_reviewer": "user",
"permission_profile": session_configured_event.permission_profile,
"cwd": test_path_buf("/home/user/project"),
"workspace_roots": [],
"reasoning_effort": session_configured_event.reasoning_effort,
"rollout_path": rollout_file.path().to_path_buf(),
}