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

@@ -8,7 +8,6 @@ use std::borrow::Cow;
use std::collections::HashMap;
use std::fmt;
use std::io;
use std::sync::Arc;
use std::sync::Mutex;
use std::sync::OnceLock;
use std::time::Duration;
@@ -16,10 +15,7 @@ use std::time::Instant;
#[cfg(any(target_os = "windows", target_os = "macos"))]
use tokio::sync::Semaphore;
use http::HeaderValue;
use crate::NetworkPolicy;
use crate::chatgpt_cloudflare_cookies::ChatGptCookieStore;
use crate::custom_ca::BuildCustomCaTransportError;
use crate::custom_ca::build_reqwest_client_with_custom_ca;
use sha2::Digest;
@@ -168,7 +164,6 @@ pub struct HttpClientFactory {
outbound_proxy_policy: OutboundProxyPolicy,
system_proxy_fallback: bool,
protect_sensitive_headers: bool,
chatgpt_cookie_store: Option<Arc<ChatGptCookieStore>>,
network_policy: NetworkPolicy,
}
@@ -178,14 +173,6 @@ impl PartialEq for HttpClientFactory {
&& self.system_proxy_fallback == other.system_proxy_fallback
&& self.protect_sensitive_headers == other.protect_sensitive_headers
&& self.network_policy == other.network_policy
&& self
.chatgpt_cookie_store
.as_ref()
.map(|store| store.configured_cookies())
== other
.chatgpt_cookie_store
.as_ref()
.map(|store| store.configured_cookies())
}
}
@@ -209,7 +196,6 @@ impl HttpClientFactory {
outbound_proxy_policy,
system_proxy_fallback: false,
protect_sensitive_headers: false,
chatgpt_cookie_store: None,
network_policy: NetworkPolicy::unmanaged(),
}
}
@@ -236,7 +222,7 @@ impl HttpClientFactory {
&self.network_policy
}
/// Changes the route policy while retaining the configured cookies and network policy.
/// Changes the route policy while retaining the network policy.
pub fn with_outbound_proxy_policy(mut self, policy: OutboundProxyPolicy) -> Self {
self.outbound_proxy_policy = policy;
self
@@ -254,23 +240,6 @@ impl HttpClientFactory {
&& self.outbound_proxy_policy == OutboundProxyPolicy::ReqwestDefault
}
/// Adds process-scoped cookies to requests made by ChatGPT cookie-store clients.
pub fn with_chatgpt_cookies(mut self, cookies: impl IntoIterator<Item = HeaderValue>) -> Self {
let cookies = cookies.into_iter().collect::<Vec<_>>();
self.chatgpt_cookie_store =
(!cookies.is_empty()).then(|| Arc::new(ChatGptCookieStore::new(cookies)));
self
}
/// Returns whether ChatGPT cookie-store clients have additional configured cookies.
pub fn has_chatgpt_cookies(&self) -> bool {
self.chatgpt_cookie_store.is_some()
}
pub(crate) fn chatgpt_cookie_store(&self) -> Option<Arc<ChatGptCookieStore>> {
self.chatgpt_cookie_store.clone()
}
/// Returns the outbound proxy policy used for clients built by this factory.
pub const fn outbound_proxy_policy(&self) -> OutboundProxyPolicy {
self.outbound_proxy_policy