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,9 +8,9 @@ use codex_core::InheritedSessionId;
use codex_core::ThreadManager;
use codex_core::TurnInputRequest;
use codex_core::TurnStartOptions;
use codex_core::X_CODEX_ROUTING_HINT_HEADER;
/// No request may carry the hosted backend routing hint.
const X_CODEX_ROUTING_HINT_HEADER: &str = "x-codex-routing-hint";
use codex_features::Feature;
use codex_login::CodexAuth;
use codex_protocol::ThreadId;
use codex_protocol::config_types::ServiceTier;
use codex_protocol::dynamic_tools::DynamicToolFunctionSpec;
@@ -97,7 +97,7 @@ async fn spawned_agent_prewarm_handshake_inherits_effective_root_service_tier(
};
let test = test_codex()
.with_model("gpt-5.4")
.with_auth(CodexAuth::create_dummy_chatgpt_auth_for_testing())
.with_catalog_discovery_api_key()
.with_model_info_override("gpt-5.4", move |model| {
model.service_tiers.push(ModelServiceTier {
id: tier.to_string(),
@@ -157,15 +157,7 @@ async fn spawned_agent_prewarm_handshake_inherits_effective_root_service_tier(
"child startup should connect before its first turn"
);
let handshakes = server.handshakes();
let expected_hint = if tier_enabled {
format!("model=gpt-5.4;tier={tier}")
} else {
"model=gpt-5.4".to_string()
};
assert_eq!(
handshakes[1].header(X_CODEX_ROUTING_HINT_HEADER),
Some(expected_hint)
);
assert_eq!(handshakes[1].header(X_CODEX_ROUTING_HINT_HEADER), None);
let child_warmup = tokio::time::timeout(
Duration::from_secs(5),
server.wait_for_request(/*connection_index*/ 1, /*request_index*/ 0),
@@ -285,7 +277,7 @@ async fn detached_host_child_inherits_root_service_tier_at_prewarm_and_each_step
.await;
let test = test_codex()
.with_model("gpt-5.4")
.with_auth(CodexAuth::create_dummy_chatgpt_auth_for_testing())
.with_catalog_discovery_api_key()
.with_model_info_override("gpt-5.4", |model| {
model.service_tiers.push(ModelServiceTier {
id: "priority".into(),
@@ -362,7 +354,7 @@ async fn detached_host_child_inherits_root_service_tier_at_prewarm_and_each_step
.body_json();
assert_eq!(
server.handshakes()[1].header(X_CODEX_ROUTING_HINT_HEADER),
Some("model=gpt-5.4;tier=priority".into())
None
);
assert_eq!(warmup["generate"], false);
assert_eq!(warmup["service_tier"], "priority");
@@ -874,7 +866,7 @@ async fn websocket_v2_first_turn_sends_full_create_when_tier_changes_after_start
})
.collect();
})
.with_auth(CodexAuth::create_dummy_chatgpt_auth_for_testing())
.with_catalog_discovery_api_key()
.with_config(move |config| {
for feature in [Feature::ResponsesWebsocketsV2, Feature::FastMode] {
config
@@ -902,10 +894,7 @@ async fn websocket_v2_first_turn_sends_full_create_when_tier_changes_after_start
server
.single_handshake()
.header(X_CODEX_ROUTING_HINT_HEADER),
Some(match startup_tier {
Some(tier) => format!("model={model};tier={tier}"),
None => format!("model={model}"),
})
None
);
let connection = server.single_connection();
assert_eq!(connection.len(), 2);