Compare commits

...

2 Commits

Author SHA1 Message Date
Ahmed Ibrahim
f77f166fc0 codex: fix CI failure on PR #15512
Use the synchronous test_config helper in the new beta header tests.

Co-authored-by: Codex <noreply@openai.com>
2026-03-23 09:01:05 -07:00
Ahmed Ibrahim
36b88b11d2 Disable image generation via header
Send disable_img_gen when the image generation feature is off, and cover the beta header behavior in tests.

Co-authored-by: Codex <noreply@openai.com>
2026-03-23 08:44:14 -07:00
2 changed files with 31 additions and 3 deletions

View File

@@ -1158,7 +1158,7 @@ impl Session {
/// we precompute the comma-separated list of enabled experimental feature keys at session
/// creation time and thread it into the client.
fn build_model_client_beta_features_header(config: &Config) -> Option<String> {
let beta_features_header = FEATURES
let mut beta_features = FEATURES
.iter()
.filter_map(|spec| {
if spec.stage.experimental_menu_description().is_some()
@@ -1169,8 +1169,13 @@ impl Session {
None
}
})
.collect::<Vec<_>>()
.join(",");
.collect::<Vec<_>>();
if !config.features.enabled(Feature::ImageGeneration) {
beta_features.push("disable_img_gen");
}
let beta_features_header = beta_features.join(",");
if beta_features_header.is_empty() {
None

View File

@@ -15,6 +15,7 @@ use crate::models_manager::model_info;
use crate::shell::default_user_shell;
use crate::tools::format_exec_output_str;
use codex_features::Feature;
use codex_features::Features;
use codex_protocol::ThreadId;
use codex_protocol::models::FunctionCallOutputBody;
@@ -144,6 +145,28 @@ fn assistant_message(text: &str) -> ResponseItem {
}
}
#[test]
fn beta_features_header_disables_image_generation_when_feature_is_off() {
let config = test_config();
assert_eq!(
Session::build_model_client_beta_features_header(&config),
Some("disable_img_gen".to_string())
);
}
#[test]
fn beta_features_header_uses_image_generation_feature_key_when_enabled() {
let mut config = test_config();
config.features.enable(Feature::ImageGeneration);
let header = Session::build_model_client_beta_features_header(&config)
.expect("image generation should produce a beta features header");
assert!(header.split(',').any(|value| value == "image_generation"));
assert!(!header.split(',').any(|value| value == "disable_img_gen"));
}
fn skill_message(text: &str) -> ResponseItem {
ResponseItem::Message {
id: None,