Remove redundant environment validation wrapper

Route the remaining validation convenience API through resolve_environment_selections and keep the resolver tests attached to the resolver itself.

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
starr-openai
2026-04-30 15:27:53 -07:00
co-authored by Codex
parent 3065a55995
commit 29fff15f08
3 changed files with 5 additions and 11 deletions
+2 -9
View File
@@ -90,13 +90,6 @@ pub(crate) fn resolve_environment_selections(
Ok(ResolvedTurnEnvironments { turn_environments })
}
pub(crate) fn validate_environment_selections(
environment_manager: &EnvironmentManager,
environments: &[TurnEnvironmentSelection],
) -> CodexResult<()> {
resolve_environment_selections(environment_manager, environments).map(|_| ())
}
#[cfg(test)]
mod tests {
use codex_exec_server::ExecServerRuntimePaths;
@@ -145,11 +138,11 @@ mod tests {
}
#[tokio::test]
async fn validate_environment_selections_rejects_duplicate_ids() {
async fn resolve_environment_selections_rejects_duplicate_ids() {
let cwd = AbsolutePathBuf::current_dir().expect("cwd");
let manager = EnvironmentManager::default_for_tests();
let err = validate_environment_selections(
let err = resolve_environment_selections(
&manager,
&[
TurnEnvironmentSelection {
+1
View File
@@ -2,6 +2,7 @@ use super::*;
use crate::goals::GoalRuntimeState;
use codex_protocol::permissions::FileSystemPath;
use codex_protocol::permissions::FileSystemSpecialPath;
use codex_protocol::protocol::TurnEnvironmentSelection;
use tokio::sync::Semaphore;
/// Context for an initialized model agent
+2 -2
View File
@@ -5,7 +5,6 @@ use crate::config::Config;
use crate::config::ThreadStoreConfig;
use crate::environment_selection::default_thread_environment_selections;
use crate::environment_selection::resolve_environment_selections;
use crate::environment_selection::validate_environment_selections;
use crate::file_watcher::FileWatcher;
use crate::mcp::McpManager;
use crate::rollout::RolloutRecorder;
@@ -419,7 +418,8 @@ impl ThreadManager {
&self,
environments: &[TurnEnvironmentSelection],
) -> CodexResult<()> {
validate_environment_selections(self.state.environment_manager.as_ref(), environments)
resolve_environment_selections(self.state.environment_manager.as_ref(), environments)
.map(|_| ())
}
pub fn get_models_manager(&self) -> SharedModelsManager {