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

@@ -1,5 +1,5 @@
use codex_core::config::ConfigBuilder;
use codex_core::plugins_manager_for_config_with_runtime;
use codex_core::plugins_manager_for_config;
use codex_core_plugins::PluginInstallError;
use codex_core_plugins::PluginInstallRequest;
use codex_core_plugins::marketplace::MarketplaceError;
@@ -105,10 +105,7 @@ impl ExternalAgentConfigService {
.map_err(|err| io::Error::other(format!("failed to load config: {err}")))?;
let requirements = config.config_layer_stack.requirements().clone();
let mut outcome = PluginImportOutcome::default();
let plugins_manager =
plugins_manager_for_config_with_runtime(&config, Arc::clone(&self.auth_manager))
.await
.map_err(io::Error::other)?;
let plugins_manager = plugins_manager_for_config(&config, Arc::clone(&self.auth_manager));
let configured_marketplace_paths = plugins_manager
.list_marketplaces_for_config(
&config.plugins_config_input(),

View File

@@ -1,98 +1,8 @@
use super::super::*;
use crate::migration_source::MarketplaceImportSource;
use crate::source_cla;
use codex_login::AuthManager;
use codex_login::CodexAuth;
use pretty_assertions::assert_eq;
#[tokio::test]
async fn authenticated_plugin_migration_uses_chatgpt_curated_marketplace() {
let (_root, external_agent_home, codex_home) = fixture_paths();
let curated_root = codex_home.join(".tmp/plugins");
let plugin_root = curated_root.join("plugins/sample");
fs::create_dir_all(&external_agent_home).expect("create external agent home");
fs::create_dir_all(curated_root.join(".agents/plugins"))
.expect("create curated marketplace directory");
fs::create_dir_all(plugin_root.join(".codex-plugin")).expect("create curated plugin directory");
fs::write(
external_agent_home.join("settings.json"),
r#"{"enabledPlugins":{"sample@openai-curated":true}}"#,
)
.expect("write external agent settings");
fs::write(
codex_home.join("config.toml"),
"[features]\nplugins = true\n",
)
.expect("write Codex config");
fs::write(
codex_home.join(".tmp/plugins.sha"),
"0123456789abcdef0123456789abcdef01234567\n",
)
.expect("write curated plugin version");
fs::write(
curated_root.join(".agents/plugins/marketplace.json"),
r#"{
"name": "openai-curated",
"plugins": [{
"name": "sample",
"source": {"source": "local", "path": "./plugins/sample"}
}]
}"#,
)
.expect("write curated marketplace");
fs::write(
plugin_root.join(".codex-plugin/plugin.json"),
r#"{"name":"sample","version":"0.1.0"}"#,
)
.expect("write curated plugin manifest");
let mut service = service_for_paths(external_agent_home.clone(), codex_home);
service.auth_manager =
AuthManager::from_auth_for_testing(CodexAuth::create_dummy_chatgpt_auth_for_testing());
let items = service
.detect(ExternalAgentConfigDetectOptions {
include_home: true,
include_memory: false,
cwds: None,
})
.await
.expect("detect authenticated curated plugin");
let details = Some(MigrationDetails {
plugins: vec![PluginsMigration {
marketplace_name: "openai-curated".to_string(),
plugin_names: vec!["sample".to_string()],
}],
..Default::default()
});
assert_eq!(
items,
vec![ExternalAgentConfigMigrationItem {
item_type: ExternalAgentConfigMigrationItemType::Plugins,
description: format!(
"Migrate enabled plugins from {}",
external_agent_home.join("settings.json").display()
),
cwd: None,
details: details.clone(),
}]
);
let outcome = service
.import_plugins(/*cwd*/ None, details)
.await
.expect("import authenticated curated plugin");
assert_eq!(
outcome,
PluginImportOutcome {
succeeded_marketplaces: vec!["openai-curated".to_string()],
succeeded_plugin_ids: vec!["sample@openai-curated".to_string()],
failed_marketplaces: Vec::new(),
failed_plugin_ids: Vec::new(),
raw_errors: Vec::new(),
}
);
}
#[tokio::test]
async fn detect_home_lists_enabled_plugins_from_settings() {
let (_root, external_agent_home, codex_home) = fixture_paths();