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:
@@ -7,7 +7,6 @@ use std::path::PathBuf;
|
||||
use std::process::Stdio;
|
||||
|
||||
use anyhow::Context as _;
|
||||
use codex_config::CloudConfigBundleLoader;
|
||||
use codex_config::LoaderOverrides;
|
||||
use codex_core::config::Config;
|
||||
use codex_core::config::ConfigBuilder;
|
||||
@@ -666,7 +665,6 @@ async fn load_debug_sandbox_config(
|
||||
codex_linux_sandbox_exe,
|
||||
options,
|
||||
/*codex_home*/ None,
|
||||
CloudConfigBundleLoader::default(),
|
||||
strict_config,
|
||||
)
|
||||
.await
|
||||
@@ -677,7 +675,6 @@ async fn load_debug_sandbox_config_with_codex_home(
|
||||
codex_linux_sandbox_exe: Option<PathBuf>,
|
||||
options: DebugSandboxConfigOptions,
|
||||
codex_home: Option<PathBuf>,
|
||||
cloud_config_bundle: CloudConfigBundleLoader,
|
||||
strict_config: bool,
|
||||
) -> anyhow::Result<Config> {
|
||||
let DebugSandboxConfigOptions {
|
||||
@@ -711,7 +708,6 @@ async fn load_debug_sandbox_config_with_codex_home(
|
||||
codex_home.clone(),
|
||||
managed_requirements_mode,
|
||||
loader_overrides.clone(),
|
||||
cloud_config_bundle.clone(),
|
||||
strict_config,
|
||||
)
|
||||
.await?;
|
||||
@@ -731,7 +727,6 @@ async fn load_debug_sandbox_config_with_codex_home(
|
||||
codex_home,
|
||||
managed_requirements_mode,
|
||||
loader_overrides,
|
||||
cloud_config_bundle,
|
||||
strict_config,
|
||||
)
|
||||
.await
|
||||
@@ -744,13 +739,11 @@ async fn build_debug_sandbox_config_with_loader_overrides(
|
||||
codex_home: Option<PathBuf>,
|
||||
managed_requirements_mode: ManagedRequirementsMode,
|
||||
mut loader_overrides: LoaderOverrides,
|
||||
cloud_config_bundle: CloudConfigBundleLoader,
|
||||
strict_config: bool,
|
||||
) -> std::io::Result<Config> {
|
||||
let mut builder = ConfigBuilder::default()
|
||||
.cli_overrides(cli_overrides)
|
||||
.harness_overrides(harness_overrides)
|
||||
.cloud_config_bundle(cloud_config_bundle)
|
||||
.strict_config(strict_config);
|
||||
if matches!(managed_requirements_mode, ManagedRequirementsMode::Ignore) {
|
||||
loader_overrides.ignore_managed_requirements = true;
|
||||
@@ -782,20 +775,20 @@ fn cli_overrides_use_legacy_sandbox_mode(cli_overrides: &[(String, TomlValue)])
|
||||
mod tests {
|
||||
use super::*;
|
||||
use codex_config::ConfigRequirementsToml;
|
||||
use codex_config::test_support::CloudConfigBundleFixture;
|
||||
use codex_config::test_support::ManagedConfigFixture;
|
||||
use pretty_assertions::assert_eq;
|
||||
use tempfile::TempDir;
|
||||
|
||||
const CLOUD_MANAGED_PERMISSION_PROFILE_REQUIREMENTS: &str = r#"
|
||||
default_permissions = "managed-cloud"
|
||||
const MANAGED_PERMISSION_PROFILE_REQUIREMENTS: &str = r#"
|
||||
default_permissions = "managed-profile"
|
||||
|
||||
[allowed_permission_profiles]
|
||||
managed-cloud = true
|
||||
managed-profile = true
|
||||
|
||||
[permissions.managed-cloud]
|
||||
[permissions.managed-profile]
|
||||
extends = ":workspace"
|
||||
|
||||
[permissions.managed-cloud.network]
|
||||
[permissions.managed-profile.network]
|
||||
enabled = true
|
||||
"#;
|
||||
|
||||
@@ -812,7 +805,6 @@ enabled = true
|
||||
codex_home,
|
||||
managed_requirements_mode,
|
||||
LoaderOverrides::default(),
|
||||
CloudConfigBundleLoader::default(),
|
||||
strict_config,
|
||||
)
|
||||
.await
|
||||
@@ -896,7 +888,6 @@ enabled = true
|
||||
loader_overrides: LoaderOverrides::default(),
|
||||
},
|
||||
Some(codex_home_path),
|
||||
CloudConfigBundleLoader::default(),
|
||||
/*strict_config*/ false,
|
||||
)
|
||||
.await?;
|
||||
@@ -940,7 +931,6 @@ enabled = true
|
||||
Some(codex_home_path.clone()),
|
||||
ManagedRequirementsMode::Include,
|
||||
loader_overrides.clone(),
|
||||
CloudConfigBundleLoader::default(),
|
||||
/*strict_config*/ false,
|
||||
)
|
||||
.await?;
|
||||
@@ -967,7 +957,6 @@ enabled = true
|
||||
loader_overrides,
|
||||
},
|
||||
Some(codex_home_path),
|
||||
CloudConfigBundleLoader::default(),
|
||||
/*strict_config*/ false,
|
||||
)
|
||||
.await?;
|
||||
@@ -1026,7 +1015,6 @@ enabled = true
|
||||
loader_overrides: LoaderOverrides::default(),
|
||||
},
|
||||
Some(codex_home_path),
|
||||
CloudConfigBundleLoader::default(),
|
||||
/*strict_config*/ false,
|
||||
)
|
||||
.await?;
|
||||
@@ -1086,7 +1074,6 @@ enabled = true
|
||||
loader_overrides: LoaderOverrides::default(),
|
||||
},
|
||||
Some(codex_home_path),
|
||||
CloudConfigBundleLoader::default(),
|
||||
/*strict_config*/ false,
|
||||
)
|
||||
.await?;
|
||||
@@ -1115,7 +1102,6 @@ enabled = true
|
||||
loader_overrides: LoaderOverrides::default(),
|
||||
},
|
||||
Some(codex_home.path().to_path_buf()),
|
||||
CloudConfigBundleLoader::default(),
|
||||
/*strict_config*/ false,
|
||||
)
|
||||
.await?;
|
||||
@@ -1138,7 +1124,7 @@ enabled = true
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn debug_sandbox_honors_explicit_cloud_managed_permission_profile() -> anyhow::Result<()>
|
||||
async fn debug_sandbox_honors_explicit_managed_permission_profile() -> anyhow::Result<()>
|
||||
{
|
||||
let codex_home = TempDir::new()?;
|
||||
|
||||
@@ -1147,15 +1133,15 @@ enabled = true
|
||||
/*codex_linux_sandbox_exe*/ None,
|
||||
DebugSandboxConfigOptions {
|
||||
sandbox_state: Default::default(),
|
||||
permissions_profile: Some("managed-cloud".to_string()),
|
||||
permissions_profile: Some("managed-profile".to_string()),
|
||||
cwd: None,
|
||||
managed_requirements_mode: ManagedRequirementsMode::Include,
|
||||
loader_overrides: LoaderOverrides::without_managed_config_for_tests(),
|
||||
loader_overrides: ManagedConfigFixture::requirements(
|
||||
MANAGED_PERMISSION_PROFILE_REQUIREMENTS,
|
||||
)
|
||||
.loader_overrides_for_tests(codex_home.path())?,
|
||||
},
|
||||
Some(codex_home.path().to_path_buf()),
|
||||
CloudConfigBundleFixture::loader_with_enterprise_requirement(
|
||||
CLOUD_MANAGED_PERMISSION_PROFILE_REQUIREMENTS,
|
||||
),
|
||||
/*strict_config*/ false,
|
||||
)
|
||||
.await?;
|
||||
@@ -1165,7 +1151,7 @@ enabled = true
|
||||
.permissions
|
||||
.active_permission_profile()
|
||||
.map(|profile| profile.id),
|
||||
Some("managed-cloud".to_string()),
|
||||
Some("managed-profile".to_string()),
|
||||
);
|
||||
assert_eq!(
|
||||
config.permissions.network_sandbox_policy(),
|
||||
@@ -1174,7 +1160,7 @@ enabled = true
|
||||
assert_eq!(
|
||||
config.config_layer_stack.requirements_toml(),
|
||||
&toml::from_str::<ConfigRequirementsToml>(
|
||||
CLOUD_MANAGED_PERMISSION_PROFILE_REQUIREMENTS,
|
||||
MANAGED_PERMISSION_PROFILE_REQUIREMENTS,
|
||||
)?,
|
||||
);
|
||||
|
||||
@@ -1182,7 +1168,7 @@ enabled = true
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn debug_sandbox_ignores_cloud_managed_permission_profiles_by_default()
|
||||
async fn debug_sandbox_ignores_managed_permission_profiles_by_default()
|
||||
-> anyhow::Result<()> {
|
||||
let codex_home = TempDir::new()?;
|
||||
|
||||
@@ -1194,12 +1180,12 @@ enabled = true
|
||||
permissions_profile: Some(":workspace".to_string()),
|
||||
cwd: None,
|
||||
managed_requirements_mode: ManagedRequirementsMode::Ignore,
|
||||
loader_overrides: LoaderOverrides::without_managed_config_for_tests(),
|
||||
loader_overrides: ManagedConfigFixture::requirements(
|
||||
MANAGED_PERMISSION_PROFILE_REQUIREMENTS,
|
||||
)
|
||||
.loader_overrides_for_tests(codex_home.path())?,
|
||||
},
|
||||
Some(codex_home.path().to_path_buf()),
|
||||
CloudConfigBundleFixture::loader_with_enterprise_requirement(
|
||||
CLOUD_MANAGED_PERMISSION_PROFILE_REQUIREMENTS,
|
||||
),
|
||||
/*strict_config*/ false,
|
||||
)
|
||||
.await?;
|
||||
@@ -1242,7 +1228,6 @@ enabled = true
|
||||
loader_overrides: LoaderOverrides::default(),
|
||||
},
|
||||
Some(codex_home.path().to_path_buf()),
|
||||
CloudConfigBundleLoader::default(),
|
||||
/*strict_config*/ false,
|
||||
)
|
||||
.await?;
|
||||
@@ -1283,7 +1268,6 @@ enabled = true
|
||||
loader_overrides: LoaderOverrides::default(),
|
||||
},
|
||||
Some(codex_home.path().to_path_buf()),
|
||||
CloudConfigBundleLoader::default(),
|
||||
/*strict_config*/ false,
|
||||
)
|
||||
.await?;
|
||||
|
||||
Reference in New Issue
Block a user