Send text parameter for non-gpt-5 models (#4195)

We had a hardcoded check for gpt-5 before.

Fixes: https://github.com/openai/codex/issues/4181
This commit is contained in:
pakrym-oai
2025-09-24 15:00:06 -07:00
committed by GitHub
parent 87b299aa3f
commit e85742635f
3 changed files with 25 additions and 12 deletions

View File

@@ -30,7 +30,16 @@ const SCHEMA: &str = r#"
"#;
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn codex_returns_json_result() -> anyhow::Result<()> {
async fn codex_returns_json_result_for_gpt5() -> anyhow::Result<()> {
codex_returns_json_result("gpt-5".to_string()).await
}
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn codex_returns_json_result_for_gpt5_codex() -> anyhow::Result<()> {
codex_returns_json_result("gpt-5-codex".to_string()).await
}
async fn codex_returns_json_result(model: String) -> anyhow::Result<()> {
non_sandbox_test!(result);
let server = start_mock_server().await;
@@ -72,7 +81,7 @@ async fn codex_returns_json_result() -> anyhow::Result<()> {
cwd: cwd.path().to_path_buf(),
approval_policy: AskForApproval::Never,
sandbox_policy: SandboxPolicy::DangerFullAccess,
model: "gpt-5".to_string(),
model,
effort: None,
summary: ReasoningSummary::Auto,
})