mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-15 08:31:14 -07:00
Linter rules.
This commit is contained in:
@@ -134,7 +134,7 @@ export class CoreToolScheduler {
|
||||
this.onAllToolCallsComplete = options.onAllToolCallsComplete;
|
||||
this.onToolCallsUpdate = options.onToolCallsUpdate;
|
||||
this.getPreferredEditor = options.getPreferredEditor;
|
||||
this.toolExecutor = new ToolExecutor(this.context.config);
|
||||
this.toolExecutor = new ToolExecutor(this.context);
|
||||
this.toolModifier = new ToolModificationHandler();
|
||||
|
||||
// Subscribe to message bus for ASK_USER policy decisions
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
import { describe, it, expect, vi } from 'vitest';
|
||||
import { CoreToolScheduler } from './coreToolScheduler.js';
|
||||
import type { ToolCall, ErroredToolCall } from '../scheduler/types.js';
|
||||
import type { Config, ToolRegistry } from '../index.js';
|
||||
import type { Config, ToolRegistry, AgentLoopContext } from '../index.js';
|
||||
import {
|
||||
ApprovalMode,
|
||||
DEFAULT_TRUNCATE_TOOL_OUTPUT_THRESHOLD,
|
||||
@@ -118,7 +118,11 @@ describe('CoreToolScheduler Hooks', () => {
|
||||
|
||||
const onAllToolCallsComplete = vi.fn();
|
||||
const scheduler = new CoreToolScheduler({
|
||||
config: mockConfig,
|
||||
context: {
|
||||
config: mockConfig,
|
||||
messageBus: mockMessageBus,
|
||||
toolRegistry,
|
||||
} as unknown as AgentLoopContext,
|
||||
onAllToolCallsComplete,
|
||||
getPreferredEditor: () => 'vscode',
|
||||
});
|
||||
@@ -188,7 +192,11 @@ describe('CoreToolScheduler Hooks', () => {
|
||||
|
||||
const onAllToolCallsComplete = vi.fn();
|
||||
const scheduler = new CoreToolScheduler({
|
||||
config: mockConfig,
|
||||
context: {
|
||||
config: mockConfig,
|
||||
messageBus: mockMessageBus,
|
||||
toolRegistry,
|
||||
} as unknown as AgentLoopContext,
|
||||
onAllToolCallsComplete,
|
||||
getPreferredEditor: () => 'vscode',
|
||||
});
|
||||
@@ -261,7 +269,11 @@ describe('CoreToolScheduler Hooks', () => {
|
||||
|
||||
const onAllToolCallsComplete = vi.fn();
|
||||
const scheduler = new CoreToolScheduler({
|
||||
config: mockConfig,
|
||||
context: {
|
||||
config: mockConfig,
|
||||
messageBus: mockMessageBus,
|
||||
toolRegistry,
|
||||
} as unknown as AgentLoopContext,
|
||||
onAllToolCallsComplete,
|
||||
getPreferredEditor: () => 'vscode',
|
||||
});
|
||||
|
||||
@@ -584,7 +584,6 @@ export class Scheduler {
|
||||
this.state.updateStatus(
|
||||
callId,
|
||||
CoreToolCallStatus.Error,
|
||||
signal,
|
||||
createErrorResponse(
|
||||
toolCall.request,
|
||||
hookResult.error,
|
||||
|
||||
@@ -18,7 +18,6 @@ import { buildParamArgsPattern } from '../policy/utils.js';
|
||||
import type { MessageBus } from '../confirmation-bus/message-bus.js';
|
||||
import { ToolErrorType } from './tool-error.js';
|
||||
import { getErrorMessage } from '../utils/errors.js';
|
||||
import { ApprovalMode } from '../policy/types.js';
|
||||
import { getResponseText } from '../utils/partUtils.js';
|
||||
import { fetchWithTimeout, isPrivateIp } from '../utils/fetch.js';
|
||||
import { truncateString } from '../utils/textUtils.js';
|
||||
@@ -465,11 +464,6 @@ ${aggregatedContent}
|
||||
protected override async getConfirmationDetails(
|
||||
_abortSignal: AbortSignal,
|
||||
): Promise<ToolCallConfirmationDetails | false> {
|
||||
// Check for AUTO_EDIT approval mode. This tool has a specific behavior
|
||||
// where ProceedAlways switches the entire session to AUTO_EDIT.
|
||||
if (this.context.config.getApprovalMode() === ApprovalMode.AUTO_EDIT) {
|
||||
return false;
|
||||
}
|
||||
let urls: string[] = [];
|
||||
let prompt = this.params.prompt || '';
|
||||
|
||||
@@ -878,7 +872,7 @@ export class WebFetchTool extends BaseDeclarativeTool<
|
||||
_toolDisplayName?: string,
|
||||
): ToolInvocation<WebFetchToolParams, ToolResult> {
|
||||
return new WebFetchToolInvocation(
|
||||
this.context.config,
|
||||
this.context,
|
||||
params,
|
||||
messageBus,
|
||||
_toolName,
|
||||
|
||||
Reference in New Issue
Block a user