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:
@@ -38,7 +38,6 @@ use crate::metrics::timer::Timer;
|
||||
use crate::sanitize_metric_tag_value;
|
||||
use crate::tool_result::ToolResultEvent;
|
||||
use crate::tool_result::emit_tool_result;
|
||||
use codex_api::AgentIdentityTelemetry;
|
||||
use codex_api::ResponseEvent;
|
||||
use codex_protocol::AgentPath;
|
||||
use codex_protocol::ThreadId;
|
||||
@@ -90,7 +89,6 @@ pub struct AuthEnvTelemetryMetadata {
|
||||
pub codex_api_key_env_enabled: bool,
|
||||
pub provider_env_key_name: Option<String>,
|
||||
pub provider_env_key_present: Option<bool>,
|
||||
pub refresh_token_url_override_present: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
@@ -704,7 +702,6 @@ impl SessionTelemetry {
|
||||
auth.env_codex_api_key_enabled = self.metadata.auth_env.codex_api_key_env_enabled,
|
||||
auth.env_provider_key_name = self.metadata.auth_env.provider_env_key_name.as_deref(),
|
||||
auth.env_provider_key_present = self.metadata.auth_env.provider_env_key_present,
|
||||
auth.env_refresh_token_url_override_present = self.metadata.auth_env.refresh_token_url_override_present,
|
||||
reasoning_effort = reasoning_effort.as_ref().map(ToString::to_string),
|
||||
reasoning_summary = %reasoning_summary,
|
||||
context_window = context_window,
|
||||
@@ -749,7 +746,6 @@ impl SessionTelemetry {
|
||||
/*cf_ray*/ None,
|
||||
/*auth_error*/ None,
|
||||
/*auth_error_code*/ None,
|
||||
/*agent_identity_telemetry*/ None,
|
||||
);
|
||||
|
||||
response
|
||||
@@ -772,7 +768,6 @@ impl SessionTelemetry {
|
||||
cf_ray: Option<&str>,
|
||||
auth_error: Option<&str>,
|
||||
auth_error_code: Option<&str>,
|
||||
agent_identity_telemetry: Option<&AgentIdentityTelemetry>,
|
||||
) {
|
||||
let success = status.is_some_and(|code| (200..=299).contains(&code)) && error.is_none();
|
||||
let success_str = if success { "true" } else { "false" };
|
||||
@@ -808,13 +803,10 @@ impl SessionTelemetry {
|
||||
auth.env_codex_api_key_enabled = self.metadata.auth_env.codex_api_key_env_enabled,
|
||||
auth.env_provider_key_name = self.metadata.auth_env.provider_env_key_name.as_deref(),
|
||||
auth.env_provider_key_present = self.metadata.auth_env.provider_env_key_present,
|
||||
auth.env_refresh_token_url_override_present = self.metadata.auth_env.refresh_token_url_override_present,
|
||||
auth.request_id = request_id,
|
||||
auth.cf_ray = cf_ray,
|
||||
auth.error = auth_error,
|
||||
auth.error_code = auth_error_code,
|
||||
auth.agent_id = agent_identity_telemetry.map(|metadata| metadata.agent_id.as_str()),
|
||||
auth.task_id = agent_identity_telemetry.map(|metadata| metadata.task_id.as_str()),
|
||||
},
|
||||
log: {},
|
||||
trace: {},
|
||||
@@ -838,7 +830,6 @@ impl SessionTelemetry {
|
||||
cf_ray: Option<&str>,
|
||||
auth_error: Option<&str>,
|
||||
auth_error_code: Option<&str>,
|
||||
agent_identity_telemetry: Option<&AgentIdentityTelemetry>,
|
||||
) {
|
||||
let success = error.is_none()
|
||||
&& status
|
||||
@@ -873,15 +864,12 @@ impl SessionTelemetry {
|
||||
auth.env_codex_api_key_enabled = self.metadata.auth_env.codex_api_key_env_enabled,
|
||||
auth.env_provider_key_name = self.metadata.auth_env.provider_env_key_name.as_deref(),
|
||||
auth.env_provider_key_present = self.metadata.auth_env.provider_env_key_present,
|
||||
auth.env_refresh_token_url_override_present = self.metadata.auth_env.refresh_token_url_override_present,
|
||||
auth.connection_reused = false,
|
||||
auth.reauth = reauth,
|
||||
auth.request_id = request_id,
|
||||
auth.cf_ray = cf_ray,
|
||||
auth.error = auth_error,
|
||||
auth.error_code = auth_error_code,
|
||||
auth.agent_id = agent_identity_telemetry.map(|metadata| metadata.agent_id.as_str()),
|
||||
auth.task_id = agent_identity_telemetry.map(|metadata| metadata.task_id.as_str()),
|
||||
},
|
||||
log: {},
|
||||
trace: {},
|
||||
@@ -893,7 +881,6 @@ impl SessionTelemetry {
|
||||
duration: Duration,
|
||||
error: Option<&str>,
|
||||
connection_reused: bool,
|
||||
agent_identity_telemetry: Option<&AgentIdentityTelemetry>,
|
||||
) {
|
||||
let success_str = if error.is_none() { "true" } else { "false" };
|
||||
self.counter(
|
||||
@@ -918,10 +905,7 @@ impl SessionTelemetry {
|
||||
auth.env_codex_api_key_enabled = self.metadata.auth_env.codex_api_key_env_enabled,
|
||||
auth.env_provider_key_name = self.metadata.auth_env.provider_env_key_name.as_deref(),
|
||||
auth.env_provider_key_present = self.metadata.auth_env.provider_env_key_present,
|
||||
auth.env_refresh_token_url_override_present = self.metadata.auth_env.refresh_token_url_override_present,
|
||||
auth.connection_reused = connection_reused,
|
||||
auth.agent_id = agent_identity_telemetry.map(|metadata| metadata.agent_id.as_str()),
|
||||
auth.task_id = agent_identity_telemetry.map(|metadata| metadata.task_id.as_str()),
|
||||
},
|
||||
log: {},
|
||||
trace: {},
|
||||
@@ -1417,7 +1401,6 @@ impl SessionTelemetry {
|
||||
"reasoning_summary_part_added".into()
|
||||
}
|
||||
ResponseEvent::ServerModel(_) => "server_model".into(),
|
||||
ResponseEvent::ModelVerifications(_) => "model_verifications".into(),
|
||||
ResponseEvent::TurnModerationMetadata(_) => "turn_moderation_metadata".into(),
|
||||
ResponseEvent::GuardianAssessment(_) => "guardian_assessment".into(),
|
||||
ResponseEvent::SafetyBuffering(_) => "safety_buffering".into(),
|
||||
|
||||
@@ -49,7 +49,7 @@ pub enum ToolDecisionSource {
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Display)]
|
||||
pub enum TelemetryAuthMode {
|
||||
ApiKey,
|
||||
Chatgpt,
|
||||
Headers,
|
||||
}
|
||||
|
||||
impl From<AuthMode> for TelemetryAuthMode {
|
||||
@@ -58,11 +58,7 @@ impl From<AuthMode> for TelemetryAuthMode {
|
||||
AuthMode::ApiKey | AuthMode::BedrockApiKey | AuthMode::BedrockAccessKeys => {
|
||||
Self::ApiKey
|
||||
}
|
||||
AuthMode::Chatgpt
|
||||
| AuthMode::ChatgptAuthTokens
|
||||
| AuthMode::Headers
|
||||
| AuthMode::AgentIdentity
|
||||
| AuthMode::PersonalAccessToken => Self::Chatgpt,
|
||||
AuthMode::Headers => Self::Headers,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user