Support openai/elicitation form requests (#41447)

## What changed

- Advertise `openai/elicitation` form support when the client declares an
  object-valued `form` capability, without deriving it from the legacy
  `openai/form` capability.
- Handle `openai/elicitation/create` requests in `form` mode and forward their
  metadata and opaque schema through app-server as `openaiForm`, preserving
  `x-openai-*` annotations.
- Keep legacy form handling independent and have the TUI automatically decline
  the new form requests it cannot render.

## Testing

- Add an app-server round-trip test for capability negotiation, request
  forwarding, and accepted responses.
- Extend MCP capability filtering coverage for `openai/elicitation.form`.

GitOrigin-RevId: 88f39257bffafe4ee98a9c910e38507843cd7eeb
This commit is contained in:
victor-openai authored and copyberry committed 2026-08-29 02:43:10 +00:00
1 parent 0ae94fdd49
commit eec4a23cb1
19 files changed
+329 -25

No files matched your search

+5 -1
View File
@@ -301,6 +301,7 @@ impl App {
codex_app_server_protocol::McpServerElicitationRequest::OpenAiForm {
..
}
| codex_app_server_protocol::McpServerElicitationRequest::OpenAiElicitationForm { .. }
| codex_app_server_protocol::McpServerElicitationRequest::Url { .. } => {
self.app_event_tx.resolve_elicitation(
thread_id,
@@ -1673,7 +1674,10 @@ impl App {
match &params.request {
codex_app_server_protocol::McpServerElicitationRequest::Form { .. } => true,
codex_app_server_protocol::McpServerElicitationRequest::OpenAiForm { .. } => false,
codex_app_server_protocol::McpServerElicitationRequest::OpenAiForm { .. }
| codex_app_server_protocol::McpServerElicitationRequest::OpenAiElicitationForm {
..
} => false,
request @ codex_app_server_protocol::McpServerElicitationRequest::Url { .. } => {
let thread_id = ThreadId::from_string(&params.thread_id)
.unwrap_or_else(|_| self.chat_widget.thread_id().unwrap_or_default());