Fix environment manager follow-up compile errors

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
starr-openai
2026-04-17 16:25:55 -07:00
parent 9d3188f79b
commit a6c81a05fd
7 changed files with 23 additions and 19 deletions

View File

@@ -519,8 +519,8 @@ pub async fn list_skills(sess: &Session, sub_id: String, cwds: Vec<PathBuf>, for
let plugins_manager = &sess.services.plugins_manager;
let fs = sess
.services
.environment
.as_ref()
.environment_manager
.default_environment()
.map(|environment| environment.get_filesystem());
let config = sess.get_config().await;
let codex_home = sess.codex_home().await;

View File

@@ -513,7 +513,7 @@ impl Codex {
}
let user_instructions = AgentsMdManager::new(&config)
.user_instructions(Some(environment.as_ref()))
.user_instructions(environment.as_deref())
.await;
let exec_policy = if crate::guardian::is_guardian_reviewer_source(&session_source) {

View File

@@ -2855,8 +2855,8 @@ async fn new_default_turn_uses_config_aware_skills_for_role_overrides() {
let skill_fs = session
.services
.environment
.as_ref()
.environment_manager
.default_environment()
.map(|environment| environment.get_filesystem())
.unwrap_or_else(|| std::sync::Arc::clone(&codex_exec_server::LOCAL_FS));
let parent_outcome = session

View File

@@ -175,7 +175,7 @@ pub struct ExecServerClient {
inner: Arc<Inner>,
}
#[derive(Clone, Debug)]
#[derive(Clone)]
pub(crate) struct LazyRemoteExecServerClient {
websocket_url: String,
client: Arc<OnceCell<ExecServerClient>>,

View File

@@ -246,8 +246,8 @@ mod tests {
assert!(environment.remote_exec_server_client.is_none());
}
#[test]
fn environment_manager_normalizes_empty_url() {
#[tokio::test]
async fn environment_manager_normalizes_empty_url() {
let manager = EnvironmentManager::new(EnvironmentManagerArgs {
exec_server_url: Some(String::new()),
local_runtime_paths: None,
@@ -276,8 +276,8 @@ mod tests {
assert!(manager.get_environment(REMOTE_ENVIRONMENT_ID).is_none());
}
#[test]
fn environment_manager_reports_remote_url() {
#[tokio::test]
async fn environment_manager_reports_remote_url() {
let manager = EnvironmentManager::new(EnvironmentManagerArgs {
exec_server_url: Some("ws://127.0.0.1:8765".to_string()),
local_runtime_paths: None,

View File

@@ -25,6 +25,7 @@ pub use client_api::RemoteExecServerConnectArgs;
pub use environment::CODEX_EXEC_SERVER_URL_ENV_VAR;
pub use environment::Environment;
pub use environment::EnvironmentManager;
pub use environment::EnvironmentManagerArgs;
pub use file_system::CopyOptions;
pub use file_system::CreateDirectoryOptions;
pub use file_system::ExecutorFileSystem;

View File

@@ -1928,8 +1928,9 @@ mod tests {
Ok(())
}
#[test]
fn config_cwd_for_app_server_target_omits_cwd_for_remote_sessions() -> std::io::Result<()> {
#[tokio::test]
async fn config_cwd_for_app_server_target_omits_cwd_for_remote_sessions() -> std::io::Result<()>
{
let remote_only_cwd = if cfg!(windows) {
Path::new(r"C:\definitely\not\local\to\this\test")
} else {
@@ -1949,8 +1950,9 @@ mod tests {
Ok(())
}
#[test]
fn config_cwd_for_app_server_target_canonicalizes_embedded_cli_cwd() -> std::io::Result<()> {
#[tokio::test]
async fn config_cwd_for_app_server_target_canonicalizes_embedded_cli_cwd() -> std::io::Result<()>
{
let temp_dir = TempDir::new()?;
let target = AppServerTarget::Embedded;
let environment_manager =
@@ -1968,9 +1970,9 @@ mod tests {
Ok(())
}
#[test]
fn config_cwd_for_app_server_target_errors_for_missing_embedded_cli_cwd() -> std::io::Result<()>
{
#[tokio::test]
async fn config_cwd_for_app_server_target_errors_for_missing_embedded_cli_cwd()
-> std::io::Result<()> {
let temp_dir = TempDir::new()?;
let missing = temp_dir.path().join("missing");
let target = AppServerTarget::Embedded;
@@ -1984,8 +1986,9 @@ mod tests {
Ok(())
}
#[test]
fn config_cwd_for_app_server_target_omits_cwd_for_remote_exec_server() -> std::io::Result<()> {
#[tokio::test]
async fn config_cwd_for_app_server_target_omits_cwd_for_remote_exec_server()
-> std::io::Result<()> {
let remote_only_cwd = if cfg!(windows) {
Path::new(r"C:\definitely\not\local\to\this\test")
} else {