Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

Remove template IDs from MCP tool call metadata (#33467)

Martin Au-Yeung800715d20165
diff --git a/codex-rs/analytics/src/analytics_client_tests.rs b/codex-rs/analytics/src/analytics_client_tests.rs
index e151034b2e..eeeadd4634 100644
--- a/codex-rs/analytics/src/analytics_client_tests.rs
+++ b/codex-rs/analytics/src/analytics_client_tests.rs
@@ -4389,7 +4389,6 @@ async fn turn_event_counts_completed_tool_items() {
link_id: None,
resource_uri: None,
app_name: None,
- template_id: None,
action_name: None,
}),
mcp_app_resource_uri: None,
diff --git a/codex-rs/app-server-protocol/schema/json/ServerNotification.json b/codex-rs/app-server-protocol/schema/json/ServerNotification.json
index 9c1c3f9431..42375301b6 100644
--- a/codex-rs/app-server-protocol/schema/json/ServerNotification.json
+++ b/codex-rs/app-server-protocol/schema/json/ServerNotification.json
@@ -2501,12 +2501,6 @@
"string",
"null"
]
- },
- "templateId": {
- "type": [
- "string",
- "null"
- ]
}
},
"required": [
diff --git a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json
index bd16942da4..24ef81e0dc 100644
--- a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json
+++ b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json
@@ -12495,12 +12495,6 @@
"string",
"null"
]
- },
- "templateId": {
- "type": [
- "string",
- "null"
- ]
}
},
"required": [
diff --git a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json
index c4b984b127..02ebffd26f 100644
--- a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json
+++ b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json
@@ -8852,12 +8852,6 @@
"string",
"null"
]
- },
- "templateId": {
- "type": [
- "string",
- "null"
- ]
}
},
"required": [
diff --git a/codex-rs/app-server-protocol/schema/json/v2/ItemCompletedNotification.json b/codex-rs/app-server-protocol/schema/json/v2/ItemCompletedNotification.json
index e9176c977f..58e74d1a3c 100644
--- a/codex-rs/app-server-protocol/schema/json/v2/ItemCompletedNotification.json
+++ b/codex-rs/app-server-protocol/schema/json/v2/ItemCompletedNotification.json
@@ -325,12 +325,6 @@
"string",
"null"
]
- },
- "templateId": {
- "type": [
- "string",
- "null"
- ]
}
},
"required": [
diff --git a/codex-rs/app-server-protocol/schema/json/v2/ItemStartedNotification.json b/codex-rs/app-server-protocol/schema/json/v2/ItemStartedNotification.json
index 1180415836..4244c2bb19 100644
--- a/codex-rs/app-server-protocol/schema/json/v2/ItemStartedNotification.json
+++ b/codex-rs/app-server-protocol/schema/json/v2/ItemStartedNotification.json
@@ -325,12 +325,6 @@
"string",
"null"
]
- },
- "templateId": {
- "type": [
- "string",
- "null"
- ]
}
},
"required": [
diff --git a/codex-rs/app-server-protocol/schema/json/v2/ReviewStartResponse.json b/codex-rs/app-server-protocol/schema/json/v2/ReviewStartResponse.json
index dbb79ef66c..46bcb0ac64 100644
--- a/codex-rs/app-server-protocol/schema/json/v2/ReviewStartResponse.json
+++ b/codex-rs/app-server-protocol/schema/json/v2/ReviewStartResponse.json
@@ -463,12 +463,6 @@
"string",
"null"
]
- },
- "templateId": {
- "type": [
- "string",
- "null"
- ]
}
},
"required": [
diff --git a/codex-rs/app-server-protocol/schema/json/v2/ThreadForkResponse.json b/codex-rs/app-server-protocol/schema/json/v2/ThreadForkResponse.json
index 6bd6415b43..03b4e5db33 100644
--- a/codex-rs/app-server-protocol/schema/json/v2/ThreadForkResponse.json
+++ b/codex-rs/app-server-protocol/schema/json/v2/ThreadForkResponse.json
@@ -567,12 +567,6 @@
"string",
"null"
]
- },
- "templateId": {
- "type": [
- "string",
- "null"
- ]
}
},
"required": [
diff --git a/codex-rs/app-server-protocol/schema/json/v2/ThreadListResponse.json b/codex-rs/app-server-protocol/schema/json/v2/ThreadListResponse.json
index 702910a24f..98c2174473 100644
--- a/codex-rs/app-server-protocol/schema/json/v2/ThreadListResponse.json
+++ b/codex-rs/app-server-protocol/schema/json/v2/ThreadListResponse.json
@@ -489,12 +489,6 @@
"string",
"null"
]
- },
- "templateId": {
- "type": [
- "string",
- "null"
- ]
}
},
"required": [
diff --git a/codex-rs/app-server-protocol/schema/json/v2/ThreadMetadataUpdateResponse.json b/codex-rs/app-server-protocol/schema/json/v2/ThreadMetadataUpdateResponse.json
index 0515964e8b..b719f1dab3 100644
--- a/codex-rs/app-server-protocol/schema/json/v2/ThreadMetadataUpdateResponse.json
+++ b/codex-rs/app-server-protocol/schema/json/v2/ThreadMetadataUpdateResponse.json
@@ -489,12 +489,6 @@
"string",
"null"
]
- },
- "templateId": {
- "type": [
- "string",
- "null"
- ]
}
},
"required": [
diff --git a/codex-rs/app-server-protocol/schema/json/v2/ThreadReadResponse.json b/codex-rs/app-server-protocol/schema/json/v2/ThreadReadResponse.json
index 69dd3e36bd..8a84fae30e 100644
--- a/codex-rs/app-server-protocol/schema/json/v2/ThreadReadResponse.json
+++ b/codex-rs/app-server-protocol/schema/json/v2/ThreadReadResponse.json
@@ -489,12 +489,6 @@
"string",
"null"
]
- },
- "templateId": {
- "type": [
- "string",
- "null"
- ]
}
},
"required": [
diff --git a/codex-rs/app-server-protocol/schema/json/v2/ThreadResumeResponse.json b/codex-rs/app-server-protocol/schema/json/v2/ThreadResumeResponse.json
index ca5249bfb0..8f339d196e 100644
--- a/codex-rs/app-server-protocol/schema/json/v2/ThreadResumeResponse.json
+++ b/codex-rs/app-server-protocol/schema/json/v2/ThreadResumeResponse.json
@@ -567,12 +567,6 @@
"string",
"null"
]
- },
- "templateId": {
- "type": [
- "string",
- "null"
- ]
}
},
"required": [
diff --git a/codex-rs/app-server-protocol/schema/json/v2/ThreadRollbackResponse.json b/codex-rs/app-server-protocol/schema/json/v2/ThreadRollbackResponse.json
index 9a57d822e9..1c2f9f5bbc 100644
--- a/codex-rs/app-server-protocol/schema/json/v2/ThreadRollbackResponse.json
+++ b/codex-rs/app-server-protocol/schema/json/v2/ThreadRollbackResponse.json
@@ -489,12 +489,6 @@
"string",
"null"
]
- },
- "templateId": {
- "type": [
- "string",
- "null"
- ]
}
},
"required": [
diff --git a/codex-rs/app-server-protocol/schema/json/v2/ThreadStartResponse.json b/codex-rs/app-server-protocol/schema/json/v2/ThreadStartResponse.json
index 66b5ccca38..1b10b34d58 100644
--- a/codex-rs/app-server-protocol/schema/json/v2/ThreadStartResponse.json
+++ b/codex-rs/app-server-protocol/schema/json/v2/ThreadStartResponse.json
@@ -567,12 +567,6 @@
"string",
"null"
]
- },
- "templateId": {
- "type": [
- "string",
- "null"
- ]
}
},
"required": [
diff --git a/codex-rs/app-server-protocol/schema/json/v2/ThreadStartedNotification.json b/codex-rs/app-server-protocol/schema/json/v2/ThreadStartedNotification.json
index d4202df338..ba1f718b09 100644
--- a/codex-rs/app-server-protocol/schema/json/v2/ThreadStartedNotification.json
+++ b/codex-rs/app-server-protocol/schema/json/v2/ThreadStartedNotification.json
@@ -489,12 +489,6 @@
"string",
"null"
]
- },
- "templateId": {
- "type": [
- "string",
- "null"
- ]
}
},
"required": [
diff --git a/codex-rs/app-server-protocol/schema/json/v2/ThreadUnarchiveResponse.json b/codex-rs/app-server-protocol/schema/json/v2/ThreadUnarchiveResponse.json
index 5e1321c75e..44ecb9f7b2 100644
--- a/codex-rs/app-server-protocol/schema/json/v2/ThreadUnarchiveResponse.json
+++ b/codex-rs/app-server-protocol/schema/json/v2/ThreadUnarchiveResponse.json
@@ -489,12 +489,6 @@
"string",
"null"
]
- },
- "templateId": {
- "type": [
- "string",
- "null"
- ]
}
},
"required": [
diff --git a/codex-rs/app-server-protocol/schema/json/v2/TurnCompletedNotification.json b/codex-rs/app-server-protocol/schema/json/v2/TurnCompletedNotification.json
index fd9c02bf0b..b63f3b6eb6 100644
--- a/codex-rs/app-server-protocol/schema/json/v2/TurnCompletedNotification.json
+++ b/codex-rs/app-server-protocol/schema/json/v2/TurnCompletedNotification.json
@@ -463,12 +463,6 @@
"string",
"null"
]
- },
- "templateId": {
- "type": [
- "string",
- "null"
- ]
}
},
"required": [
diff --git a/codex-rs/app-server-protocol/schema/json/v2/TurnStartResponse.json b/codex-rs/app-server-protocol/schema/json/v2/TurnStartResponse.json
index 06658fd0ae..55fb943eef 100644
--- a/codex-rs/app-server-protocol/schema/json/v2/TurnStartResponse.json
+++ b/codex-rs/app-server-protocol/schema/json/v2/TurnStartResponse.json
@@ -463,12 +463,6 @@
"string",
"null"
]
- },
- "templateId": {
- "type": [
- "string",
- "null"
- ]
}
},
"required": [
diff --git a/codex-rs/app-server-protocol/schema/json/v2/TurnStartedNotification.json b/codex-rs/app-server-protocol/schema/json/v2/TurnStartedNotification.json
index e5b456ae31..1de6c7d92c 100644
--- a/codex-rs/app-server-protocol/schema/json/v2/TurnStartedNotification.json
+++ b/codex-rs/app-server-protocol/schema/json/v2/TurnStartedNotification.json
@@ -463,12 +463,6 @@
"string",
"null"
]
- },
- "templateId": {
- "type": [
- "string",
- "null"
- ]
}
},
"required": [
diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/McpToolCallAppContext.ts b/codex-rs/app-server-protocol/schema/typescript/v2/McpToolCallAppContext.ts
index e4bc5a11d9..28c2845327 100644
--- a/codex-rs/app-server-protocol/schema/typescript/v2/McpToolCallAppContext.ts
+++ b/codex-rs/app-server-protocol/schema/typescript/v2/McpToolCallAppContext.ts
@@ -2,4 +2,4 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
-export type McpToolCallAppContext = { connectorId: string, linkId: string | null, resourceUri: string | null, appName: string | null, templateId: string | null, actionName: string | null, };
+export type McpToolCallAppContext = { connectorId: string, linkId: string | null, resourceUri: string | null, appName: string | null, actionName: string | null, };
diff --git a/codex-rs/app-server-protocol/src/protocol/thread_history.rs b/codex-rs/app-server-protocol/src/protocol/thread_history.rs
index deac74a698..7bb42c1935 100644
--- a/codex-rs/app-server-protocol/src/protocol/thread_history.rs
+++ b/codex-rs/app-server-protocol/src/protocol/thread_history.rs
@@ -773,7 +773,6 @@ impl ThreadHistoryBuilder {
link_id: payload.link_id.clone(),
resource_uri: payload.mcp_app_resource_uri.clone(),
app_name: payload.app_name.clone(),
- template_id: payload.template_id.clone(),
action_name: payload.action_name.clone(),
}),
mcp_app_resource_uri: payload.mcp_app_resource_uri.clone(),
@@ -826,7 +825,6 @@ impl ThreadHistoryBuilder {
link_id: payload.link_id.clone(),
resource_uri: payload.mcp_app_resource_uri.clone(),
app_name: payload.app_name.clone(),
- template_id: payload.template_id.clone(),
action_name: payload.action_name.clone(),
}),
mcp_app_resource_uri: payload.mcp_app_resource_uri.clone(),
@@ -2702,7 +2700,6 @@ mod tests {
mcp_app_resource_uri: None,
link_id: None,
app_name: None,
- template_id: None,
action_name: None,
plugin_id: None,
duration: Duration::from_millis(8),
@@ -2791,7 +2788,6 @@ mod tests {
mcp_app_resource_uri: Some("ui://widget/lookup.html".into()),
link_id: Some("link_calendar".into()),
app_name: Some("Calendar".into()),
- template_id: Some("calendar_template".into()),
action_name: Some("lookup".into()),
plugin_id: Some("sample@test".into()),
duration: Duration::from_millis(8),
@@ -2828,7 +2824,6 @@ mod tests {
link_id: Some("link_calendar".into()),
resource_uri: Some("ui://widget/lookup.html".into()),
app_name: Some("Calendar".into()),
- template_id: Some("calendar_template".into()),
action_name: Some("lookup".into()),
}),
mcp_app_resource_uri: Some("ui://widget/lookup.html".into()),
diff --git a/codex-rs/app-server-protocol/src/protocol/v2/item.rs b/codex-rs/app-server-protocol/src/protocol/v2/item.rs
index 8b88a8f92e..ddf8c9b2ee 100644
--- a/codex-rs/app-server-protocol/src/protocol/v2/item.rs
+++ b/codex-rs/app-server-protocol/src/protocol/v2/item.rs
@@ -398,7 +398,6 @@ pub struct McpToolCallAppContext {
pub link_id: Option<String>,
pub resource_uri: Option<String>,
pub app_name: Option<String>,
- pub template_id: Option<String>,
pub action_name: Option<String>,
}
@@ -950,7 +949,6 @@ impl From<CoreTurnItem> for ThreadItem {
link_id: mcp.link_id,
resource_uri: mcp.mcp_app_resource_uri.clone(),
app_name: mcp.app_name,
- template_id: mcp.template_id,
action_name: mcp.action_name,
}),
mcp_app_resource_uri: mcp.mcp_app_resource_uri,
diff --git a/codex-rs/app-server-protocol/src/protocol/v2/tests.rs b/codex-rs/app-server-protocol/src/protocol/v2/tests.rs
index 6901de3023..9389147513 100644
--- a/codex-rs/app-server-protocol/src/protocol/v2/tests.rs
+++ b/codex-rs/app-server-protocol/src/protocol/v2/tests.rs
@@ -2877,7 +2877,6 @@ fn core_turn_item_into_thread_item_converts_supported_variants() {
mcp_app_resource_uri: Some("app://connector".to_string()),
link_id: Some("link_calendar".to_string()),
app_name: Some("Calendar".to_string()),
- template_id: Some("calendar_template".to_string()),
action_name: Some("create_event".to_string()),
plugin_id: Some("sample@test".to_string()),
status: CoreMcpToolCallStatus::InProgress,
@@ -2899,7 +2898,6 @@ fn core_turn_item_into_thread_item_converts_supported_variants() {
link_id: Some("link_calendar".to_string()),
resource_uri: Some("app://connector".to_string()),
app_name: Some("Calendar".to_string()),
- template_id: Some("calendar_template".to_string()),
action_name: Some("create_event".to_string()),
}),
mcp_app_resource_uri: Some("app://connector".to_string()),
@@ -2919,7 +2917,6 @@ fn core_turn_item_into_thread_item_converts_supported_variants() {
mcp_app_resource_uri: None,
link_id: None,
app_name: None,
- template_id: None,
action_name: None,
plugin_id: None,
status: CoreMcpToolCallStatus::Completed,
@@ -2968,7 +2965,6 @@ fn mcp_tool_call_app_context_serializes_connector_id() {
link_id: Some("link_calendar".to_string()),
resource_uri: Some("app://connector".to_string()),
app_name: Some("Calendar".to_string()),
- template_id: Some("calendar_template".to_string()),
action_name: Some("create_event".to_string()),
}),
mcp_app_resource_uri: Some("app://connector".to_string()),
@@ -2992,7 +2988,6 @@ fn mcp_tool_call_app_context_serializes_connector_id() {
"linkId": "link_calendar",
"resourceUri": "app://connector",
"appName": "Calendar",
- "templateId": "calendar_template",
"actionName": "create_event",
},
"mcpAppResourceUri": "app://connector",
@@ -3012,7 +3007,6 @@ fn mcp_tool_call_app_context_serializes_missing_mixed_version_fields_as_null() {
link_id: None,
resource_uri: None,
app_name: None,
- template_id: None,
action_name: None,
})
.expect("MCP tool call app context should serialize"),
@@ -3021,7 +3015,6 @@ fn mcp_tool_call_app_context_serializes_missing_mixed_version_fields_as_null() {
"linkId": null,
"resourceUri": null,
"appName": null,
- "templateId": null,
"actionName": null,
})
);
diff --git a/codex-rs/app-server/README.md b/codex-rs/app-server/README.md
index d61b7c1088..25b52602ea 100644
--- a/codex-rs/app-server/README.md
+++ b/codex-rs/app-server/README.md
@@ -1392,7 +1392,7 @@ Today both notifications carry an empty `items` array even when item events were
- `reasoning` — `{id, summary, content}` where `summary` holds streamed reasoning summaries (applicable for most OpenAI models) and `content` holds raw reasoning blocks (applicable for e.g. open source models).
- `commandExecution` — `{id, command, cwd, status, commandActions, aggregatedOutput?, exitCode?, durationMs?}` for sandboxed commands; `status` is `inProgress`, `completed`, `failed`, or `declined`.
- `fileChange` — `{id, changes, status}` describing proposed edits; `changes` list `{path, kind, diff}` and `status` is `inProgress`, `completed`, `failed`, or `declined`.
-- `mcpToolCall` — `{id, server, tool, status, arguments, appContext, mcpAppResourceUri?, pluginId, result?, error?}` describing MCP calls; `appContext` is `{connectorId, linkId, resourceUri, appName, templateId, actionName}` for calls through a trusted MCP app, where `connectorId` identifies the connector that owns the tool, `linkId` identifies the app link, `resourceUri` points to the widget template, `appName` is the connector's display name, `templateId` identifies the app template, and `actionName` is the stable connector `Action.name`. `appName`, `templateId`, and `actionName` may be null for older rollout entries. The top-level `mcpAppResourceUri` is deprecated and temporarily duplicated for client migration. `tool` identifies the raw MCP tool. `status` is `inProgress`, `completed`, or `failed`.
+- `mcpToolCall` — `{id, server, tool, status, arguments, appContext, mcpAppResourceUri?, pluginId, result?, error?}` describing MCP calls; `appContext` is `{connectorId, linkId, resourceUri, appName, actionName}` for calls through a trusted MCP app, where `connectorId` identifies the connector that owns the tool, `linkId` identifies the app link, `resourceUri` points to the widget template, `appName` is the connector's display name, and `actionName` is the stable connector `Action.name`. `appName` and `actionName` may be null for older rollout entries. The top-level `mcpAppResourceUri` is deprecated and temporarily duplicated for client migration. `tool` identifies the raw MCP tool. `status` is `inProgress`, `completed`, or `failed`.
- `collabToolCall` — `{id, tool, status, senderThreadId, receiverThreadId?, newThreadId?, prompt?, agentStatus?}` describing collab tool calls (`spawn_agent`, `send_input`, `resume_agent`, `wait`, `close_agent`); `status` is `inProgress`, `completed`, or `failed`.
- `webSearch` — `{id, query, action?, results?}` for a web search request issued by the agent; `action` mirrors the Responses API web_search action payload (`search`, `open_page`, `find_in_page`) and may be omitted until completion. For standalone web search, `results` contains the out-of-band structured result DTOs returned by `/v1/alpha/search`; clients should ignore result types and fields they do not understand.
- `imageView` — `{id, path}` emitted when the agent invokes the image viewer tool.
diff --git a/codex-rs/app-server/src/request_processors/thread_resume_redaction.rs b/codex-rs/app-server/src/request_processors/thread_resume_redaction.rs
index 598e0bde08..36986e329b 100644
--- a/codex-rs/app-server/src/request_processors/thread_resume_redaction.rs
+++ b/codex-rs/app-server/src/request_processors/thread_resume_redaction.rs
@@ -85,7 +85,6 @@ mod tests {
link_id: Some("link_calendar".to_string()),
resource_uri: Some("ui://widget/lookup.html".to_string()),
app_name: Some("Calendar".to_string()),
- template_id: Some("calendar_template".to_string()),
action_name: Some("lookup".to_string()),
}),
mcp_app_resource_uri: Some("ui://widget/lookup.html".to_string()),
@@ -135,7 +134,6 @@ mod tests {
link_id: Some("link_calendar".to_string()),
resource_uri: Some("ui://widget/lookup.html".to_string()),
app_name: Some("Calendar".to_string()),
- template_id: Some("calendar_template".to_string()),
action_name: Some("lookup".to_string()),
}),
mcp_app_resource_uri: Some("ui://widget/lookup.html".to_string()),
diff --git a/codex-rs/app-server/tests/suite/v2/thread_resume.rs b/codex-rs/app-server/tests/suite/v2/thread_resume.rs
index 892c76879d..020a14d3b0 100644
--- a/codex-rs/app-server/tests/suite/v2/thread_resume.rs
+++ b/codex-rs/app-server/tests/suite/v2/thread_resume.rs
@@ -1216,7 +1216,6 @@ async fn thread_resume_redacts_payloads_for_chatgpt_remote_clients() -> Result<(
link_id: Some("link_calendar".to_string()),
resource_uri: Some("ui://widget/lookup.html".to_string()),
app_name: Some("Calendar".to_string()),
- template_id: Some("calendar_template".to_string()),
action_name: Some("lookup".to_string()),
})
);
@@ -1269,7 +1268,6 @@ async fn thread_resume_redacts_payloads_for_chatgpt_remote_clients() -> Result<(
link_id: Some("link_calendar".to_string()),
resource_uri: Some("ui://widget/lookup.html".to_string()),
app_name: Some("Calendar".to_string()),
- template_id: Some("calendar_template".to_string()),
action_name: Some("lookup".to_string()),
})
);
@@ -1378,7 +1376,6 @@ fn append_resume_redaction_history(
mcp_app_resource_uri: Some("ui://widget/lookup.html".to_string()),
link_id: Some("link_calendar".to_string()),
app_name: Some("Calendar".to_string()),
- template_id: Some("calendar_template".to_string()),
action_name: Some("lookup".to_string()),
plugin_id: None,
duration: Duration::from_millis(8),
diff --git a/codex-rs/core/src/mcp_tool_call.rs b/codex-rs/core/src/mcp_tool_call.rs
index 2d617a8a95..266d67b485 100644
--- a/codex-rs/core/src/mcp_tool_call.rs
+++ b/codex-rs/core/src/mcp_tool_call.rs
@@ -344,7 +344,6 @@ struct McpToolCallItemMetadata {
link_id: Option<String>,
mcp_app_resource_uri: Option<String>,
app_name: Option<String>,
- template_id: Option<String>,
action_name: Option<String>,
plugin_id: Option<String>,
}
@@ -363,7 +362,6 @@ impl McpToolCallItemMetadata {
mcp_app_resource_uri: metadata
.and_then(|metadata| metadata.mcp_app_resource_uri.clone()),
app_name: trusted_mcp_app_metadata.and_then(|metadata| metadata.connector_name.clone()),
- template_id: trusted_mcp_app_metadata.and_then(|metadata| metadata.template_id.clone()),
action_name: trusted_mcp_app_metadata
.and_then(|metadata| metadata.codex_apps_meta.as_ref())
.and_then(|meta| meta.get(MCP_TOOL_RESOURCE_URI_META_KEY))
@@ -911,7 +909,6 @@ async fn notify_mcp_tool_call_started(
mcp_app_resource_uri: item_metadata.mcp_app_resource_uri,
link_id: item_metadata.link_id,
app_name: item_metadata.app_name,
- template_id: item_metadata.template_id,
action_name: item_metadata.action_name,
plugin_id: item_metadata.plugin_id,
status: McpToolCallStatus::InProgress,
@@ -956,7 +953,6 @@ async fn notify_mcp_tool_call_completed(
mcp_app_resource_uri: item_metadata.mcp_app_resource_uri,
link_id: item_metadata.link_id,
app_name: item_metadata.app_name,
- template_id: item_metadata.template_id,
action_name: item_metadata.action_name,
plugin_id: item_metadata.plugin_id,
status,
@@ -1034,7 +1030,6 @@ pub(crate) struct McpToolApprovalMetadata {
tool_title: Option<String>,
tool_description: Option<String>,
mcp_app_resource_uri: Option<String>,
- template_id: Option<String>,
codex_apps_meta: Option<serde_json::Map<String, serde_json::Value>>,
openai_file_input_optional_fields: Option<HashMap<String, Vec<String>>>,
}
@@ -1045,7 +1040,6 @@ const MCP_TOOL_LINK_ID_META_KEY: &str = "link_id";
const MCP_TOOL_PLUGIN_ID_META_KEY: &str = "plugin_id";
const MCP_TOOL_THREAD_ID_META_KEY: &str = "threadId";
const MCP_TOOL_CONNECTED_ACCOUNT_EMAIL_META_KEY: &str = "connected_account_email";
-const MCP_TOOL_TEMPLATE_ID_META_KEY: &str = "template_id";
const MCP_TOOL_RESOURCE_URI_META_KEY: &str = "resource_uri";
async fn custom_mcp_tool_approval_mode(
@@ -1568,11 +1562,6 @@ pub(crate) async fn lookup_mcp_tool_metadata(
tool_title: tool_info.tool.title,
tool_description: tool_info.tool.description.map(std::borrow::Cow::into_owned),
mcp_app_resource_uri: get_mcp_app_resource_uri(tool_info.tool.meta.as_deref()),
- template_id: codex_apps_meta
- .as_ref()
- .and_then(|meta| meta.get(MCP_TOOL_TEMPLATE_ID_META_KEY))
- .and_then(serde_json::Value::as_str)
- .map(str::to_string),
codex_apps_meta,
// Disallow custom MCPs from uploading files via fileParams.
openai_file_input_optional_fields: openai_file_input_optional_fields_for_server(
diff --git a/codex-rs/core/src/mcp_tool_call_tests.rs b/codex-rs/core/src/mcp_tool_call_tests.rs
index 0653578dde..f91901cad3 100644
--- a/codex-rs/core/src/mcp_tool_call_tests.rs
+++ b/codex-rs/core/src/mcp_tool_call_tests.rs
@@ -87,7 +87,6 @@ fn approval_metadata(
tool_title: tool_title.map(str::to_string),
tool_description: tool_description.map(str::to_string),
mcp_app_resource_uri: None,
- template_id: None,
codex_apps_meta: None,
openai_file_input_optional_fields: None,
}
@@ -1224,11 +1223,9 @@ fn mcp_tool_call_item_metadata_only_trusts_codex_apps_identity() {
/*tool_description*/ None,
);
metadata.link_id = Some("link_fedcba9876543210fedcba9876543210".to_string());
- metadata.template_id = Some("calendar_template".to_string());
metadata.codex_apps_meta = Some(
serde_json::json!({
"resource_uri": "/asdk_app_0123456789abcdef0123456789abcdef/link_fedcba9876543210fedcba9876543210/create_event",
- "template_id": "calendar_template",
})
.as_object()
.cloned()
@@ -1242,7 +1239,6 @@ fn mcp_tool_call_item_metadata_only_trusts_codex_apps_identity() {
link_id: Some("link_fedcba9876543210fedcba9876543210".to_string()),
mcp_app_resource_uri: None,
app_name: Some("Calendar".to_string()),
- template_id: Some("calendar_template".to_string()),
action_name: Some("create_event".to_string()),
plugin_id: None,
}
@@ -1254,7 +1250,6 @@ fn mcp_tool_call_item_metadata_only_trusts_codex_apps_identity() {
link_id: None,
mcp_app_resource_uri: None,
app_name: None,
- template_id: None,
action_name: None,
plugin_id: None,
}
@@ -1279,7 +1274,6 @@ async fn mcp_tool_call_item_includes_app_identity() {
link_id: Some("link_fedcba9876543210fedcba9876543210".to_string()),
mcp_app_resource_uri: None,
app_name: Some("Calendar".to_string()),
- template_id: Some("calendar_template".to_string()),
action_name: Some("create_event".to_string()),
plugin_id: Some("sample@test".to_string()),
},
@@ -1328,7 +1322,6 @@ async fn codex_apps_tool_call_request_meta_includes_turn_metadata_and_codex_apps
tool_title: Some("Create Event".to_string()),
tool_description: Some("Create a calendar event.".to_string()),
mcp_app_resource_uri: None,
- template_id: None,
codex_apps_meta: Some(
serde_json::json!({
"resource_uri": "connector://calendar/tools/calendar_create_event",
@@ -1817,7 +1810,6 @@ fn guardian_mcp_review_request_includes_annotations_when_present() {
tool_title: None,
tool_description: None,
mcp_app_resource_uri: None,
- template_id: None,
codex_apps_meta: None,
openai_file_input_optional_fields: None,
};
@@ -2520,7 +2512,6 @@ async fn approve_mode_skips_when_annotations_do_not_require_approval() {
tool_title: Some("Read Only Tool".to_string()),
tool_description: None,
mcp_app_resource_uri: None,
- template_id: None,
codex_apps_meta: None,
openai_file_input_optional_fields: None,
};
@@ -2597,7 +2588,6 @@ async fn guardian_mode_skips_auto_when_annotations_do_not_require_approval() {
tool_title: Some("Read Only Tool".to_string()),
tool_description: None,
mcp_app_resource_uri: None,
- template_id: None,
codex_apps_meta: None,
openai_file_input_optional_fields: None,
};
@@ -2657,7 +2647,6 @@ async fn permission_request_hook_allows_mcp_tool_call() {
tool_title: Some("Create entities".to_string()),
tool_description: None,
mcp_app_resource_uri: None,
- template_id: None,
codex_apps_meta: None,
openai_file_input_optional_fields: None,
};
@@ -2796,7 +2785,6 @@ async fn permission_request_hook_runs_after_remembered_mcp_approval() {
tool_title: Some("Create entities".to_string()),
tool_description: None,
mcp_app_resource_uri: None,
- template_id: None,
codex_apps_meta: None,
openai_file_input_optional_fields: None,
};
@@ -2886,7 +2874,6 @@ async fn guardian_mode_mcp_denial_returns_rationale_message() {
tool_title: Some("Dangerous Tool".to_string()),
tool_description: Some("Reads calendar data.".to_string()),
mcp_app_resource_uri: None,
- template_id: None,
codex_apps_meta: None,
openai_file_input_optional_fields: None,
};
@@ -2943,7 +2930,6 @@ async fn prompt_mode_waits_for_approval_when_annotations_do_not_require_approval
tool_title: Some("Read Only Tool".to_string()),
tool_description: None,
mcp_app_resource_uri: None,
- template_id: None,
codex_apps_meta: None,
openai_file_input_optional_fields: None,
};
@@ -3001,7 +2987,6 @@ async fn full_access_mode_skips_mcp_tool_approval_for_all_approval_modes() {
tool_title: Some("Dangerous Tool".to_string()),
tool_description: Some("Performs a risky action.".to_string()),
mcp_app_resource_uri: None,
- template_id: None,
codex_apps_meta: None,
openai_file_input_optional_fields: None,
};
@@ -3057,7 +3042,6 @@ async fn approve_mode_skips_guardian_in_every_permission_mode() {
tool_title: Some("Dangerous Tool".to_string()),
tool_description: Some("Performs a risky action.".to_string()),
mcp_app_resource_uri: None,
- template_id: None,
codex_apps_meta: None,
openai_file_input_optional_fields: None,
};
diff --git a/codex-rs/core/src/tools/handlers/mcp_resource.rs b/codex-rs/core/src/tools/handlers/mcp_resource.rs
index b073b5ee75..0ae1d178fa 100644
--- a/codex-rs/core/src/tools/handlers/mcp_resource.rs
+++ b/codex-rs/core/src/tools/handlers/mcp_resource.rs
@@ -225,7 +225,6 @@ async fn emit_tool_call_begin(
mcp_app_resource_uri: None,
link_id: None,
app_name: None,
- template_id: None,
action_name: None,
plugin_id: None,
status: McpToolCallStatus::InProgress,
@@ -269,7 +268,6 @@ async fn emit_tool_call_end(
mcp_app_resource_uri: None,
link_id: None,
app_name: None,
- template_id: None,
action_name: None,
plugin_id: None,
status,
diff --git a/codex-rs/core/tests/suite/rmcp_client.rs b/codex-rs/core/tests/suite/rmcp_client.rs
index 262da5d88c..9b207f7bb0 100644
--- a/codex-rs/core/tests/suite/rmcp_client.rs
+++ b/codex-rs/core/tests/suite/rmcp_client.rs
@@ -1361,7 +1361,6 @@ async fn stdio_image_responses_round_trip() -> anyhow::Result<()> {
mcp_app_resource_uri: None,
link_id: None,
app_name: None,
- template_id: None,
action_name: None,
plugin_id: None,
},
diff --git a/codex-rs/protocol/src/items.rs b/codex-rs/protocol/src/items.rs
index 68eab25692..a418e63d57 100644
--- a/codex-rs/protocol/src/items.rs
+++ b/codex-rs/protocol/src/items.rs
@@ -372,9 +372,6 @@ pub struct McpToolCallItem {
pub app_name: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(optional)]
- pub template_id: Option<String>,
- #[serde(default, skip_serializing_if = "Option::is_none")]
- #[ts(optional)]
pub action_name: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(optional)]
diff --git a/codex-rs/protocol/src/legacy_events.rs b/codex-rs/protocol/src/legacy_events.rs
index a778711881..aac2849e64 100644
--- a/codex-rs/protocol/src/legacy_events.rs
+++ b/codex-rs/protocol/src/legacy_events.rs
@@ -465,7 +465,6 @@ impl McpToolCallItem {
mcp_app_resource_uri: self.mcp_app_resource_uri.clone(),
link_id: self.link_id.clone(),
app_name: self.app_name.clone(),
- template_id: self.template_id.clone(),
action_name: self.action_name.clone(),
plugin_id: self.plugin_id.clone(),
})
@@ -489,7 +488,6 @@ impl McpToolCallItem {
connector_id: self.connector_id.clone(),
link_id: self.link_id.clone(),
app_name: self.app_name.clone(),
- template_id: self.template_id.clone(),
action_name: self.action_name.clone(),
plugin_id: self.plugin_id.clone(),
duration: self.duration?,
diff --git a/codex-rs/protocol/src/protocol.rs b/codex-rs/protocol/src/protocol.rs
index 536a8286ec..d5bc2d5c08 100644
--- a/codex-rs/protocol/src/protocol.rs
+++ b/codex-rs/protocol/src/protocol.rs
@@ -2401,9 +2401,6 @@ pub struct McpToolCallBeginEvent {
pub app_name: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(optional)]
- pub template_id: Option<String>,
- #[serde(default, skip_serializing_if = "Option::is_none")]
- #[ts(optional)]
pub action_name: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(optional)]
@@ -2429,9 +2426,6 @@ pub struct McpToolCallEndEvent {
pub app_name: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(optional)]
- pub template_id: Option<String>,
- #[serde(default, skip_serializing_if = "Option::is_none")]
- #[ts(optional)]
pub action_name: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(optional)]
@@ -5241,7 +5235,6 @@ mod tests {
mcp_app_resource_uri: Some("app://connector".into()),
link_id: Some("link_123".into()),
app_name: Some("Calendar".into()),
- template_id: Some("calendar_template".into()),
action_name: Some("create_event".into()),
plugin_id: Some("sample@test".into()),
status: McpToolCallStatus::InProgress,
@@ -5357,7 +5350,6 @@ mod tests {
mcp_app_resource_uri: Some("app://connector".into()),
link_id: Some("link_123".into()),
app_name: Some("Calendar".into()),
- template_id: Some("calendar_template".into()),
action_name: Some("create_event".into()),
plugin_id: Some("sample@test".into()),
status: McpToolCallStatus::Completed,