Use use_model (#7121)

This commit is contained in:
pakrym-oai
2025-11-21 14:10:52 -08:00
committed by GitHub
parent 3bdcbc7292
commit e52cc38dfd
12 changed files with 68 additions and 149 deletions

View File

@@ -1,7 +1,6 @@
#![allow(clippy::unwrap_used, clippy::expect_used)]
use anyhow::Result;
use codex_core::model_family::find_family_for_model;
use codex_core::protocol::AskForApproval;
use codex_core::protocol::EventMsg;
use codex_core::protocol::Op;
@@ -27,7 +26,7 @@ async fn execpolicy_blocks_shell_invocation() -> Result<()> {
return Ok(());
}
let mut builder = test_codex().with_config(|config| {
let mut builder = test_codex().with_model("gpt-5.1").with_config(|config| {
let policy_path = config.codex_home.join("policy").join("policy.codexpolicy");
fs::create_dir_all(
policy_path
@@ -40,9 +39,6 @@ async fn execpolicy_blocks_shell_invocation() -> Result<()> {
r#"prefix_rule(pattern=["echo"], decision="forbidden")"#,
)
.expect("write policy file");
config.model = "gpt-5.1".to_string();
config.model_family =
find_family_for_model("gpt-5.1").expect("gpt-5.1 should have a model family");
});
let server = start_mock_server().await;
let test = builder.build(&server).await?;