Polish: Move 'Failed to load skills' warning to debug logs (#16142)

This commit is contained in:
N. Taylor Mullen
2026-01-08 03:38:47 -08:00
committed by GitHub
parent 3e2f4eb8ba
commit 722c4933dc
3 changed files with 11 additions and 15 deletions
@@ -12,7 +12,7 @@ import { ExtensionManager } from './extension-manager.js';
import { loadSettings } from './settings.js';
import { createExtension } from '../test-utils/createExtension.js';
import { EXTENSIONS_DIRECTORY_NAME } from './extensions/variables.js';
import { coreEvents } from '@google/gemini-cli-core';
import { coreEvents, debugLogger } from '@google/gemini-cli-core';
const mockHomedir = vi.hoisted(() => vi.fn());
@@ -58,6 +58,7 @@ describe('ExtensionManager skills validation', () => {
settings: loadSettings(tempWorkspaceDir).merged,
});
vi.spyOn(coreEvents, 'emitFeedback');
vi.spyOn(debugLogger, 'debug').mockImplementation(() => {});
});
afterEach(() => {
@@ -83,8 +84,7 @@ describe('ExtensionManager skills validation', () => {
});
expect(extension.name).toBe('skills-ext');
expect(coreEvents.emitFeedback).toHaveBeenCalledWith(
'warning',
expect(debugLogger.debug).toHaveBeenCalledWith(
expect.stringContaining('Failed to load skills from'),
);
});
@@ -102,12 +102,10 @@ describe('ExtensionManager skills validation', () => {
await extensionManager.loadExtensions();
expect(coreEvents.emitFeedback).toHaveBeenCalledWith(
'warning',
expect(debugLogger.debug).toHaveBeenCalledWith(
expect.stringContaining('Failed to load skills from'),
);
expect(coreEvents.emitFeedback).toHaveBeenCalledWith(
'warning',
expect(debugLogger.debug).toHaveBeenCalledWith(
expect.stringContaining(
'The directory is not empty but no valid skills were discovered',
),
@@ -139,8 +137,7 @@ describe('ExtensionManager skills validation', () => {
expect(extension.skills![0].name).toBe('test-skill');
// It might be called for other reasons during startup, but shouldn't be called for our skills loading success
// Actually, it shouldn't be called with our warning message
expect(coreEvents.emitFeedback).not.toHaveBeenCalledWith(
'warning',
expect(debugLogger.debug).not.toHaveBeenCalledWith(
expect.stringContaining('Failed to load skills from'),
);
});