Verify model-owned skills guidance routing

This commit is contained in:
ani
2026-06-18 09:38:58 -07:00
parent ecb3c7c1d1
commit 77c7b047de
2 changed files with 25 additions and 2 deletions
+3 -1
View File
@@ -460,7 +460,9 @@ pub(crate) const INITIAL_SUBMIT_ID: &str = "";
pub(crate) const SUBMISSION_CHANNEL_CAPACITY: usize = 512;
const CYBER_VERIFY_URL: &str = "https://chatgpt.com/cyber";
const CYBER_SAFETY_URL: &str = "https://developers.openai.com/codex/concepts/cyber-safety";
// Compatibility list for models through GPT-5.5. Newer models own this guidance.
// Snapshot of the models in bundled models.json when skills guidance moved into
// model-owned instructions. Do not add new models here: new slugs should carry
// the guidance in their resolved model instructions.
const MODELS_REQUIRING_LEGACY_SKILLS_INSTRUCTIONS: &[&str] = &[
"gpt-5.5",
"gpt-5.4",
+22 -1
View File
@@ -1654,7 +1654,9 @@ async fn skills_append_to_developer_message() {
}
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn models_outside_legacy_list_omit_legacy_guidance() {
async fn models_outside_legacy_list_use_model_owned_guidance() {
const MODEL_OWNED_SKILLS_GUIDANCE: &str = "model-owned skills guidance";
skip_if_no_network!();
let server = MockServer::start().await;
@@ -1679,6 +1681,19 @@ async fn models_outside_legacy_list_omit_legacy_guidance() {
.with_auth(CodexAuth::from_api_key("Test API Key"))
.with_model_info_override("gpt-5.4", |model_info| {
model_info.slug = "future-model".to_string();
if let Some(instructions_template) = model_info
.model_messages
.as_mut()
.and_then(|messages| messages.instructions_template.as_mut())
{
instructions_template.push_str("\n\n");
instructions_template.push_str(MODEL_OWNED_SKILLS_GUIDANCE);
} else {
model_info.base_instructions.push_str("\n\n");
model_info
.base_instructions
.push_str(MODEL_OWNED_SKILLS_GUIDANCE);
}
})
.with_model("future-model")
.with_config(move |config| {
@@ -1707,6 +1722,12 @@ async fn models_outside_legacy_list_omit_legacy_guidance() {
wait_for_event(&codex, |ev| matches!(ev, EventMsg::TurnComplete(_))).await;
let request = resp_mock.single_request();
assert!(
request
.instructions_text()
.contains(MODEL_OWNED_SKILLS_GUIDANCE),
"expected model-owned skills guidance in the resolved base instructions"
);
let developer_messages = request.message_input_texts("developer");
let developer_text = developer_messages.join("\n\n");
assert!(