mirror of
https://github.com/openai/codex.git
synced 2026-11-05 08:28:29 +00:00
Use ApiPathString in app-server filesystem permission paths (#28367)
## Why Clients running an app-server on one OS and an exec-server on another OS need to be able to pass sandbox config to app-server that refers to resources on the executor's foreign OS. ## What `AbsolutePathBuf` can't represent these paths and we don't want users to be exposed to `PathUri` yet, so this moves the public app-server API to be expressed in terms of `ApiPathString`. Stacked on #28165. - change app-server v2 filesystem permission paths, including legacy read/write roots, to `ApiPathString` - localize API paths through `PathUri` when converting into the current native core permission types - make path-bearing permission conversions fallible and surface localization failures instead of silently treating malformed grants as ordinary denials - propagate conversion failures through app-server and TUI approval handling - regenerate the app-server JSON and TypeScript schemas - leave migration TODOs on native-path conversions so they can be removed once core permission paths use `PathUri`
This commit is contained in:
1 parent
d959664420
commit
ecfe174d5f
34 files changed
+546
-233
No files matched your search
@@ -30,7 +30,16 @@ impl ChatWidget {
|
||||
self.on_elicitation_request(request_id, params);
|
||||
}
|
||||
ServerRequest::PermissionsRequestApproval { params, .. } => {
|
||||
self.on_request_permissions(request_permissions_from_params(params));
|
||||
// TODO(anp): Remove this native-path localization error path once core permission
|
||||
// paths remain PathUri after crossing the app-server boundary.
|
||||
match request_permissions_from_params(params) {
|
||||
Ok(event) => self.on_request_permissions(event),
|
||||
Err(err) => {
|
||||
self.add_error_message(format!(
|
||||
"failed to localize requested filesystem paths: {err}"
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
ServerRequest::ToolRequestUserInput { params, .. } => {
|
||||
self.on_request_user_input(params);
|
||||
@@ -62,6 +71,17 @@ impl ChatWidget {
|
||||
completion: Option<(i64, codex_app_server_protocol::AutoReviewDecisionSource)>,
|
||||
action: GuardianApprovalReviewAction,
|
||||
) {
|
||||
// TODO(anp): Remove this native-path localization error path once core permission paths
|
||||
// remain PathUri after crossing the app-server boundary.
|
||||
let action = match action.try_into() {
|
||||
Ok(action) => action,
|
||||
Err(err) => {
|
||||
self.add_error_message(format!(
|
||||
"failed to localize guardian filesystem paths: {err}"
|
||||
));
|
||||
return;
|
||||
}
|
||||
};
|
||||
let (completed_at_ms, decision_source) = match completion {
|
||||
Some((completed_at_ms, decision_source)) => {
|
||||
(Some(completed_at_ms), Some(decision_source))
|
||||
@@ -128,7 +148,7 @@ impl ChatWidget {
|
||||
GuardianAssessmentDecisionSource::Agent
|
||||
}
|
||||
}),
|
||||
action: action.into(),
|
||||
action,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user