Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/agents/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,14 +395,14 @@ async function injectSyntheticCalls(
const auListResult = (await auList.execute({
comment: 'Pre-fetching AU entries for context',
path: '.',
maxDepth: 5,
maxDepth: 10,
})) as string;
// Only inject if there's actual content
if (auListResult && !auListResult.includes('No AU entries found')) {
recordSyntheticInvocationId(trackingContext, 'gc_au_list');
builder = builder.withSyntheticGadgetCall(
'AUList',
{ comment: 'Pre-fetching AU entries for context', path: '.', maxDepth: 5 },
{ comment: 'Pre-fetching AU entries for context', path: '.', maxDepth: 10 },
auListResult,
'gc_au_list',
);
Expand Down
30 changes: 15 additions & 15 deletions src/gadgets/ReadFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,42 +66,42 @@ Allowed paths:
showLineNumbers: z
.boolean()
.optional()
.default(false)
.default(true)
.describe('If true, prefix each line with its 1-based line number (e.g., " 1 | content")'),
}),
examples: [
{
params: {
comment: 'Reading config to understand project structure',
filePath: 'package.json',
showLineNumbers: false,
comment: 'Reading source file to understand implementation',
filePath: 'src/utils.ts',
showLineNumbers: true,
},
output: 'path=package.json\n\n{\n "name": "my-project",\n "version": "1.0.0"\n ...\n}',
comment: 'Read a JSON config file',
output:
'path=src/utils.ts\n\n 1 | export function add(a: number, b: number) {\n 2 | return a + b;\n 3 | }',
comment: 'Default behavior includes line numbers for precise editing',
},
{
params: {
comment: 'Checking test output for failures',
filePath: '/tmp/test.log',
showLineNumbers: false,
showLineNumbers: true,
},
output: 'path=/tmp/test.log\n\n[Test output...]',
output: 'path=/tmp/test.log\n\n 1 | PASS src/utils.test.ts\n 2 | ✓ adds numbers correctly',
comment: 'Read a test log from /tmp',
},
{
params: {
comment: 'Reading with line numbers for precise editing',
filePath: 'src/utils.ts',
showLineNumbers: true,
comment: 'Reading config without line numbers',
filePath: 'package.json',
showLineNumbers: false,
},
output:
'path=src/utils.ts\n\n 1 | export function add(a: number, b: number) {\n 2 | return a + b;\n 3 | }',
comment: 'Read with line numbers for insert_at_line or remove_lines operations',
output: 'path=package.json\n\n{\n "name": "my-project",\n "version": "1.0.0"\n ...\n}',
comment: 'Disable line numbers for cleaner JSON/config output',
},
],
}) {
override execute(params: this['params']): string {
const { filePath, showLineNumbers = false } = params;
const { filePath, showLineNumbers = true } = params;
const validatedPath = validatePath(filePath);

// Check if already read in this session (content is in context)
Expand Down