Add opt-in MCP user-verification transport (#43352)

## Why

Device-authenticated verification needs an app response outside automated approval and review. Previously, MCP user-verification requests were always cancelled.

## What changed

- Add typed `openai/userVerification` elicitations carrying a title, description, and challenge through core and app-server.
- Route verification to one connection enabled by trusted host activation. Restrict responses to that owner, exclude requests from replay, and cancel on disconnect or authentication changes, including account switches away and back.
- Return proofs in `content`, discard response metadata, and cancel malformed acceptances. Suppress verification response logging and analytics, and send only a generic verification notice to realtime.
- Keep the mode experimental and exclude it from stable schema exports. Capability advertisement remains disabled, and the TUI cancels verification requests.

## Testing

Add coverage for owner isolation, disconnect and authentication races, proof response handling, automated-review bypass, inactive-host cancellation, stable schema filtering, and realtime payload exclusion. Update the MCP integration test to verify that an activated request holds the tool until the client responds.

GitOrigin-RevId: c8c7b6691a3f7756682bbcca9def1df0d1feb906
This commit is contained in:
riley-oai authored and copyberry committed 2026-09-07 04:33:22 +00:00
1 parent 121f91fd5d
commit 555b82afa9
31 files changed
+1244 -64

No files matched your search

+3 -2
View File
@@ -134,6 +134,7 @@ mod thread_status;
mod transport;
mod turn_cost_worker;
mod user_verification;
mod user_verification_response;
pub use crate::code_mode_host::AppServerCodeModeHostArgs;
pub use crate::code_mode_host::CodeModeHostTransport;
@@ -1135,7 +1136,7 @@ pub async fn run_main_with_transport_options(
warn!("dropping response from unknown connection: {connection_id:?}");
continue;
}
processor.process_response(response).await;
processor.process_response(connection_id, response).await;
}
JSONRPCMessage::Notification(notification) => {
if !connections.contains_key(&connection_id) {
@@ -1149,7 +1150,7 @@ pub async fn run_main_with_transport_options(
warn!("dropping error from unknown connection: {connection_id:?}");
continue;
}
processor.process_error(err).await;
processor.process_error(connection_id, err).await;
}
}
}