app-server: use permission ids and runtime workspace roots

This commit is contained in:
Michael Bolin
2026-05-14 10:59:10 -07:00
parent 2fbcb8554e
commit 247bbdaf05
55 changed files with 809 additions and 510 deletions

View File

@@ -789,6 +789,7 @@ async fn run_exec_session(args: ExecRunArgs) -> anyhow::Result<()> {
responsesapi_client_metadata: None,
environments: None,
cwd: Some(default_cwd),
runtime_workspace_roots: None,
approval_policy: Some(default_approval_policy.into()),
approvals_reviewer: None,
sandbox_policy: None,
@@ -960,6 +961,13 @@ fn thread_start_params_from_config(config: &Config) -> ThreadStartParams {
model: config.model.clone(),
model_provider: Some(config.model_provider_id.clone()),
cwd: Some(config.cwd.to_string_lossy().to_string()),
runtime_workspace_roots: Some(
config
.workspace_roots
.iter()
.map(AbsolutePathBuf::to_path_buf)
.collect(),
),
approval_policy: Some(config.permissions.approval_policy.value().into()),
approvals_reviewer: approvals_reviewer_override_from_config(config),
sandbox: sandbox.flatten(),
@@ -983,6 +991,13 @@ fn thread_resume_params_from_config(config: &Config, thread_id: String) -> Threa
model: config.model.clone(),
model_provider: Some(config.model_provider_id.clone()),
cwd: Some(config.cwd.to_string_lossy().to_string()),
runtime_workspace_roots: Some(
config
.workspace_roots
.iter()
.map(AbsolutePathBuf::to_path_buf)
.collect(),
),
approval_policy: Some(config.permissions.approval_policy.value().into()),
approvals_reviewer: approvals_reviewer_override_from_config(config),
sandbox: sandbox.flatten(),
@@ -1002,10 +1017,7 @@ fn permissions_selection_from_config(config: &Config) -> Option<PermissionProfil
fn permissions_selection_from_active_profile(
active: ActivePermissionProfile,
) -> PermissionProfileSelectionParams {
PermissionProfileSelectionParams::Profile {
id: active.id,
modifications: None,
}
PermissionProfileSelectionParams::new(active.id)
}
fn sandbox_mode_from_permission_profile(

View File

@@ -558,6 +558,7 @@ fn sample_thread_start_response() -> ThreadStartResponse {
model_provider: "openai".to_string(),
service_tier: None,
cwd: test_path_buf("/tmp").abs(),
runtime_workspace_roots: Vec::new(),
instruction_sources: Vec::new(),
approval_policy: codex_app_server_protocol::AskForApproval::OnRequest,
approvals_reviewer: codex_app_server_protocol::ApprovalsReviewer::AutoReview,