WIP fase 2b-2: rimosso login ChatGPT/OAuth/device code, agent/workload identity, backend-client; resta solo chiave API (test non tutti verdi)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -424,7 +424,7 @@ async fn gif_generation_preserves_animation_and_replays_a_still_preview() -> Res
|
||||
.mount(&server)
|
||||
.await;
|
||||
|
||||
let auth = CodexAuth::create_dummy_chatgpt_auth_for_testing();
|
||||
let auth = CodexAuth::from_api_key("Test API Key");
|
||||
let mut extensions = ExtensionRegistryBuilder::<Config>::new();
|
||||
install_image_generation_extension(
|
||||
&mut extensions,
|
||||
@@ -1016,7 +1016,7 @@ async fn astra_asks_an_async_question_and_receives_the_answer_while_working() ->
|
||||
let base_url = format!("{}/v1", streaming.uri());
|
||||
let test = test_codex()
|
||||
.with_model("gpt-6-astra")
|
||||
.with_auth(CodexAuth::create_dummy_chatgpt_auth_for_testing())
|
||||
.with_auth(CodexAuth::from_api_key("Test API Key"))
|
||||
.with_config(move |config| {
|
||||
configure_scenario_catalog(config);
|
||||
config
|
||||
@@ -1151,7 +1151,7 @@ async fn astra_switches_environments_for_the_rest_of_the_active_turn() -> Result
|
||||
.await;
|
||||
let test = test_codex()
|
||||
.with_model("gpt-6-astra")
|
||||
.with_auth(CodexAuth::create_dummy_chatgpt_auth_for_testing())
|
||||
.with_auth(CodexAuth::from_api_key("Test API Key"))
|
||||
.with_config(|config| {
|
||||
configure_scenario_catalog(config);
|
||||
config.workspace_roots = vec![config.cwd.clone()];
|
||||
@@ -1274,7 +1274,7 @@ async fn astra_kickoff_with_skills_plugins_and_remote_compaction() -> Result<()>
|
||||
let mut builder = test_codex()
|
||||
.with_model("gpt-6-astra")
|
||||
.with_home(home)
|
||||
.with_auth(CodexAuth::create_dummy_chatgpt_auth_for_testing())
|
||||
.with_auth(CodexAuth::from_api_key("Test API Key"))
|
||||
.with_extensions(skills_extensions())
|
||||
.with_workspace_setup(|cwd, fs| async move {
|
||||
fs.write_file(
|
||||
@@ -1408,7 +1408,7 @@ enabled = true
|
||||
let test = test_codex()
|
||||
.with_model("gpt-6-astra")
|
||||
.with_home(home)
|
||||
.with_auth(CodexAuth::create_dummy_chatgpt_auth_for_testing())
|
||||
.with_auth(CodexAuth::from_api_key("Test API Key"))
|
||||
.with_extensions(skills_extensions())
|
||||
.with_config(move |config| {
|
||||
configure_scenario_catalog(config);
|
||||
@@ -1574,7 +1574,7 @@ async fn astra_omits_disabled_executor_and_plugin_skills_from_model_context(
|
||||
.await;
|
||||
let test = test_codex()
|
||||
.with_model("gpt-6-astra")
|
||||
.with_auth(CodexAuth::create_dummy_chatgpt_auth_for_testing())
|
||||
.with_auth(CodexAuth::from_api_key("Test API Key"))
|
||||
.with_extensions(Arc::new(extensions.build()))
|
||||
.with_config(configure_scenario_catalog)
|
||||
.build(&server)
|
||||
@@ -2095,7 +2095,7 @@ async fn skill_read_recovers_omitted_installation_and_reads_selected_environment
|
||||
.await;
|
||||
let test = test_codex()
|
||||
.with_model("gpt-6-astra")
|
||||
.with_auth(CodexAuth::create_dummy_chatgpt_auth_for_testing())
|
||||
.with_auth(CodexAuth::from_api_key("Test API Key"))
|
||||
// Start without a local attachment so Cloud skills remain available.
|
||||
.with_exec_server_url("none")
|
||||
.with_extensions(Arc::new(extensions.build()))
|
||||
@@ -2278,7 +2278,7 @@ async fn astra_settings_release_check_with_direct_and_code_mode_tools() -> Resul
|
||||
let mut builder = test_codex()
|
||||
.with_model("gpt-6-astra")
|
||||
.with_home(home)
|
||||
.with_auth(CodexAuth::create_dummy_chatgpt_auth_for_testing())
|
||||
.with_auth(CodexAuth::from_api_key("Test API Key"))
|
||||
.with_config(move |config| {
|
||||
configure_scenario_catalog(config);
|
||||
let mut servers = config.mcp_servers.get().clone();
|
||||
@@ -2501,7 +2501,7 @@ async fn astra_continues_after_a_stream_is_interrupted() -> Result<()> {
|
||||
let base_url = format!("{}/v1", streaming.uri());
|
||||
let test = test_codex()
|
||||
.with_model("gpt-6-astra")
|
||||
.with_auth(CodexAuth::create_dummy_chatgpt_auth_for_testing())
|
||||
.with_auth(CodexAuth::from_api_key("Test API Key"))
|
||||
.with_config(move |config| {
|
||||
configure_scenario_catalog(config);
|
||||
config.model_provider.base_url = Some(base_url);
|
||||
@@ -2718,7 +2718,7 @@ async fn code_mode_catalog_messages(ranked_search: bool) -> Result<()> {
|
||||
core_test_support::apps_test_server::AppsTestServer::mount_searchable(&server).await?;
|
||||
let test = test_codex()
|
||||
.with_model("gpt-6-astra")
|
||||
.with_auth(CodexAuth::create_dummy_chatgpt_auth_for_testing())
|
||||
.with_auth(CodexAuth::from_api_key("Test API Key"))
|
||||
.with_config(move |config| {
|
||||
configure_scenario_catalog(config);
|
||||
config.chatgpt_base_url = apps.chatgpt_base_url;
|
||||
@@ -2913,7 +2913,7 @@ async fn astra_refreshes_plugin_tools_and_skills_in_an_existing_thread(
|
||||
let mut builder = test_codex()
|
||||
.with_model("gpt-6-astra")
|
||||
.with_home(Arc::clone(&home))
|
||||
.with_auth(CodexAuth::create_dummy_chatgpt_auth_for_testing())
|
||||
.with_auth(CodexAuth::from_api_key("Test API Key"))
|
||||
.with_extensions(skills_extensions())
|
||||
.with_config(configure_scenario_catalog);
|
||||
let test = builder.build(&server).await?;
|
||||
@@ -3597,7 +3597,7 @@ async fn async_compaction_test(
|
||||
let config_server = start_mock_server().await;
|
||||
let base_url = format!("{responses_uri}/v1");
|
||||
let test = builder
|
||||
.with_auth(CodexAuth::create_dummy_chatgpt_auth_for_testing())
|
||||
.with_auth(CodexAuth::from_api_key("Test API Key"))
|
||||
.with_config(move |config| {
|
||||
configure_scenario_catalog(config);
|
||||
config.model_provider.base_url = Some(base_url);
|
||||
@@ -3655,7 +3655,7 @@ async fn async_compaction_image_checks_do_not_block_turn_completion() -> Result<
|
||||
let config_server = start_mock_server().await;
|
||||
let base_url = format!("{}/v1", streaming.uri());
|
||||
let test = test_codex()
|
||||
.with_auth(CodexAuth::create_dummy_chatgpt_auth_for_testing())
|
||||
.with_auth(CodexAuth::from_api_key("Test API Key"))
|
||||
.with_image_store(image_store.clone())
|
||||
.with_config(move |config| {
|
||||
configure_scenario_catalog(config);
|
||||
@@ -4498,14 +4498,10 @@ async fn async_compaction_reuses_pending_work(
|
||||
}
|
||||
if outcome == PendingCompactionOutcome::StaleSuccess {
|
||||
let auth = test.thread_manager.auth_manager();
|
||||
let mut tokens = auth.auth_cached().expect("test auth").get_token_data()?;
|
||||
tokens.id_token.raw_jwt = "e30.e30.signature".to_string();
|
||||
tokens.account_id = Some("second-account".to_string());
|
||||
tokens.access_token = "second-account-token".to_string();
|
||||
std::fs::write(
|
||||
test.home.path().join("auth.json"),
|
||||
serde_json::to_vec(
|
||||
&json!({"auth_mode":"chatgpt", "tokens":tokens, "last_refresh":chrono::Utc::now()}),
|
||||
&json!({"auth_mode":"apikey", "OPENAI_API_KEY":"second-account-token"}),
|
||||
)?,
|
||||
)?;
|
||||
auth.reload().await;
|
||||
@@ -4702,7 +4698,7 @@ async fn catalog_plugin_guidance_follows_model_and_survives_resume() -> Result<(
|
||||
let mut builder = test_codex()
|
||||
.with_model("plugins-default")
|
||||
.with_home(home)
|
||||
.with_auth(CodexAuth::create_dummy_chatgpt_auth_for_testing())
|
||||
.with_auth(CodexAuth::from_api_key("Test API Key"))
|
||||
.with_extensions(skills_extensions())
|
||||
.with_config(configure);
|
||||
let test = builder.build_with_auto_env(&server).await?;
|
||||
@@ -4905,7 +4901,7 @@ async fn catalog_selected_plugin_wording_preserves_capability_policy(
|
||||
let test = test_codex()
|
||||
.with_model("selected-custom")
|
||||
.with_home(home)
|
||||
.with_auth(CodexAuth::create_dummy_chatgpt_auth_for_testing())
|
||||
.with_auth(CodexAuth::from_api_key("Test API Key"))
|
||||
.with_extensions(skills_extensions())
|
||||
.with_config(move |config| {
|
||||
configure_catalog_plugin_scenario(config);
|
||||
@@ -5100,7 +5096,7 @@ async fn catalog_selected_plugin_omission_bounds_runtime_capabilities() -> Resul
|
||||
let test = test_codex()
|
||||
.with_model("gpt-5.5")
|
||||
.with_home(home)
|
||||
.with_auth(CodexAuth::create_dummy_chatgpt_auth_for_testing())
|
||||
.with_auth(CodexAuth::from_api_key("Test API Key"))
|
||||
.with_extensions(skills_extensions())
|
||||
.with_config(move |config| {
|
||||
configure_catalog_plugin_scenario(config);
|
||||
|
||||
Reference in New Issue
Block a user