prompt: inject full ignore-aware file list at boot (gitignore-respected, capped 5000)
ci / check (macos-latest) (push) Canceled after 0s
ci / check (ubuntu-latest) (push) Canceled after 0s
ci / check (windows-latest) (push) Canceled after 0s

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.
This commit is contained in:
asepharyana
2026-09-09 14:19:29 +07:00
parent b7c3490993
commit 0bdf642672
5 changed files with 44 additions and 2 deletions
+19
View File
@@ -0,0 +1,19 @@
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');
});