mirror of
https://github.com/openai/codex.git
synced 2026-11-05 20:10:33 +00:00
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:
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user