mirror of
https://github.com/openai/codex.git
synced 2026-11-27 23:31:09 +00:00
Preserve MCP App UI metadata in tool-call events and history (#45805)
## Why Clients need widget presentation details to render MCP Apps without waiting for the full MCP catalog, including when replaying saved history. ## What changed - Add `mcpToolCall.mcpAppUi` with the invoked descriptor's `resourceUri` and `preferredModelDisplayMode`, and carry it through tool-call events and saved history. - Support `fullscreen` and default to `inline` when the display preference is missing or unsupported. - Keep existing resource URI fields for compatibility. Leave `mcpAppUi` null for older history and tools that declare widgets only in result metadata, where clients still use catalog discovery. - Update protocol schemas, TypeScript and Python types, and app-server documentation. ## Testing Add parameterized integration coverage for fullscreen, missing and unsupported preferences, legacy URI metadata, and result-only widgets, verifying consistent tool events and preservation across session resume. GitOrigin-RevId: 2a9bed804dcea8c2b4903b8406fa6710681f7f5e
This commit is contained in:
1 parent
872fc22f9c
commit
b71af39fe6
51 files changed
+1027
-47
No files matched your search
@@ -492,6 +492,7 @@ fn mcp_tool_call_begin_and_end_emit_item_events() {
|
||||
arguments: json!({ "key": "value" }),
|
||||
app_context: None,
|
||||
mcp_app_resource_uri: None,
|
||||
mcp_app_ui: None,
|
||||
plugin_id: None,
|
||||
read_only_hint: None,
|
||||
result: None,
|
||||
@@ -512,6 +513,7 @@ fn mcp_tool_call_begin_and_end_emit_item_events() {
|
||||
arguments: json!({ "key": "value" }),
|
||||
app_context: None,
|
||||
mcp_app_resource_uri: None,
|
||||
mcp_app_ui: None,
|
||||
plugin_id: None,
|
||||
read_only_hint: None,
|
||||
result: Some(Box::new(McpToolCallResult {
|
||||
@@ -586,6 +588,7 @@ fn mcp_tool_call_failure_sets_failed_status() {
|
||||
arguments: json!({ "param": 42 }),
|
||||
app_context: None,
|
||||
mcp_app_resource_uri: None,
|
||||
mcp_app_ui: None,
|
||||
plugin_id: None,
|
||||
read_only_hint: None,
|
||||
result: None,
|
||||
@@ -637,6 +640,7 @@ fn mcp_tool_call_defaults_arguments_and_preserves_structured_content() {
|
||||
arguments: serde_json::Value::Null,
|
||||
app_context: None,
|
||||
mcp_app_resource_uri: None,
|
||||
mcp_app_ui: None,
|
||||
plugin_id: None,
|
||||
read_only_hint: None,
|
||||
result: None,
|
||||
@@ -657,6 +661,7 @@ fn mcp_tool_call_defaults_arguments_and_preserves_structured_content() {
|
||||
arguments: serde_json::Value::Null,
|
||||
app_context: None,
|
||||
mcp_app_resource_uri: None,
|
||||
mcp_app_ui: None,
|
||||
plugin_id: None,
|
||||
read_only_hint: None,
|
||||
result: Some(Box::new(McpToolCallResult {
|
||||
|
||||
Reference in new issue
Block a user