fix: wire before_tool_call hook into tool execution (#6570) (thanks @ryancnelson) (#6660)

This commit is contained in:
Peter Steinberger
2026-02-01 14:52:11 -08:00
committed by GitHub
parent 6c6f1e9660
commit 8eb11bd304
9 changed files with 317 additions and 491 deletions

View File

@@ -443,9 +443,16 @@ export async function runEmbeddedAttempt(
// Add client tools (OpenResponses hosted tools) to customTools
let clientToolCallDetected: { name: string; params: Record<string, unknown> } | null = null;
const clientToolDefs = params.clientTools
? toClientToolDefinitions(params.clientTools, (toolName, toolParams) => {
clientToolCallDetected = { name: toolName, params: toolParams };
})
? toClientToolDefinitions(
params.clientTools,
(toolName, toolParams) => {
clientToolCallDetected = { name: toolName, params: toolParams };
},
{
agentId: sessionAgentId,
sessionKey: params.sessionKey,
},
)
: [];
const allCustomTools = [...customTools, ...clientToolDefs];