Add explicit thread environment selection

Add thread/start environment_id plumbing and explicit local/remote selection support while preserving the current default environment behavior. Include focused exec-server and app-server coverage for the new thread environment selection paths.

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
starr-openai
2026-04-16 11:56:10 -07:00
parent ea34c6ed8d
commit 220ad648c2
14 changed files with 315 additions and 2 deletions

View File

@@ -430,6 +430,7 @@ pub(crate) struct CodexSpawnArgs {
pub(crate) auth_manager: Arc<AuthManager>,
pub(crate) models_manager: Arc<ModelsManager>,
pub(crate) environment_manager: Arc<EnvironmentManager>,
pub(crate) environment_id: Option<String>,
pub(crate) skills_manager: Arc<SkillsManager>,
pub(crate) plugins_manager: Arc<PluginsManager>,
pub(crate) mcp_manager: Arc<McpManager>,
@@ -483,6 +484,7 @@ impl Codex {
auth_manager,
models_manager,
environment_manager,
environment_id,
skills_manager,
plugins_manager,
mcp_manager,
@@ -503,7 +505,7 @@ impl Codex {
let (tx_event, rx_event) = async_channel::unbounded();
let environment = environment_manager
.current()
.environment(environment_id.as_deref())
.await
.map_err(|err| CodexErr::Fatal(format!("failed to create environment: {err}")))?;
let fs = environment