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:
@@ -4,16 +4,12 @@
|
||||
use std::future::Future;
|
||||
use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
use std::time::Instant;
|
||||
|
||||
use super::MCP_TOOLS_LIST_DURATION_METRIC;
|
||||
use crate::client_tool_catalog::ClientToolCatalog;
|
||||
use crate::connection_pool::ConnectionSharing;
|
||||
use crate::runtime::emit_duration;
|
||||
use crate::tools::ToolInfo;
|
||||
use anyhow::Result;
|
||||
use anyhow::anyhow;
|
||||
use codex_connectors::ConnectorRuntimeContext;
|
||||
use codex_protocol::mcp::McpServerInfo;
|
||||
use codex_rmcp_client::RmcpClient;
|
||||
use codex_rmcp_client::SendElicitation;
|
||||
@@ -37,7 +33,6 @@ pub(crate) struct ManagedClient {
|
||||
pub(crate) server_instructions: Option<String>,
|
||||
pub(crate) server_supports_sandbox_state_meta_capability: bool,
|
||||
pub(crate) client_supports_network_policy_meta_capability: bool,
|
||||
pub(crate) codex_apps_tools_cache_context: Option<ConnectorRuntimeContext<ToolInfo>>,
|
||||
}
|
||||
|
||||
impl ManagedClient {
|
||||
@@ -159,26 +154,8 @@ impl ManagedClient {
|
||||
}
|
||||
|
||||
pub(crate) async fn listed_catalog(&self) -> (Vec<ToolInfo>, Option<Arc<serde_json::Value>>) {
|
||||
let total_start = Instant::now();
|
||||
self.tool_catalog
|
||||
.read(|catalog| {
|
||||
// Discovery may use the shared cache until this client is refreshed.
|
||||
// Executable bindings always capture this client's own catalog.
|
||||
if catalog.revision == 0
|
||||
&& let Some(cache_context) = &self.codex_apps_tools_cache_context
|
||||
{
|
||||
let tools = cache_context.current_catalog_snapshot();
|
||||
emit_duration(
|
||||
MCP_TOOLS_LIST_DURATION_METRIC,
|
||||
total_start.elapsed(),
|
||||
&[("cache", if tools.is_some() { "hit" } else { "miss" })],
|
||||
);
|
||||
if let Some(tools) = tools {
|
||||
return (tools.tools().to_vec(), tools.shared_tool_list_meta());
|
||||
}
|
||||
}
|
||||
(catalog.tools.to_vec(), catalog.meta)
|
||||
})
|
||||
.read(|catalog| (catalog.tools.to_vec(), catalog.meta))
|
||||
.await
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,13 +4,12 @@ use super::*;
|
||||
use pretty_assertions::assert_eq;
|
||||
|
||||
fn app_tool(description: &str) -> ToolInfo {
|
||||
tool_info_from_listed_tool(
|
||||
CODEX_APPS_MCP_SERVER_NAME,
|
||||
/*is_codex_apps_mcp_server*/ true,
|
||||
regular_mcp_tool_info_from_listed_tool(
|
||||
"docs",
|
||||
/*server_instructions*/ None,
|
||||
ToolWithConnectorId {
|
||||
tool: RmcpTool::new("search", description.to_string(), Arc::default()),
|
||||
connector_id: Some("shared-connector".to_string()),
|
||||
connector_id: None,
|
||||
connector_name: None,
|
||||
connector_description: None,
|
||||
},
|
||||
|
||||
@@ -10,23 +10,7 @@ impl AsyncManagedClient {
|
||||
if self.cancel_token.is_cancelled() {
|
||||
return Status::Cancelled;
|
||||
}
|
||||
let reconnect_outcome = if let Some(reconnect) = &self.startup_reconnect {
|
||||
let state = reconnect
|
||||
.state
|
||||
.lock()
|
||||
.unwrap_or_else(std::sync::PoisonError::into_inner);
|
||||
if state.reconnect_in_flight.is_some() {
|
||||
return Status::Starting;
|
||||
}
|
||||
state
|
||||
.current_client
|
||||
.clone()
|
||||
.map(Ok)
|
||||
.or_else(|| state.last_error.clone().map(Err))
|
||||
} else {
|
||||
None
|
||||
};
|
||||
let outcome = reconnect_outcome.or_else(|| self.client.peek().cloned());
|
||||
let outcome = self.client.peek().cloned();
|
||||
match outcome {
|
||||
Some(Ok(client)) => {
|
||||
if client.client.is_closed().await {
|
||||
|
||||
Reference in New Issue
Block a user