mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-12 12:54:07 -07:00
Polish: Move 'Failed to load skills' warning to debug logs (#16142)
This commit is contained in:
@@ -10,6 +10,7 @@ import * as os from 'node:os';
|
||||
import * as path from 'node:path';
|
||||
import { loadSkillsFromDir } from './skillLoader.js';
|
||||
import { coreEvents } from '../utils/events.js';
|
||||
import { debugLogger } from '../utils/debugLogger.js';
|
||||
|
||||
describe('skillLoader', () => {
|
||||
let testRootDir: string;
|
||||
@@ -19,6 +20,7 @@ describe('skillLoader', () => {
|
||||
path.join(os.tmpdir(), 'skill-loader-test-'),
|
||||
);
|
||||
vi.spyOn(coreEvents, 'emitFeedback');
|
||||
vi.spyOn(debugLogger, 'debug').mockImplementation(() => {});
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
@@ -53,8 +55,7 @@ describe('skillLoader', () => {
|
||||
const skills = await loadSkillsFromDir(testRootDir);
|
||||
|
||||
expect(skills).toHaveLength(0);
|
||||
expect(coreEvents.emitFeedback).toHaveBeenCalledWith(
|
||||
'warning',
|
||||
expect(debugLogger.debug).toHaveBeenCalledWith(
|
||||
expect.stringContaining('Failed to load skills from'),
|
||||
);
|
||||
});
|
||||
@@ -89,8 +90,7 @@ describe('skillLoader', () => {
|
||||
const skills = await loadSkillsFromDir(testRootDir);
|
||||
|
||||
expect(skills).toHaveLength(0);
|
||||
expect(coreEvents.emitFeedback).toHaveBeenCalledWith(
|
||||
'warning',
|
||||
expect(debugLogger.debug).toHaveBeenCalledWith(
|
||||
expect.stringContaining('Failed to load skills from'),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -60,8 +60,7 @@ export async function loadSkillsFromDir(
|
||||
if (discoveredSkills.length === 0) {
|
||||
const files = await fs.readdir(absoluteSearchPath);
|
||||
if (files.length > 0) {
|
||||
coreEvents.emitFeedback(
|
||||
'warning',
|
||||
debugLogger.debug(
|
||||
`Failed to load skills from ${absoluteSearchPath}. The directory is not empty but no valid skills were discovered. Please ensure SKILL.md files are present in subdirectories and have valid frontmatter.`,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user