Files
oh-my-pi/packages/coding-agent/test/system-prompt.test.ts
T
can1357 e6d33e0a48 feat(coding-agent): converted capability loading and discovery providers to async APIs with caching fs layer
- Converted SettingsManager.create(), loadSettings(), discoverSkills(), loadSlashCommands(), buildSystemPrompt(), loadSkills(), loadProjectContextFiles(), and getShellConfig() from synchronous to asynchronous APIs.
- Changed capability provider load() method from supporting both sync and async to async-only by removing loadSync().
- Removed fs property from LoadContext interface in capability types.
- Added new fs.ts module with caching layer for filesystem operations using readFile, readDirEntries, readDir, walkUp, and cache management functions.
- Refactored all discovery providers (builtin, claude, cline, codex, cursor, gemini, github, mcp-json, ssh, vscode, windsurf) to use async file operations with Promise.all for parallel loading.
2026-01-11 04:26:43 +01:00

42 lines
1.0 KiB
TypeScript

import { describe, expect, test } from "bun:test";
import { buildSystemPrompt } from "../src/core/system-prompt";
describe("buildSystemPrompt", () => {
describe("empty tools", () => {
test("shows (none) for empty tools list", async () => {
const prompt = await buildSystemPrompt({
toolNames: [],
contextFiles: [],
skills: [],
});
// System prompt uses <tools> XML tag format
expect(prompt).toContain("<tools>\n(none)\n</tools>");
});
test("shows file paths guideline even with no tools", async () => {
const prompt = await buildSystemPrompt({
toolNames: [],
contextFiles: [],
skills: [],
});
expect(prompt).toContain("Show file paths clearly");
});
});
describe("default tools", () => {
test("includes all default tools", async () => {
const prompt = await buildSystemPrompt({
contextFiles: [],
skills: [],
});
expect(prompt).toContain("- read:");
expect(prompt).toContain("- bash:");
expect(prompt).toContain("- edit:");
expect(prompt).toContain("- write:");
});
});
});