mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-12 12:54:07 -07:00
Fix test.
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user