mirror of
https://github.com/openai/codex.git
synced 2026-10-22 17:58:46 +00:00
Merge documented PreToolUse base into PermissionRequest stack
This commit is contained in:
@@ -325,6 +325,9 @@ impl ToolHandler for ApplyPatchHandler {
|
||||
})
|
||||
}
|
||||
|
||||
// Hooks expose apply_patch through the stable `{ "command": ... }` shape,
|
||||
// while the underlying tool stores the patch as either the function
|
||||
// argument `input` or freeform custom-tool input.
|
||||
fn with_updated_hook_input(
|
||||
&self,
|
||||
mut invocation: ToolInvocation,
|
||||
|
||||
@@ -48,6 +48,9 @@ impl ToolHandler for McpHandler {
|
||||
})
|
||||
}
|
||||
|
||||
// MCP hooks expose the full arguments object, so rewrites replace the
|
||||
// serialized raw argument payload wholesale rather than patching one
|
||||
// handler-owned field.
|
||||
fn with_updated_hook_input(
|
||||
&self,
|
||||
mut invocation: ToolInvocation,
|
||||
|
||||
@@ -379,6 +379,8 @@ impl ToolHandler for LocalShellHandler {
|
||||
})
|
||||
}
|
||||
|
||||
// Hooks see a joined shell command string, but local_shell stores argv.
|
||||
// Split on the way back in to invert the hook-facing representation.
|
||||
fn with_updated_hook_input(
|
||||
&self,
|
||||
mut invocation: ToolInvocation,
|
||||
|
||||
@@ -164,6 +164,8 @@ impl ToolHandler for ExecCommandHandler {
|
||||
})
|
||||
}
|
||||
|
||||
// Hooks normalize Bash-like tools to `{ "command": ... }`, while the
|
||||
// exec_command wire schema still names the field `cmd`.
|
||||
fn with_updated_hook_input(
|
||||
&self,
|
||||
mut invocation: ToolInvocation,
|
||||
|
||||
Reference in New Issue
Block a user