mirror of
https://github.com/openai/codex.git
synced 2026-11-07 20:30:33 +00:00
Preserve executor context for MCP stop hooks (#40012)
## What changed - Scope executor-provided stop-hook calls to the MCP server environment that registered the hook, and reject calls when that environment does not match. - Forward turn metadata with executor stop-hook requests while retaining the hook call's `threadId` metadata. ## Testing - Cover environment matching for MCP tool calls and verify executor stop hooks receive their environment ID and request metadata. GitOrigin-RevId: b544ea3a6ca1f61389fb4597978ed7aac27d529a
This commit is contained in:
committed by
copyberry
parent
8b5beea5c0
commit
ab8768306f
@@ -471,10 +471,12 @@ impl McpRuntime {
|
||||
self.latest_connections().list_all_tools().await
|
||||
}
|
||||
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub async fn latest_call_tool(
|
||||
&self,
|
||||
server: &str,
|
||||
tool: &str,
|
||||
environment_id: Option<&str>,
|
||||
arguments: Option<serde_json::Value>,
|
||||
meta: Option<serde_json::Value>,
|
||||
requested_timeout: Option<Duration>,
|
||||
@@ -484,6 +486,7 @@ impl McpRuntime {
|
||||
.call_tool(
|
||||
server,
|
||||
tool,
|
||||
environment_id,
|
||||
arguments,
|
||||
meta,
|
||||
requested_timeout,
|
||||
|
||||
Reference in New Issue
Block a user