mirror of
https://github.com/openai/codex.git
synced 2026-11-13 14:46:14 +00:00
Scope MCP app resource reads to their originating call (#39187)
## Why App widgets need to read resources using the app and account context of the tool call that produced them, including after a thread is restored. ## What changed - Add an optional `originCallId` to `mcpServer/resource/read` requests and return it on successful scoped reads. - Track bounded provenance for successful app tool calls in thread history and use the current tool binding, account link, and app policy when reading the associated widget resource. - Reject missing, mismatched, failed, or ambiguous origins, while keeping app-only tools available for widget reads without exposing them to the model. ## Testing Add app-server coverage for scoped widget reads across both history modes, ephemeral and persistent threads, server restarts, app-only visibility, and invalid origin cases. GitOrigin-RevId: 11eaefc066b2a3b639599e4cbdef680233d150a2
This commit is contained in:
1 parent
711a5f8b3a
commit
880f1135ea
26 files changed
+779
-22
No files matched your search
@@ -1223,6 +1223,11 @@ impl Session {
|
||||
let mcp_runtime = Arc::new(McpRuntime::empty(
|
||||
mcp_projection.config.prefix_mcp_tool_names,
|
||||
));
|
||||
for item in initial_history.get_rollout_items() {
|
||||
if let RolloutItem::EventMsg(event) = item {
|
||||
mcp_runtime.observe_event(event);
|
||||
}
|
||||
}
|
||||
let session_extension_data =
|
||||
codex_extension_api::ExtensionData::new(session_id.to_string());
|
||||
session_extension_data.insert(analytics_events_client.clone());
|
||||
|
||||
Reference in new issue
Block a user