mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
Make environment provider snapshots path-free (#21794)
## Summary - make EnvironmentProvider::snapshot path-free and keep providers focused on provider-owned remote environments - let provider snapshots request local inclusion via include_local, with environments.toml including local and CODEX_EXEC_SERVER_URL excluding local - move reserved local environment construction into EnvironmentManager using ExecServerRuntimePaths Follow-up to https://github.com/openai/codex/pull/20667 ## Testing - just fmt - git diff --check - devbox: bazel build --bes_backend= --bes_results_url= //codex-rs/exec-server:exec-server - devbox: bazel test --bes_backend= --bes_results_url= //codex-rs/exec-server:exec-server-unit-tests Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
@@ -293,7 +293,7 @@ async fn shutdown_all_threads_bounded_submits_shutdown_to_every_thread() {
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn start_thread_accepts_explicit_environment_when_default_environment_is_disabled() {
|
||||
async fn start_thread_rejects_explicit_local_environment_when_default_provider_is_disabled() {
|
||||
let temp_dir = tempdir().expect("tempdir");
|
||||
let mut config = test_config().await;
|
||||
config.codex_home = temp_dir.path().join("codex-home").abs();
|
||||
@@ -319,7 +319,7 @@ async fn start_thread_accepts_explicit_environment_when_default_environment_is_d
|
||||
environment_manager,
|
||||
);
|
||||
|
||||
let thread = manager
|
||||
let result = manager
|
||||
.start_thread_with_options(StartThreadOptions {
|
||||
config: config.clone(),
|
||||
initial_history: InitialHistory::New,
|
||||
@@ -334,10 +334,14 @@ async fn start_thread_accepts_explicit_environment_when_default_environment_is_d
|
||||
cwd: config.cwd.clone(),
|
||||
}],
|
||||
})
|
||||
.await
|
||||
.expect("explicit sticky environment should resolve by id");
|
||||
.await;
|
||||
let err = match result {
|
||||
Ok(_) => panic!("explicit local environment should not resolve when provider is disabled"),
|
||||
Err(err) => err,
|
||||
};
|
||||
|
||||
assert_eq!(manager.list_thread_ids().await, vec![thread.thread_id]);
|
||||
assert_eq!(err.to_string(), "unknown turn environment id `local`");
|
||||
assert!(manager.list_thread_ids().await.is_empty());
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
|
||||
Reference in New Issue
Block a user