[codex] allow image generation with provider auth

This commit is contained in:
Richard Lee
2026-06-22 20:13:36 -07:00
parent 27f22b54ae
commit 0f79bd22ce
2 changed files with 15 additions and 4 deletions
+5 -4
View File
@@ -383,10 +383,11 @@ fn image_generation_tool_enabled(turn_context: &TurnContext) -> bool {
}
fn image_generation_runtime_enabled(turn_context: &TurnContext) -> bool {
turn_context
.auth_manager
.as_deref()
.is_some_and(AuthManager::current_auth_uses_codex_backend)
(!turn_context.config.model_provider.requires_openai_auth
|| turn_context
.auth_manager
.as_deref()
.is_some_and(AuthManager::current_auth_uses_codex_backend))
&& turn_context.provider.capabilities().image_generation
&& turn_context
.model_info
@@ -1414,6 +1414,16 @@ async fn hosted_tools_follow_provider_auth_model_and_config_gates() {
.await;
api_key_auth.assert_visible_lacks(&["image_generation"]);
let provider_authenticated = probe(|turn| {
set_feature(turn, Feature::ImageGeneration, /*enabled*/ true);
update_config(turn, |config| {
config.model_provider.requires_openai_auth = false;
});
turn.model_info.input_modalities = vec![InputModality::Image];
})
.await;
provider_authenticated.assert_visible_contains(&["image_generation"]);
let image_generation = probe(|turn| {
use_chatgpt_auth(turn);
set_feature(turn, Feature::ImageGeneration, /*enabled*/ true);