Enable user verification for local Codex Desktop sessions (#44613)

## What changed

Allow app-server to advertise `openai/elicitation.userVerification` and route verification requests to local stdio clients named `Codex Desktop` when `experimentalApi` is enabled and the device supports verification. Preserve support for the in-process `codex-tui` client.

Document the experimental verification API, local credential lifecycle, transport restrictions, and GUI requirements for cancellation and late proofs.

## Testing

Extend activation tests to cover desktop capability advertisement and request eligibility, including rejection for other transports, unrecognized client names, missing opt-in, and unsupported devices.

GitOrigin-RevId: ba4fd4b83b9c24541df3a490396d6c715e7b7433
This commit is contained in:
riley-oai
2026-09-10 18:32:38 +00:00
committed by copyberry
parent 196964ef10
commit 3715bf4100
3 changed files with 93 additions and 5 deletions
@@ -14,6 +14,7 @@ use codex_protocol::mcp::OPENAI_ELICITATION_EXTENSION_ID;
use super::*;
use crate::message_processor::ConnectionSessionState;
use crate::message_processor::InitializedConnectionSessionState;
use crate::transport::ConnectionOrigin;
const NON_ORIGINATING_CLIENT_NAMES: &[&str] = &["codex_app_server_daemon", "codex-backend"];
@@ -95,14 +96,14 @@ impl InitializeRequestProcessor {
"Invalid clientInfo.name: '{name}'. Must be a valid HTTP header value."
)));
}
// The bundled TUI shares this build and implements the typed verification UI.
// Independently deployed UIs need their own rollout before receiving this mode.
// Activate only the embedded TUI and local desktop host. Client-supplied
// extensions cannot opt other hosts into verification.
let user_verification_enabled = experimental_api_enabled
&& matches!(
session.origin,
crate::transport::ConnectionOrigin::InProcess
(session.origin, name.as_str()),
(ConnectionOrigin::InProcess, "codex-tui")
| (ConnectionOrigin::Stdio, "Codex Desktop")
)
&& name == "codex-tui"
&& tokio::task::spawn_blocking(self.user_verification.device_supported)
.await
.unwrap_or(false);