feat: prioritize batched reads for turn efficiency
Move read_many_files to core tool set so it is always offered. Strengthen system-prompt guidance: read_file now redirects to read_many_files for multiple files, read_many_files is framed as the primary reading tool with an explicit batch range (2-20). Add a 'How to work' rule on read efficiency, and a read-batching instruction in the deep agent variant. 861 tests pass; build clean.
This commit is contained in:
@@ -10,6 +10,18 @@ test('every documented tool has usable guidance', () => {
|
||||
}
|
||||
});
|
||||
|
||||
test('read guidance steers the model to batch reads for efficiency', () => {
|
||||
const readMany = TOOL_DOCS.find((d) => d.name === 'read_many_files');
|
||||
const readOne = TOOL_DOCS.find((d) => d.name === 'read_file');
|
||||
expect(readMany?.line).toContain('batch');
|
||||
expect(readMany?.line).toContain('read_file');
|
||||
expect(readOne?.line).toContain('read_many_files');
|
||||
// The "How to work" block also instructs batched reading.
|
||||
const prompt = systemPrompt({ cwd: '/repo', availableTools: ['read_file', 'read_many_files'] });
|
||||
expect(prompt).toContain('Read efficiently');
|
||||
expect(prompt).toContain('read_many_files');
|
||||
});
|
||||
|
||||
test('only the offered tools are described', () => {
|
||||
const rendered = renderTools(['read_file', 'grep']);
|
||||
expect(rendered).toContain('read_file');
|
||||
|
||||
Reference in New Issue
Block a user