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:
andrea.difonzo
2026-11-10 06:00:44 +01:00
parent 82347a58ed
commit 231e8cd136
661 changed files with 4924 additions and 64817 deletions

View File

@@ -2,11 +2,10 @@ use codex_utils_absolute_path::test_support::PathExt;
use std::time::Duration;
use anyhow::Result;
use app_test_support::ChatGptAuthFixture;
use app_test_support::MockResponsesConfig;
use app_test_support::TestAppServer;
use app_test_support::create_mock_responses_server_repeating_assistant;
use app_test_support::write_chatgpt_auth;
use app_test_support::write_api_key_auth;
#[cfg(unix)]
use codex_app_server_protocol::ConfigReadParams;
#[cfg(unix)]
@@ -45,7 +44,6 @@ use codex_app_server_protocol::TurnStartResponse;
use codex_app_server_protocol::UserInput;
#[cfg(unix)]
use codex_app_server_protocol::WriteStatus;
use codex_config::types::AuthCredentialsStoreMode;
use codex_protocol::MemoryVersion;
use core_test_support::responses;
use pretty_assertions::assert_eq;
@@ -1306,14 +1304,7 @@ async fn external_agent_config_detects_and_imports_project_memory_files(
#[tokio::test]
async fn external_agent_config_import_reports_failed_sync_import_in_completion() -> Result<()> {
let codex_home = TempDir::new()?;
write_chatgpt_auth(
codex_home.path(),
ChatGptAuthFixture::new("chatgpt-token")
.account_id("account-123")
.chatgpt_user_id("user-123")
.chatgpt_account_id("account-123"),
AuthCredentialsStoreMode::File,
)?;
write_api_key_auth(codex_home.path())?;
let source_home = external_agent_home(codex_home.path());
std::fs::create_dir_all(&source_home)?;
std::fs::write(
@@ -1395,14 +1386,7 @@ async fn external_agent_config_import_reports_failed_sync_import_in_completion()
async fn external_agent_config_import_reports_missing_session_in_completion() -> Result<()> {
let codex_home = TempDir::new()?;
std::fs::write(codex_home.path().join("config.toml"), "")?;
write_chatgpt_auth(
codex_home.path(),
ChatGptAuthFixture::new("chatgpt-token")
.account_id("account-123")
.chatgpt_user_id("user-123")
.chatgpt_account_id("account-123"),
AuthCredentialsStoreMode::File,
)?;
write_api_key_auth(codex_home.path())?;
let missing_session_path =
external_agent_home(codex_home.path()).join("projects/repo/missing.jsonl");
@@ -1464,14 +1448,7 @@ async fn external_agent_config_import_reports_missing_session_in_completion() ->
async fn external_agent_config_import_reports_session_config_error_subtype() -> Result<()> {
let codex_home = TempDir::new()?;
std::fs::write(codex_home.path().join("config.toml"), "")?;
write_chatgpt_auth(
codex_home.path(),
ChatGptAuthFixture::new("chatgpt-token")
.account_id("account-123")
.chatgpt_user_id("user-123")
.chatgpt_account_id("account-123"),
AuthCredentialsStoreMode::File,
)?;
write_api_key_auth(codex_home.path())?;
let project_root = codex_home.path().join("repo");
let session_dir = external_agent_home(codex_home.path()).join("projects/repo");
@@ -1549,14 +1526,7 @@ async fn external_agent_config_import_reports_session_config_error_subtype() ->
async fn external_agent_config_import_reinstalls_plugins_from_known_marketplaces() -> Result<()> {
let codex_home = TempDir::new()?;
std::fs::write(codex_home.path().join("config.toml"), "")?;
write_chatgpt_auth(
codex_home.path(),
ChatGptAuthFixture::new("chatgpt-token")
.account_id("account-123")
.chatgpt_user_id("user-123")
.chatgpt_account_id("account-123"),
AuthCredentialsStoreMode::File,
)?;
write_api_key_auth(codex_home.path())?;
let marketplace_root = codex_home.path().join("marketplace");
let plugin_root = marketplace_root.join("plugins").join("sample");
std::fs::create_dir_all(marketplace_root.join(".agents/plugins"))?;