Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
2490fb2
Add stdio exec-server client transport
starr-openai May 1, 2026
8626d27
Make exec-server RPC client Send-safe
starr-openai May 1, 2026
3d75227
Remove duplicate stdio client test import
starr-openai May 1, 2026
7834efe
Clarify exec-server transport lifetime ownership
starr-openai May 4, 2026
881e7b5
Clean up stdio client process groups
starr-openai May 4, 2026
55bcc97
Simplify exec-server transport internals
starr-openai May 4, 2026
52ca8fa
Address stdio exec-server review feedback
starr-openai May 5, 2026
21faf08
Simplify stdio exec-server transport ownership
starr-openai May 5, 2026
bedee6e
Clarify exec-server transport connect naming
starr-openai May 5, 2026
0390110
Order exec-server transport teardown before RPC teardown
starr-openai May 5, 2026
1870847
Name retained exec-server connection field
starr-openai May 5, 2026
f3ba2aa
Model retained JSON-RPC transport generically
starr-openai May 5, 2026
9f771fb
Split JSON-RPC transport variants
starr-openai May 5, 2026
0190927
Rename exec-server transport input params
starr-openai May 5, 2026
fb93315
Fix exec-server transport CI failures
starr-openai May 5, 2026
bc34e37
Simplify exec-server disconnect plumbing
starr-openai May 5, 2026
39634ad
Remove server disconnect race test
starr-openai May 5, 2026
2a1200e
Simplify exec-server transport ownership
starr-openai May 5, 2026
94956cd
Restore exec-server processor ownership boundary
starr-openai May 5, 2026
579f473
Simplify exec-server connection ownership
starr-openai May 5, 2026
c0f9daf
Flatten JSON-RPC connection state
starr-openai May 5, 2026
d42a1e0
Narrow stdio client lifetime handling
starr-openai May 6, 2026
40ea3b7
Fix stdio transport clippy issues
starr-openai May 6, 2026
f5d9014
Box retained stdio transport guard
starr-openai May 6, 2026
9d93322
Apply rustfmt to stdio transport guard
starr-openai May 6, 2026
6e3d294
Fix Windows stdio test JSON quoting
starr-openai May 6, 2026
f023486
Use PowerShell for Windows stdio test helper
starr-openai May 6, 2026
9012dec
Make environment providers own default selection
starr-openai May 1, 2026
941da79
Fix environment manager clippy lints
starr-openai May 1, 2026
0422ede
Simplify provider default environment selection
starr-openai May 4, 2026
6e03a7c
Return provider environment snapshots
starr-openai May 4, 2026
4b9dadd
Split provider environments from default id
starr-openai May 4, 2026
ac065c3
Inline provider manager construction
starr-openai May 4, 2026
16ae047
Simplify environment provider defaults
starr-openai May 5, 2026
bc0677d
Represent provider defaults with snapshots
starr-openai May 6, 2026
2a5b5ab
Add CODEX_HOME environments TOML provider
starr-openai May 1, 2026
1607c0b
Fix environments TOML lint coverage
starr-openai May 5, 2026
5e019e4
Limit TOML provider test constructor to tests
starr-openai May 5, 2026
551d46a
Narrow exec server URL accessor
starr-openai May 6, 2026
9878ced
Align TOML provider with snapshot trait
starr-openai May 6, 2026
fc52ee6
Expose CODEX_HOME environment manager constructor
starr-openai May 6, 2026
4d827aa
Add optional environment resolver hook
starr-openai May 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions codex-rs/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions codex-rs/app-server-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ pub use codex_core::StateDbHandle;
use codex_core::config::Config;
pub use codex_exec_server::EnvironmentManager;
pub use codex_exec_server::EnvironmentManagerArgs;
pub use codex_exec_server::EnvironmentResolver;
pub use codex_exec_server::ExecServerRuntimePaths;
use codex_feedback::CodexFeedback;
use codex_protocol::protocol::SessionSource;
Expand Down
32 changes: 21 additions & 11 deletions codex-rs/app-server/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ use codex_core::check_execpolicy_for_warnings;
use codex_core::config::find_codex_home;
use codex_core::init_state_db_from_config;
use codex_exec_server::EnvironmentManager;
use codex_exec_server::EnvironmentResolver;
use codex_exec_server::ExecServerRuntimePaths;
use codex_feedback::CodexFeedback;
use codex_protocol::protocol::SessionSource;
Expand Down Expand Up @@ -371,15 +372,19 @@ pub enum PluginStartupTasks {
Skip,
}

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[derive(Debug, Clone)]
pub struct AppServerRuntimeOptions {
pub plugin_startup_tasks: PluginStartupTasks,
/// Optional resolver passed through to the environment manager. App-server
/// still uses strict environment-id lookup today.
pub environment_resolver: Option<Arc<dyn EnvironmentResolver>>,
}

