mirror of
https://github.com/openai/codex.git
synced 2026-11-19 22:30:42 +00:00
fix(core): report MCP replacement failures
Co-authored-by: Codex noreply@openai.com
This commit is contained in:
co-authored by
Codex noreply@openai.com
parent
d2a04a2e8c
commit
74f2d71360
@@ -34,6 +34,8 @@ use codex_protocol::protocol::GuardianAssessmentStatus;
|
||||
use codex_protocol::protocol::InterAgentCommunication;
|
||||
use codex_protocol::protocol::McpServerRefreshConfig;
|
||||
use codex_protocol::protocol::McpServerUpdateConfig;
|
||||
use codex_protocol::protocol::McpStartupCompleteEvent;
|
||||
use codex_protocol::protocol::McpStartupFailure;
|
||||
use codex_protocol::protocol::Op;
|
||||
use codex_protocol::protocol::RealtimeConversationListVoicesResponseEvent;
|
||||
use codex_protocol::protocol::RealtimeVoicesList;
|
||||
@@ -443,8 +445,23 @@ pub async fn refresh_mcp_server(
|
||||
update: McpServerUpdateConfig,
|
||||
submit_id: String,
|
||||
) {
|
||||
if let Err(error) = sess.refresh_mcp_server_now(update, submit_id).await {
|
||||
let server_name = update.server_name.clone();
|
||||
if let Err(error) = sess
|
||||
.refresh_mcp_server_now(update, submit_id.clone())
|
||||
.await
|
||||
{
|
||||
warn!(error = %error, "failed to refresh MCP server");
|
||||
sess.send_event_raw(Event {
|
||||
id: submit_id,
|
||||
msg: EventMsg::McpStartupComplete(McpStartupCompleteEvent {
|
||||
failed: vec![McpStartupFailure {
|
||||
server: server_name,
|
||||
error: error.to_string(),
|
||||
}],
|
||||
..Default::default()
|
||||
}),
|
||||
})
|
||||
.await;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user