Move environment abstraction into exec server (#15125)

The idea is that codex-exec exposes an Environment struct with services
on it. Each of those is a trait.

Depending on construction parameters passed to Environment they are
either backed by local or remote server but core doesn't see these
differences.
This commit is contained in:
pakrym-oai
2026-03-19 08:31:14 -07:00
committed by GitHub
Unverified
parent 32d2df5c1e
commit dee03da508
16 changed files with 43 additions and 72 deletions
+1 -1
View File
@@ -59,7 +59,7 @@ use chrono::Local;
use chrono::Utc;
use codex_app_server_protocol::McpServerElicitationRequest;
use codex_app_server_protocol::McpServerElicitationRequestParams;
use codex_environment::Environment;
use codex_exec_server::Environment;
use codex_hooks::HookEvent;
use codex_hooks::HookEventAfterAgent;
use codex_hooks::HookPayload;
+2 -2
View File
@@ -2450,7 +2450,7 @@ pub(crate) async fn make_session_and_context() -> (Session, TurnContext) {
true,
));
let network_approval = Arc::new(NetworkApprovalService::default());
let environment = Arc::new(codex_environment::Environment);
let environment = Arc::new(codex_exec_server::Environment);
let file_watcher = Arc::new(FileWatcher::noop());
let services = SessionServices {
@@ -3244,7 +3244,7 @@ pub(crate) async fn make_session_and_context_with_dynamic_tools_and_rx(
true,
));
let network_approval = Arc::new(NetworkApprovalService::default());
let environment = Arc::new(codex_environment::Environment);
let environment = Arc::new(codex_exec_server::Environment);
let file_watcher = Arc::new(FileWatcher::noop());
let services = SessionServices {
+1 -1
View File
@@ -20,7 +20,7 @@ use crate::tools::network_approval::NetworkApprovalService;
use crate::tools::runtimes::ExecveSessionApproval;
use crate::tools::sandboxing::ApprovalStore;
use crate::unified_exec::UnifiedExecProcessManager;
use codex_environment::Environment;
use codex_exec_server::Environment;
use codex_hooks::Hooks;
use codex_otel::SessionTelemetry;
use codex_utils_absolute_path::AbsolutePathBuf;
@@ -1,5 +1,5 @@
use async_trait::async_trait;
use codex_environment::ExecutorFileSystem;
use codex_exec_server::ExecutorFileSystem;
use codex_protocol::models::FunctionCallOutputBody;
use codex_protocol::models::FunctionCallOutputContentItem;
use codex_protocol::models::FunctionCallOutputPayload;