mirror of
https://github.com/openai/codex.git
synced 2026-11-27 23:31:09 +00:00
Enable MCP user verification in the TUI (#43712)
## Why The TUI automatically canceled MCP user verification requests, preventing users from completing verification and approving them. ## What changed - Show verification prompts for active and inactive threads, with actions to verify and approve or cancel. - Run approved verification through the local app-server's `userVerification/verify` RPC and return the proof to the original request. Cancel on failure and show a warning in the requesting thread; remote workspaces remain unsupported. - Deduplicate prompts, preserve foreground streaming when another thread requests verification, and surface queued prompts when returning from a side conversation. - Cancel verification when its thread is discarded and ignore stale results after cancellation. ## Testing Add RPC, routing, and snapshot tests covering successful verification, unsupported binaries and remote workspaces, cancellation and late proofs, prompt replay, side conversation switching, and foreground stream preservation. GitOrigin-RevId: 2ae12f47c443e17de25f4ec033f6078ac28b1e03
This commit is contained in:
1 parent
95327467c3
commit
c7f81afc19
23 files changed
+1060
-29
No files matched your search
@@ -331,14 +331,18 @@ impl App {
|
||||
message: message.clone(),
|
||||
}),
|
||||
)),
|
||||
codex_app_server_protocol::McpServerElicitationRequest::UserVerification { .. } => {
|
||||
self.app_event_tx.resolve_elicitation(
|
||||
thread_id, params.server_name.clone(), request_id.clone(),
|
||||
codex_app_server_protocol::McpServerElicitationAction::Cancel,
|
||||
/*content*/ None, /*meta*/ None,
|
||||
);
|
||||
None
|
||||
}
|
||||
codex_app_server_protocol::McpServerElicitationRequest::UserVerification {
|
||||
title, description, ..
|
||||
} => Some(ThreadInteractiveRequest::UserVerification {
|
||||
thread_id,
|
||||
request: crate::bottom_pane::user_verification::UserVerificationRequest {
|
||||
thread_label,
|
||||
server_name: params.server_name.clone(),
|
||||
request_id: request_id.clone(),
|
||||
title: title.clone(),
|
||||
description: description.clone(),
|
||||
},
|
||||
}),
|
||||
codex_app_server_protocol::McpServerElicitationRequest::OpenAiForm {
|
||||
..
|
||||
}
|
||||
@@ -397,6 +401,10 @@ impl App {
|
||||
self.startup_pending_protected_request = true;
|
||||
}
|
||||
}
|
||||
ThreadInteractiveRequest::UserVerification { thread_id, request } => {
|
||||
self.chat_widget
|
||||
.push_user_verification_request(thread_id, request);
|
||||
}
|
||||
ThreadInteractiveRequest::McpServerElicitation(request) => {
|
||||
self.chat_widget
|
||||
.push_mcp_server_elicitation_request(request);
|
||||
@@ -1914,9 +1922,7 @@ impl App {
|
||||
};
|
||||
|
||||
match ¶ms.request {
|
||||
codex_app_server_protocol::McpServerElicitationRequest::UserVerification { .. } => {
|
||||
false
|
||||
}
|
||||
codex_app_server_protocol::McpServerElicitationRequest::UserVerification { .. } => true,
|
||||
codex_app_server_protocol::McpServerElicitationRequest::Form { .. } => true,
|
||||
codex_app_server_protocol::McpServerElicitationRequest::OpenAiForm { .. }
|
||||
| codex_app_server_protocol::McpServerElicitationRequest::OpenAiElicitationForm {
|
||||
|
||||
Reference in new issue
Block a user