Files
shiro-neko/test/prompt-workspace.test.ts
asepharyana 0bdf642672
ci / check (macos-latest) (push) Canceled after 0s
ci / check (ubuntu-latest) (push) Canceled after 0s
ci / check (windows-latest) (push) Canceled after 0s
prompt: inject full ignore-aware file list at boot (gitignore-respected, capped 5000)
walk() at boot -> Session.workspaceFiles -> systemPrompt Environment
section + subagent system prompts. read_many_files still on-demand,
but the agent now sees the tree without a tool call.
2026-09-09 14:19:29 +07:00

20 lines
759 B
TypeScript

import { expect, test } from 'bun:test';
import { systemPrompt } from '../src/prompt';
test('workspaceFiles are injected gitignore-style when provided', () => {
const prompt = systemPrompt({ cwd: '/repo', workspaceFiles: ['src/app.ts', 'README.md'] });
expect(prompt).toContain('Workspace files (2, gitignore-respected');
expect(prompt).toContain('src/app.ts');
expect(prompt).toContain('README.md');
});
test('workspaceFiles omitted when empty', () => {
const prompt = systemPrompt({ cwd: '/repo', workspaceFiles: [] });
expect(prompt).not.toContain('Workspace files');
});
test('workspaceFiles undefined leaves prompt unchanged', () => {
const prompt = systemPrompt({ cwd: '/repo' });
expect(prompt).not.toContain('Workspace files');
});