From b53ebc27748cb05910d814ebb7eba8c78a2567b5 Mon Sep 17 00:00:00 2001 From: Michael Bolin Date: Wed, 22 Apr 2026 23:02:19 -0700 Subject: [PATCH] ensure AdditionalFileSystemPermissions is created with entries field set --- ...CommandExecutionRequestApprovalParams.json | 2 ++ .../PermissionsRequestApprovalParams.json | 2 ++ .../PermissionsRequestApprovalResponse.json | 2 ++ .../schema/json/ServerNotification.json | 2 ++ .../schema/json/ServerRequest.json | 2 ++ .../codex_app_server_protocol.schemas.json | 2 ++ .../codex_app_server_protocol.v2.schemas.json | 2 ++ ...anApprovalReviewCompletedNotification.json | 2 ++ ...dianApprovalReviewStartedNotification.json | 2 ++ .../v2/AdditionalFileSystemPermissions.ts | 10 +++++++++- .../app-server-protocol/src/protocol/v2.rs | 19 ++++++++++++++++++- 11 files changed, 45 insertions(+), 2 deletions(-) diff --git a/codex-rs/app-server-protocol/schema/json/CommandExecutionRequestApprovalParams.json b/codex-rs/app-server-protocol/schema/json/CommandExecutionRequestApprovalParams.json index 3968da2a39..78e75d7c46 100644 --- a/codex-rs/app-server-protocol/schema/json/CommandExecutionRequestApprovalParams.json +++ b/codex-rs/app-server-protocol/schema/json/CommandExecutionRequestApprovalParams.json @@ -25,6 +25,7 @@ ] }, "read": { + "description": "This will be removed in favor of `entries`.", "items": { "$ref": "#/definitions/AbsolutePathBuf" }, @@ -34,6 +35,7 @@ ] }, "write": { + "description": "This will be removed in favor of `entries`.", "items": { "$ref": "#/definitions/AbsolutePathBuf" }, diff --git a/codex-rs/app-server-protocol/schema/json/PermissionsRequestApprovalParams.json b/codex-rs/app-server-protocol/schema/json/PermissionsRequestApprovalParams.json index c2e26c5532..ef268908f9 100644 --- a/codex-rs/app-server-protocol/schema/json/PermissionsRequestApprovalParams.json +++ b/codex-rs/app-server-protocol/schema/json/PermissionsRequestApprovalParams.json @@ -25,6 +25,7 @@ ] }, "read": { + "description": "This will be removed in favor of `entries`.", "items": { "$ref": "#/definitions/AbsolutePathBuf" }, @@ -34,6 +35,7 @@ ] }, "write": { + "description": "This will be removed in favor of `entries`.", "items": { "$ref": "#/definitions/AbsolutePathBuf" }, diff --git a/codex-rs/app-server-protocol/schema/json/PermissionsRequestApprovalResponse.json b/codex-rs/app-server-protocol/schema/json/PermissionsRequestApprovalResponse.json index e066108e6f..f49165296a 100644 --- a/codex-rs/app-server-protocol/schema/json/PermissionsRequestApprovalResponse.json +++ b/codex-rs/app-server-protocol/schema/json/PermissionsRequestApprovalResponse.json @@ -25,6 +25,7 @@ ] }, "read": { + "description": "This will be removed in favor of `entries`.", "items": { "$ref": "#/definitions/AbsolutePathBuf" }, @@ -34,6 +35,7 @@ ] }, "write": { + "description": "This will be removed in favor of `entries`.", "items": { "$ref": "#/definitions/AbsolutePathBuf" }, diff --git a/codex-rs/app-server-protocol/schema/json/ServerNotification.json b/codex-rs/app-server-protocol/schema/json/ServerNotification.json index 38acf1c902..59b3f5b45a 100644 --- a/codex-rs/app-server-protocol/schema/json/ServerNotification.json +++ b/codex-rs/app-server-protocol/schema/json/ServerNotification.json @@ -84,6 +84,7 @@ ] }, "read": { + "description": "This will be removed in favor of `entries`.", "items": { "$ref": "#/definitions/AbsolutePathBuf" }, @@ -93,6 +94,7 @@ ] }, "write": { + "description": "This will be removed in favor of `entries`.", "items": { "$ref": "#/definitions/AbsolutePathBuf" }, diff --git a/codex-rs/app-server-protocol/schema/json/ServerRequest.json b/codex-rs/app-server-protocol/schema/json/ServerRequest.json index 016dbe3415..84bf524739 100644 --- a/codex-rs/app-server-protocol/schema/json/ServerRequest.json +++ b/codex-rs/app-server-protocol/schema/json/ServerRequest.json @@ -25,6 +25,7 @@ ] }, "read": { + "description": "This will be removed in favor of `entries`.", "items": { "$ref": "#/definitions/AbsolutePathBuf" }, @@ -34,6 +35,7 @@ ] }, "write": { + "description": "This will be removed in favor of `entries`.", "items": { "$ref": "#/definitions/AbsolutePathBuf" }, diff --git a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json index 516e33aa7a..3eaf25b9b2 100644 --- a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json +++ b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json @@ -5298,6 +5298,7 @@ ] }, "read": { + "description": "This will be removed in favor of `entries`.", "items": { "$ref": "#/definitions/v2/AbsolutePathBuf" }, @@ -5307,6 +5308,7 @@ ] }, "write": { + "description": "This will be removed in favor of `entries`.", "items": { "$ref": "#/definitions/v2/AbsolutePathBuf" }, diff --git a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json index 67a4cb186f..b1f9935150 100644 --- a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json +++ b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json @@ -148,6 +148,7 @@ ] }, "read": { + "description": "This will be removed in favor of `entries`.", "items": { "$ref": "#/definitions/AbsolutePathBuf" }, @@ -157,6 +158,7 @@ ] }, "write": { + "description": "This will be removed in favor of `entries`.", "items": { "$ref": "#/definitions/AbsolutePathBuf" }, diff --git a/codex-rs/app-server-protocol/schema/json/v2/ItemGuardianApprovalReviewCompletedNotification.json b/codex-rs/app-server-protocol/schema/json/v2/ItemGuardianApprovalReviewCompletedNotification.json index 27716e59b0..e4a278330c 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/ItemGuardianApprovalReviewCompletedNotification.json +++ b/codex-rs/app-server-protocol/schema/json/v2/ItemGuardianApprovalReviewCompletedNotification.json @@ -25,6 +25,7 @@ ] }, "read": { + "description": "This will be removed in favor of `entries`.", "items": { "$ref": "#/definitions/AbsolutePathBuf" }, @@ -34,6 +35,7 @@ ] }, "write": { + "description": "This will be removed in favor of `entries`.", "items": { "$ref": "#/definitions/AbsolutePathBuf" }, diff --git a/codex-rs/app-server-protocol/schema/json/v2/ItemGuardianApprovalReviewStartedNotification.json b/codex-rs/app-server-protocol/schema/json/v2/ItemGuardianApprovalReviewStartedNotification.json index c039f2191a..b4ad6af44b 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/ItemGuardianApprovalReviewStartedNotification.json +++ b/codex-rs/app-server-protocol/schema/json/v2/ItemGuardianApprovalReviewStartedNotification.json @@ -25,6 +25,7 @@ ] }, "read": { + "description": "This will be removed in favor of `entries`.", "items": { "$ref": "#/definitions/AbsolutePathBuf" }, @@ -34,6 +35,7 @@ ] }, "write": { + "description": "This will be removed in favor of `entries`.", "items": { "$ref": "#/definitions/AbsolutePathBuf" }, diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/AdditionalFileSystemPermissions.ts b/codex-rs/app-server-protocol/schema/typescript/v2/AdditionalFileSystemPermissions.ts index 2be8f7f0e7..e29263b95f 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/AdditionalFileSystemPermissions.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/AdditionalFileSystemPermissions.ts @@ -4,4 +4,12 @@ import type { AbsolutePathBuf } from "../AbsolutePathBuf"; import type { FileSystemSandboxEntry } from "./FileSystemSandboxEntry"; -export type AdditionalFileSystemPermissions = { read: Array | null, write: Array | null, globScanMaxDepth?: number, entries?: Array, }; +export type AdditionalFileSystemPermissions = { +/** + * This will be removed in favor of `entries`. + */ +read: Array | null, +/** + * This will be removed in favor of `entries`. + */ +write: Array | null, globScanMaxDepth?: number, entries?: Array, }; diff --git a/codex-rs/app-server-protocol/src/protocol/v2.rs b/codex-rs/app-server-protocol/src/protocol/v2.rs index 655ad2d0ad..77d4905661 100644 --- a/codex-rs/app-server-protocol/src/protocol/v2.rs +++ b/codex-rs/app-server-protocol/src/protocol/v2.rs @@ -1273,7 +1273,9 @@ impl From for NetworkApprovalContext { #[serde(rename_all = "camelCase")] #[ts(export_to = "v2/")] pub struct AdditionalFileSystemPermissions { + /// This will be removed in favor of `entries`. pub read: Option>, + /// This will be removed in favor of `entries`. pub write: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] #[ts(optional)] @@ -1286,11 +1288,26 @@ pub struct AdditionalFileSystemPermissions { impl From for AdditionalFileSystemPermissions { fn from(value: CoreFileSystemPermissions) -> Self { if let Some((read, write)) = value.legacy_read_write_roots() { + let mut entries = Vec::with_capacity( + read.as_ref().map_or(0, Vec::len) + write.as_ref().map_or(0, Vec::len), + ); + if let Some(paths) = read.as_ref() { + entries.extend(paths.iter().map(|path| FileSystemSandboxEntry { + path: FileSystemPath::Path { path: path.clone() }, + access: FileSystemAccessMode::Read, + })); + } + if let Some(paths) = write.as_ref() { + entries.extend(paths.iter().map(|path| FileSystemSandboxEntry { + path: FileSystemPath::Path { path: path.clone() }, + access: FileSystemAccessMode::Write, + })); + } Self { read, write, glob_scan_max_depth: None, - entries: None, + entries: Some(entries), } } else { Self {