mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-17 15:23:08 -07:00
fix(a2a-server): replace ApprovalMode.YOLO with wildcard policy check
This commit is contained in:
@@ -10,7 +10,6 @@ import {
|
||||
type GeminiClient,
|
||||
GeminiEventType,
|
||||
ToolConfirmationOutcome,
|
||||
ApprovalMode,
|
||||
getAllMCPServerStatuses,
|
||||
MCPServerStatus,
|
||||
isNodeError,
|
||||
@@ -89,7 +88,8 @@ export class Task {
|
||||
autoExecute: boolean;
|
||||
private get isYoloMatch(): boolean {
|
||||
return (
|
||||
this.autoExecute || this.config.getApprovalMode() === ApprovalMode.YOLO
|
||||
this.autoExecute ||
|
||||
(this.config.getAllowedTools()?.includes('*') ?? false)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -880,9 +880,7 @@ export class Task {
|
||||
if (
|
||||
part.kind !== 'data' ||
|
||||
!part.data ||
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
typeof part.data['callId'] !== 'string' ||
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
typeof part.data['outcome'] !== 'string'
|
||||
) {
|
||||
return false;
|
||||
|
||||
@@ -121,6 +121,7 @@ describe('E2E Tests', () => {
|
||||
beforeEach(() => {
|
||||
getApprovalModeSpy.mockReturnValue(ApprovalMode.DEFAULT);
|
||||
getAllowedToolsSpy.mockReturnValue([]);
|
||||
getAllowedToolsSpy.mockReturnValue([]);
|
||||
});
|
||||
|
||||
afterAll(
|
||||
|
||||
@@ -4033,7 +4033,6 @@ describe('InputPrompt', () => {
|
||||
unmount();
|
||||
});
|
||||
|
||||
|
||||
it('should not show inverted cursor when shell is focused', async () => {
|
||||
props.isEmbeddedShellFocused = true;
|
||||
props.focus = false;
|
||||
|
||||
@@ -106,12 +106,10 @@ const MockedGeminiClientClass = vi.hoisted(() =>
|
||||
);
|
||||
|
||||
const MockedUserPromptEvent = vi.hoisted(() =>
|
||||
vi
|
||||
.fn()
|
||||
.mockImplementation(() => ({
|
||||
toLogBody: vi.fn(),
|
||||
toOpenTelemetryAttributes: vi.fn(),
|
||||
})),
|
||||
vi.fn().mockImplementation(() => ({
|
||||
toLogBody: vi.fn(),
|
||||
toOpenTelemetryAttributes: vi.fn(),
|
||||
})),
|
||||
);
|
||||
const mockParseAndFormatApiError = vi.hoisted(() => vi.fn());
|
||||
const mockIsBackgroundExecutionData = vi.hoisted(
|
||||
|
||||
Reference in New Issue
Block a user