mirror of
https://github.com/openai/codex.git
synced 2026-11-26 23:40:43 +00:00
[codex] allow image generation with provider auth
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user