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.
20 lines
759 B
TypeScript
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');
|
|
});
|