mirror of
https://github.com/openai/codex.git
synced 2026-11-07 20:30:33 +00:00
Initialize execution environments with the final HTTP policy (#34995)
## Why The TUI must inspect the default execution environment before loading its final configuration. Initializing the environment manager at that point can give startup services the bootstrap HTTP policy instead of the effective policy after managed requirements are applied. ## What changed - Split environment discovery from manager construction so callers can inspect the default environment without starting remote connections. - Build the environment manager after final configuration loading and pass its resolved `HttpClientFactory` through all construction paths. - Add shared test support for managers that use the legacy default HTTP policy. ## Testing - Cover connection-free environment discovery and explicit HTTP policy propagation. - Verify TUI startup services use the final managed `respect_system_proxy` value. GitOrigin-RevId: 928fa31e6b4bcfbe1a121cade2f351427fdfa0f4
This commit is contained in:
@@ -354,6 +354,7 @@ mod tests {
|
||||
use codex_config::McpServerConfig;
|
||||
use codex_config::McpServerTransportConfig;
|
||||
use codex_exec_server::EnvironmentManager;
|
||||
use codex_exec_server_test_support::environment_manager_without_environments;
|
||||
use codex_utils_path_uri::LegacyAppPathString;
|
||||
use pretty_assertions::assert_eq;
|
||||
use serde_json::Value;
|
||||
@@ -475,7 +476,7 @@ mod tests {
|
||||
#[test]
|
||||
fn local_stdio_requires_local_stdio_availability() {
|
||||
let runtime_context = McpRuntimeContext::new(
|
||||
Arc::new(EnvironmentManager::without_environments()),
|
||||
Arc::new(environment_manager_without_environments()),
|
||||
PathBuf::from("/tmp"),
|
||||
);
|
||||
|
||||
@@ -494,7 +495,7 @@ mod tests {
|
||||
#[test]
|
||||
fn local_http_does_not_require_local_stdio_availability() {
|
||||
let runtime_context = McpRuntimeContext::new(
|
||||
Arc::new(EnvironmentManager::without_environments()),
|
||||
Arc::new(environment_manager_without_environments()),
|
||||
PathBuf::from("/tmp"),
|
||||
);
|
||||
|
||||
@@ -510,7 +511,7 @@ mod tests {
|
||||
#[test]
|
||||
fn unknown_explicit_environment_is_rejected() {
|
||||
let runtime_context = McpRuntimeContext::new(
|
||||
Arc::new(EnvironmentManager::without_environments()),
|
||||
Arc::new(environment_manager_without_environments()),
|
||||
PathBuf::from("/tmp"),
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user