mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-15 00:21:09 -07:00
Fix test.
This commit is contained in:
@@ -2017,6 +2017,10 @@ console.log(JSON.stringify({
|
||||
|
||||
// 3. Final setup with full settings
|
||||
rig.setup('Hook Disabling Multiple Ops', {
|
||||
fakeResponsesPath: join(
|
||||
import.meta.dirname,
|
||||
'hooks-system.multiple-ops.responses',
|
||||
),
|
||||
settings: {
|
||||
hooksConfig: {
|
||||
enabled: true,
|
||||
|
||||
@@ -76,6 +76,7 @@ export async function executeToolWithHooks(
|
||||
setExecutionIdCallback?: (executionId: number) => void,
|
||||
config?: Config,
|
||||
originalRequestName?: string,
|
||||
skipBeforeHook?: boolean,
|
||||
): Promise<ToolResult> {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
||||
const toolInput = (invocation.params || {}) as Record<string, unknown>;
|
||||
@@ -86,7 +87,7 @@ export async function executeToolWithHooks(
|
||||
const mcpContext = config ? extractMcpContext(invocation, config) : undefined;
|
||||
const hookSystem = config?.getHookSystem();
|
||||
|
||||
if (hookSystem) {
|
||||
if (hookSystem && !skipBeforeHook) {
|
||||
const beforeOutput = await hookSystem.fireBeforeToolEvent(
|
||||
toolName,
|
||||
toolInput,
|
||||
|
||||
@@ -116,6 +116,7 @@ export class ToolExecutor {
|
||||
setExecutionIdCallback,
|
||||
this.config,
|
||||
request.originalRequestName,
|
||||
true, // skipBeforeHook
|
||||
);
|
||||
|
||||
const toolResult: ToolResult = await promise;
|
||||
|
||||
Reference in New Issue
Block a user