impl Default for AppServerRuntimeOptions {
fn default() -> Self {
Self {
plugin_startup_tasks: PluginStartupTasks::Start,
environment_resolver: None,
}
}
}
Expand Down Expand Up @@ -417,15 +422,20 @@ pub async fn run_main_with_transport_options(
auth: AppServerWebsocketAuthSettings,
runtime_options: AppServerRuntimeOptions,
) -> IoResult<()> {
let environment_manager = Arc::new(
EnvironmentManager::new(EnvironmentManagerArgs::new(
ExecServerRuntimePaths::from_optional_paths(
arg0_paths.codex_self_exe.clone(),
arg0_paths.codex_linux_sandbox_exe.clone(),
)?,
))
.await,
);
let AppServerRuntimeOptions {
plugin_startup_tasks,
environment_resolver,
} = runtime_options;
let mut environment_manager_args =
EnvironmentManagerArgs::new(ExecServerRuntimePaths::from_optional_paths(
arg0_paths.codex_self_exe.clone(),
arg0_paths.codex_linux_sandbox_exe.clone(),
)?);
if let Some(environment_resolver) = environment_resolver {
environment_manager_args =
environment_manager_args.with_environment_resolver(environment_resolver);
}
let environment_manager = Arc::new(EnvironmentManager::new(environment_manager_args).await);
let (transport_event_tx, mut transport_event_rx) =
mpsc::channel::<TransportEvent>(CHANNEL_CAPACITY);
let (outgoing_tx, mut outgoing_rx) = mpsc::channel::<OutgoingEnvelope>(CHANNEL_CAPACITY);
Expand Down Expand Up @@ -765,7 +775,7 @@ pub async fn run_main_with_transport_options(
auth_manager,
rpc_transport: analytics_rpc_transport(&transport),
remote_control_handle: Some(remote_control_handle.clone()),
plugin_startup_tasks: runtime_options.plugin_startup_tasks,
plugin_startup_tasks,
}));
let mut thread_created_rx = processor.thread_created_receiver();
let mut running_turn_count_rx = processor.subscribe_running_assistant_turn_count();
Expand Down
11 changes: 5 additions & 6 deletions codex-rs/core/tests/common/test_codex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ const SUBMIT_TURN_COMPLETE_TIMEOUT: Duration = Duration::from_secs(30);
#[derive(Debug)]
pub struct TestEnv {
environment: codex_exec_server::Environment,
exec_server_url: Option<String>,
cwd: AbsolutePathBuf,
local_cwd_temp_dir: Option<Arc<TempDir>>,
remote_container_name: Option<String>,
Expand All @@ -86,6 +87,7 @@ impl TestEnv {
codex_exec_server::Environment::create_for_tests(/*exec_server_url*/ None)?;
Ok(Self {
environment,
exec_server_url: None,
cwd,
local_cwd_temp_dir: Some(local_cwd_temp_dir),
remote_container_name: None,
Expand All @@ -100,10 +102,6 @@ impl TestEnv {
&self.environment
}

pub fn exec_server_url(&self) -> Option<&str> {
self.environment.exec_server_url()
}

fn local_cwd_temp_dir(&self) -> Option<Arc<TempDir>> {
self.local_cwd_temp_dir.clone()
}
Expand All @@ -123,7 +121,7 @@ pub async fn test_env() -> Result<TestEnv> {
Some(remote_env) => {
let websocket_url = remote_exec_server_url()?;
let environment =
codex_exec_server::Environment::create_for_tests(Some(websocket_url))?;
codex_exec_server::Environment::create_for_tests(Some(websocket_url.clone()))?;
let cwd = remote_aware_cwd_path();
environment
.get_filesystem()
Expand All @@ -135,6 +133,7 @@ pub async fn test_env() -> Result<TestEnv> {
.await?;
Ok(TestEnv {
environment,
exec_server_url: Some(websocket_url),
cwd,
local_cwd_temp_dir: None,
remote_container_name: Some(remote_env.container_name),
Expand Down Expand Up @@ -385,7 +384,7 @@ impl TestCodexBuilder {
let exec_server_url = self
.exec_server_url
.clone()
.or_else(|| test_env.exec_server_url().map(str::to_owned));
.or_else(|| test_env.exec_server_url.clone());
let local_runtime_paths = codex_exec_server::ExecServerRuntimePaths::new(
std::env::current_exe()?,
/*codex_linux_sandbox_exe*/ None,
Expand Down
3 changes: 3 additions & 0 deletions codex-rs/exec-server/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ load("//:defs.bzl", "codex_rust_crate")
codex_rust_crate(
name = "exec-server",
crate_name = "codex_exec_server",
deps_extra = [
"@crates//:toml",
],
# Keep the crate's integration tests single-threaded under Bazel because
# they install process-global test-binary dispatch state, and the remote
# exec-server cases already rely on serialization around the full CLI path.
Expand Down
1 change: 1 addition & 0 deletions codex-rs/exec-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
sha2 = { workspace = true }
thiserror = { workspace = true }
toml = { workspace = true }
tokio = { workspace = true, features = [
"fs",
"io-std",
Expand Down
Loading
Loading