WIP fase 2b-3: rimozione sottosistemi solo-ChatGPT (plugin remoti, image gen, daybreak, cyber, attestation, cloud config, app/connettori) - test in corso
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,7 +2,6 @@ use std::collections::HashMap;
|
||||
|
||||
use anyhow::Result;
|
||||
use async_channel::Sender;
|
||||
use codex_config::McpServerAuth;
|
||||
use codex_config::McpServerConfig;
|
||||
use codex_config::McpServerTransportConfig;
|
||||
use codex_protocol::protocol::Event;
|
||||
@@ -12,17 +11,9 @@ use codex_protocol::protocol::McpStartupUpdateEvent;
|
||||
use codex_rmcp_client::McpAuthState;
|
||||
use codex_rmcp_client::McpLoginRequirement;
|
||||
|
||||
use crate::mcp::CODEX_APPS_MCP_SERVER_NAME;
|
||||
use crate::rmcp_client::DEFAULT_STARTUP_TIMEOUT;
|
||||
use crate::rmcp_client::StartupOutcomeError;
|
||||
|
||||
pub(super) fn should_share_codex_apps_tools_cache(
|
||||
server_name: &str,
|
||||
uses_env_bearer_token: bool,
|
||||
) -> bool {
|
||||
server_name == CODEX_APPS_MCP_SERVER_NAME && !uses_env_bearer_token
|
||||
}
|
||||
|
||||
pub(super) async fn emit_update(
|
||||
submit_id: &str,
|
||||
tx_event: &Sender<Event>,
|
||||
@@ -43,13 +34,6 @@ pub(super) fn mcp_startup_failure_reason(
|
||||
if !error.is_authentication_required() {
|
||||
return None;
|
||||
}
|
||||
if let StartupOutcomeError::Failed {
|
||||
is_ema_authentication_required: true,
|
||||
..
|
||||
} = error
|
||||
{
|
||||
return Some(McpStartupFailureReason::ReauthenticationRequired);
|
||||
}
|
||||
match auth_state {
|
||||
Some(
|
||||
McpAuthState::LoggedOut(McpLoginRequirement::Reauthentication) | McpAuthState::OAuth,
|
||||
@@ -93,14 +77,11 @@ pub(super) fn mcp_init_error_display(
|
||||
"GitHub MCP does not support OAuth. Log in by adding a personal access token (https://github.com/settings/personal-access-tokens) to your environment and config.toml:\n[mcp_servers.{server_key}]\nbearer_token_env_var = CODEX_GITHUB_PERSONAL_ACCESS_TOKEN"
|
||||
)
|
||||
} else if error.is_authentication_required() {
|
||||
let recovery_hint =
|
||||
if config.is_some_and(|config| matches!(config.auth, McpServerAuth::EmaAuth)) {
|
||||
"Sign in to your enterprise provider in Codex, then start a new thread.".to_string()
|
||||
} else if config.is_some_and(|config| !config.is_local_environment()) {
|
||||
"Use your client's MCP OAuth sign-in flow.".to_string()
|
||||
} else {
|
||||
format!("Run `codex mcp login {server_name}`.")
|
||||
};
|
||||
let recovery_hint = if config.is_some_and(|config| !config.is_local_environment()) {
|
||||
"Use your client's MCP OAuth sign-in flow.".to_string()
|
||||
} else {
|
||||
format!("Run `codex mcp login {server_name}`.")
|
||||
};
|
||||
let auth_status = match reason {
|
||||
Some(McpStartupFailureReason::ReauthenticationRequired) => {
|
||||
"requires OAuth reauthentication"
|
||||
|
||||
Reference in New Issue
Block a user