aKode fase 2b-2: rimosso login ChatGPT e tutti i sottosistemi solo-ChatGPT

- Login: resta solo chiave API (+ header, Bedrock). Rimossi OAuth/browser,
  device code, refresh/revoke su auth.openai.com, PAT, agent/workload identity,
  runtime agent instance, backend-client e openapi-models, workspace routing.
- Rimossi: generazione immagini (ext + skill imagegen), history notes, plugin
  remoti (catalogo, sync, share), cyber access program, daybreak, cloud config
  e requirements (config_server ora fail-closed), attestation, frozen cloud
  skills, EMA MCP auth, Codex Apps/connettori, ricerca ospitata, header/zstd/
  routing/cookie del backend Codex, fallback OPENAI_API_KEY del realtime.
- Messaggi d'errore senza link a chatgpt.com.
- Chiavi di config legacy accettate e ignorate; feature rimosse = Stage::Removed.
- Test: cancellati solo quelli del codice rimosso; test di sicurezza
  (sandbox estensioni, permessi, redazione, auth storage, requirements)
  adattati. Restano solo fallimenti d'ambiente (code-mode-host/V8, ~/.agents).
- Istruzioni di sistema invariate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
andrea.difonzo
2026-11-10 16:20:15 +01:00
parent 82347a58ed
commit 6089fbde91
1573 changed files with 10289 additions and 177679 deletions

View File

