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
+4 -4
View File
@@ -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'),
);
});
+1 -2
View File
@@ -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.`,
);
}