Fix test.

This commit is contained in:
Christian Gunderman
2026-03-13 16:17:38 -07:00
parent 3effa0f998
commit 576bf204ba
3 changed files with 7 additions and 1 deletions
+4
View File
@@ -2017,6 +2017,10 @@ console.log(JSON.stringify({
// 3. Final setup with full settings // 3. Final setup with full settings
rig.setup('Hook Disabling Multiple Ops', { rig.setup('Hook Disabling Multiple Ops', {
fakeResponsesPath: join(
import.meta.dirname,
'hooks-system.multiple-ops.responses',
),
settings: { settings: {
hooksConfig: { hooksConfig: {
enabled: true, enabled: true,
@@ -76,6 +76,7 @@ export async function executeToolWithHooks(
setExecutionIdCallback?: (executionId: number) => void, setExecutionIdCallback?: (executionId: number) => void,
config?: Config, config?: Config,
originalRequestName?: string, originalRequestName?: string,
skipBeforeHook?: boolean,
): Promise<ToolResult> { ): Promise<ToolResult> {
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
const toolInput = (invocation.params || {}) as Record<string, unknown>; const toolInput = (invocation.params || {}) as Record<string, unknown>;
@@ -86,7 +87,7 @@ export async function executeToolWithHooks(
const mcpContext = config ? extractMcpContext(invocation, config) : undefined; const mcpContext = config ? extractMcpContext(invocation, config) : undefined;
const hookSystem = config?.getHookSystem(); const hookSystem = config?.getHookSystem();
if (hookSystem) { if (hookSystem && !skipBeforeHook) {
const beforeOutput = await hookSystem.fireBeforeToolEvent( const beforeOutput = await hookSystem.fireBeforeToolEvent(
toolName, toolName,
toolInput, toolInput,
@@ -116,6 +116,7 @@ export class ToolExecutor {
setExecutionIdCallback, setExecutionIdCallback,
this.config, this.config,
request.originalRequestName, request.originalRequestName,
true, // skipBeforeHook
); );
const toolResult: ToolResult = await promise; const toolResult: ToolResult = await promise;