@@ -116,7 +116,7 @@ async fn child_loads_remote_tool_search_with_thread_provider_headers(
.await;
let mut test = test_codex()
.with_model(REMOTE_MODEL_SLUG)
.with_auth(CodexAuth::create_dummy_chatgpt_auth_for_testing())
.with_catalog_discovery_api_key()
.with_model_catalog_settings(catalog_settings)
.with_config(|config| {
config
@@ -209,7 +209,7 @@ async fn child_preserves_parent_catalog_after_cache_write_failure() -> Result<()
.await;
let mut test = test_codex()
.with_model(REMOTE_MODEL_SLUG)
.with_auth(CodexAuth::create_dummy_chatgpt_auth_for_testing())
.with_catalog_discovery_api_key()
.with_model_catalog_settings(ModelCatalogSettings::with_cache(cache.clone()))
.with_config(|config| {
config
@@ -425,7 +425,7 @@ async fn remote_models_get_model_info_uses_longest_matching_prefix() -> Result<(
let codex_home = TempDir::new()?;
let config = load_default_config_for_test(&codex_home).await;
let auth = CodexAuth::create_dummy_chatgpt_auth_for_testing();
let auth = core_test_support::test_codex::header_auth_for_testing();
let provider = ModelProviderInfo {
base_url: Some(format!("{}/v1", server.uri())),
..built_in_model_providers(/* openai_base_url */ /*openai_base_url*/ None)["openai"].clone()
@@ -485,7 +485,7 @@ async fn remote_models_config_context_window_override_clamps_to_max_context_wind
.await;
let TestCodex { codex, .. } = test_codex()
.with_auth(CodexAuth::create_dummy_chatgpt_auth_for_testing())
.with_header_auth()
.with_config(|config| {
config.model = Some(requested_model.to_string());
config.model_context_window = Some(1_000_000);
@@ -546,7 +546,7 @@ async fn remote_models_config_override_above_max_uses_max_context_window() -> Re
.await;
let TestCodex { codex, .. } = test_codex()
.with_auth(CodexAuth::create_dummy_chatgpt_auth_for_testing())
.with_header_auth()
.with_config(|config| {
config.model = Some(requested_model.to_string());
config.model_context_window = Some(500_000);
@@ -607,7 +607,7 @@ async fn remote_models_use_context_window_when_config_override_is_absent() -> Re
.await;
let TestCodex { codex, .. } = test_codex()
.with_auth(CodexAuth::create_dummy_chatgpt_auth_for_testing())
.with_header_auth()
.with_config(|config| {
config.model = Some(requested_model.to_string());
})
@@ -694,7 +694,7 @@ async fn remote_models_long_model_slug_is_sent_with_supported_reasoning(
.await;
let TestCodex { codex, .. } = test_codex()
.with_auth(CodexAuth::create_dummy_chatgpt_auth_for_testing())
.with_header_auth()
.with_config(|config| {
config.model = Some(requested_model.to_string());
config.developer_instructions = Some(developer_instructions.to_string());
@@ -841,7 +841,6 @@ async fn remote_models_remote_model_uses_unified_exec() -> Result<()> {
additional_speed_tiers: Vec::new(),
service_tiers: Vec::new(),
default_service_tier: None,
available_access_programs: None,
upgrade: None,
model_messages: None,
include_skills_usage_instructions: false,
@@ -878,7 +877,7 @@ async fn remote_models_remote_model_uses_unified_exec() -> Result<()> {
.await;
let mut builder = test_codex()
.with_auth(CodexAuth::create_dummy_chatgpt_auth_for_testing())
.with_catalog_discovery_api_key()
.with_config(|config| {
config.model = Some("gpt-5.4".to_string());
});
@@ -1005,7 +1004,7 @@ async fn remote_models_truncation_policy_without_override_preserves_remote() ->
.await;
let mut builder = test_codex()
.with_auth(CodexAuth::create_dummy_chatgpt_auth_for_testing())
.with_catalog_discovery_api_key()
.with_config(|config| {
config.model = Some("gpt-5.4".to_string());
});
@@ -1051,7 +1050,7 @@ async fn remote_models_truncation_policy_with_tool_output_override() -> Result<(
.await;
let mut builder = test_codex()
.with_auth(CodexAuth::create_dummy_chatgpt_auth_for_testing())
.with_catalog_discovery_api_key()
.with_config(|config| {
config.model = Some("gpt-5.4".to_string());
config.tool_output_token_limit = Some(50);
@@ -1072,7 +1071,6 @@ async fn remote_models_truncation_policy_with_tool_output_override() -> Result<(
Ok(())
}
#[test_case(CodexAuth::create_dummy_chatgpt_auth_for_testing(); "chatgpt")]
#[test_case(CodexAuth::from_api_key("test-api-key"); "api key")]
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn remote_models_apply_legacy_instructions(auth: CodexAuth) -> Result<()> {
@@ -1116,7 +1114,6 @@ async fn remote_models_apply_legacy_instructions(auth: CodexAuth) -> Result<()>
additional_speed_tiers: Vec::new(),
service_tiers: Vec::new(),
default_service_tier: None,
available_access_programs: None,
upgrade: None,
model_messages: Some(ModelMessages {
instructions_template: Some(remote_instructions.to_string()),
@@ -1289,7 +1286,7 @@ async fn remote_models_do_not_append_removed_builtin_presets() -> Result<()> {
let codex_home = TempDir::new()?;
let auth = CodexAuth::create_dummy_chatgpt_auth_for_testing();
let auth = core_test_support::test_codex::header_auth_for_testing();
let provider = ModelProviderInfo {
base_url: Some(format!("{}/v1", server.uri())),
..built_in_model_providers(/* openai_base_url */ /*openai_base_url*/ None)["openai"].clone()
@@ -1355,7 +1352,7 @@ async fn remote_models_merge_adds_new_high_priority_first() -> Result<()> {
let codex_home = TempDir::new()?;
let auth = CodexAuth::create_dummy_chatgpt_auth_for_testing();
let auth = core_test_support::test_codex::header_auth_for_testing();
let provider = ModelProviderInfo {
base_url: Some(format!("{}/v1", server.uri())),
..built_in_model_providers(/* openai_base_url */ /*openai_base_url*/ None)["openai"].clone()
@@ -1407,7 +1404,7 @@ async fn remote_models_merge_replaces_overlapping_model() -> Result<()> {
let codex_home = TempDir::new()?;
let auth = CodexAuth::create_dummy_chatgpt_auth_for_testing();
let auth = core_test_support::test_codex::header_auth_for_testing();
let provider = ModelProviderInfo {
base_url: Some(format!("{}/v1", server.uri())),
..built_in_model_providers(/* openai_base_url */ /*openai_base_url*/ None)["openai"].clone()
@@ -1456,7 +1453,7 @@ async fn remote_models_merge_preserves_bundled_models_on_empty_response() -> Res
let codex_home = TempDir::new()?;
let auth = CodexAuth::create_dummy_chatgpt_auth_for_testing();
let auth = core_test_support::test_codex::header_auth_for_testing();
let provider = ModelProviderInfo {
base_url: Some(format!("{}/v1", server.uri())),
..built_in_model_providers(/* openai_base_url */ /*openai_base_url*/ None)["openai"].clone()
@@ -1503,7 +1500,7 @@ async fn remote_models_request_times_out_after_5s() -> Result<()> {
let codex_home = TempDir::new()?;
let auth = CodexAuth::create_dummy_chatgpt_auth_for_testing();
let auth = core_test_support::test_codex::header_auth_for_testing();
let provider = ModelProviderInfo {
base_url: Some(format!("{}/v1", server.uri())),
..built_in_model_providers(/* openai_base_url */ /*openai_base_url*/ None)["openai"].clone()
@@ -1578,7 +1575,7 @@ async fn remote_models_hide_picker_only_models() -> Result<()> {
let codex_home = TempDir::new()?;
let auth = CodexAuth::create_dummy_chatgpt_auth_for_testing();
let auth = core_test_support::test_codex::header_auth_for_testing();
let provider = ModelProviderInfo {
base_url: Some(format!("{}/v1", server.uri())),
..built_in_model_providers(/* openai_base_url */ /*openai_base_url*/ None)["openai"].clone()
@@ -1705,7 +1702,6 @@ fn test_remote_model_with_policy(
additional_speed_tiers: Vec::new(),
service_tiers: Vec::new(),
default_service_tier: None,
available_access_programs: None,
upgrade: None,
model_messages: None,
include_skills_usage_instructions: false,