Add managed Desktop workspace storage requirements (#55965)

## What changed

- Add `application.storage.default_project_parent` and `application.storage.projectless_workspace_root` requirements for new Desktop workspaces. Require absolute paths and reject unknown storage keys.
- Apply managed paths to `desktop.defaultProjectParent` and `desktop.projectlessWorkspaceRoot`, overriding local preferences and rejecting writes to managed settings or their containing table while preserving unrelated Desktop settings.
- Expose storage requirements through `config/requirements/read` and update generated JSON schemas, TypeScript types, and Python models.

## Testing

Add coverage for storage validation, per-setting layer precedence, config overrides, write protection, and requirements API responses. Adjust daemon shutdown test deadlines and TUI test synchronization, paste handling, and future allocation.

GitOrigin-RevId: 44b93fe69e6a471c3f485cbf5f9c9ebd34ac3234
This commit is contained in:
acrognale-oai
2026-10-21 19:06:57 +00:00
committed by copyberry
parent 067249a283
commit 57232f111c
25 changed files with 571 additions and 41 deletions
@@ -1,8 +1,9 @@
//! Managed requirements for application traffic, separate from agent permissions.
//! Managed application network and storage requirements, separate from agent permissions.
use super::NetworkDomainPermission;
use crate::JsonSchema;
use crate::TS;
use codex_utils_path_uri::LegacyAppPathString;
use serde::Deserialize;
use serde::Serialize;
use std::collections::BTreeMap;
@@ -12,6 +13,7 @@ use std::collections::BTreeMap;
#[ts(export_to = "v2/")]
pub struct ApplicationRequirements {
pub network: Option<ApplicationNetworkRequirements>,
pub storage: Option<ApplicationStorageRequirements>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
@@ -22,3 +24,12 @@ pub struct ApplicationNetworkRequirements {
pub enabled: bool,
pub domains: BTreeMap<String, NetworkDomainPermission>,
}
/// Managed storage settings for new Desktop workspaces, not filesystem access restrictions.
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]
pub struct ApplicationStorageRequirements {
pub default_project_parent: Option<LegacyAppPathString>,
pub projectless_workspace_root: Option<LegacyAppPathString>,
}