mirror of
https://github.com/openai/codex.git
synced 2026-04-25 15:15:15 +00:00
## Summary - update documentation, example configs, and automation defaults to reference gpt-5.1 / gpt-5.1-codex - bump the CLI and core configuration defaults, model presets, and error messaging to the new models while keeping the model-family/tool coverage for legacy slugs - refresh tests, fixtures, and TUI snapshots so they expect the upgraded defaults ## Testing - `cargo test -p codex-core config::tests::test_precedence_fixture_with_gpt5_profile` ------ [Codex Task](https://chatgpt.com/codex/tasks/task_i_6916c5b3c2b08321ace04ee38604fc6b)
63 lines
1.9 KiB
Rust
63 lines
1.9 KiB
Rust
#![cfg(not(target_os = "windows"))]
|
|
#![allow(clippy::expect_used, clippy::unwrap_used)]
|
|
|
|
use core_test_support::responses;
|
|
use core_test_support::test_codex_exec::test_codex_exec;
|
|
use serde_json::Value;
|
|
|
|
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
|
async fn exec_includes_output_schema_in_request() -> anyhow::Result<()> {
|
|
let test = test_codex_exec();
|
|
|
|
let schema_contents = serde_json::json!({
|
|
"type": "object",
|
|
"properties": {
|
|
"answer": { "type": "string" }
|
|
},
|
|
"required": ["answer"],
|
|
"additionalProperties": false
|
|
});
|
|
let schema_path = test.cwd_path().join("schema.json");
|
|
std::fs::write(&schema_path, serde_json::to_vec_pretty(&schema_contents)?)?;
|
|
let expected_schema: Value = schema_contents;
|
|
|
|
let server = responses::start_mock_server().await;
|
|
let body = responses::sse(vec![
|
|
responses::ev_response_created("resp1"),
|
|
responses::ev_assistant_message("m1", "fixture hello"),
|
|
responses::ev_completed("resp1"),
|
|
]);
|
|
let response_mock = responses::mount_sse_once(&server, body).await;
|
|
|
|
test.cmd_with_server(&server)
|
|
.arg("--skip-git-repo-check")
|
|
// keep using -C in the test to exercise the flag as well
|
|
.arg("-C")
|
|
.arg(test.cwd_path())
|
|
.arg("--output-schema")
|
|
.arg(&schema_path)
|
|
.arg("-m")
|
|
.arg("gpt-5.1")
|
|
.arg("tell me a joke")
|
|
.assert()
|
|
.success();
|
|
|
|
let request = response_mock.single_request();
|
|
let payload: Value = request.body_json();
|
|
let text = payload.get("text").expect("request missing text field");
|
|
let format = text
|
|
.get("format")
|
|
.expect("request missing text.format field");
|
|
assert_eq!(
|
|
format,
|
|
&serde_json::json!({
|
|
"name": "codex_output_schema",
|
|
"type": "json_schema",
|
|
"strict": true,
|
|
"schema": expected_schema,
|
|
})
|
|
);
|
|
|
|
Ok(())
|
|
}
|