mirror of
https://github.com/openai/codex.git
synced 2026-11-24 23:22:05 +00:00
Separate thread settings from environment configuration (#39597)
## Why Environment-owned permission profiles and workspace roots must remain effective without being persisted or restored as thread-owned settings. ## What changed - Keep thread settings snapshots and restore data separate from the effective configuration supplied by the primary environment. - Use resolved environment permissions, active profiles, workspace roots, and network policy when building turn context and session events. - Preserve environment selections when agents are evicted, resumed, or spawned, and validate owner configuration when it becomes ready. - Start memory initialization only after the primary environment is configured. ## Testing - Extend remote-environment and multi-agent tests to cover settings persistence, owner permission profiles, workspace roots, spawning, eviction, and resume. GitOrigin-RevId: d82f126981cd0190233020bbdd61d96c70558868
This commit is contained in:
1 parent
8f4a48a6ad
commit
d75c85f651
35 files changed
+564
-308
No files matched your search
@@ -5,7 +5,6 @@ use codex_agent_extension::AgentRunner;
|
||||
use codex_protocol::error::CodexErrorDetails;
|
||||
use codex_protocol::models::ContentItem;
|
||||
use codex_protocol::models::FunctionCallOutputContentItem;
|
||||
use codex_protocol::models::PermissionProfile;
|
||||
use codex_protocol::protocol::AdditionalContextEntry as CoreAdditionalContextEntry;
|
||||
use codex_protocol::protocol::AdditionalContextKind as CoreAdditionalContextKind;
|
||||
use codex_protocol::protocol::MultiAgentVersion;
|
||||
@@ -551,14 +550,6 @@ impl TurnRequestProcessor {
|
||||
},
|
||||
)
|
||||
.await?;
|
||||
let parent_permission_profile_override =
|
||||
thread_settings.permission_profile.clone().or_else(|| {
|
||||
thread_settings
|
||||
.sandbox_policy
|
||||
.as_ref()
|
||||
.map(PermissionProfile::from_legacy_sandbox_policy)
|
||||
});
|
||||
|
||||
let submission = thread
|
||||
.start_or_steer_turn(
|
||||
TurnInputRequest::new(TurnInput::UserInput {
|
||||
@@ -592,17 +583,17 @@ impl TurnRequestProcessor {
|
||||
|
||||
if turn_has_input && started {
|
||||
let config_snapshot = thread.config_snapshot().await;
|
||||
let parent_permission_profile =
|
||||
parent_permission_profile_override.unwrap_or(config_snapshot.permission_profile);
|
||||
codex_memories_write::start_memories_startup_task(
|
||||
Arc::clone(&self.thread_manager),
|
||||
Arc::clone(&self.auth_manager),
|
||||
thread_id,
|
||||
Arc::clone(&thread),
|
||||
thread.config().await,
|
||||
parent_permission_profile,
|
||||
&config_snapshot.session_source,
|
||||
);
|
||||
if config_snapshot.is_primary_environment_configured() {
|
||||
codex_memories_write::start_memories_startup_task(
|
||||
Arc::clone(&self.thread_manager),
|
||||
Arc::clone(&self.auth_manager),
|
||||
thread_id,
|
||||
Arc::clone(&thread),
|
||||
thread.config().await,
|
||||
config_snapshot.permission_profile,
|
||||
&config_snapshot.session_source,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
self.outgoing
|
||||
|
||||
Reference in new issue
Block a user