Merge remote-tracking branch 'origin/main' into st/chore/clean-up-memory

# Conflicts:
#	packages/cli/src/config/config.ts
This commit is contained in:
Sandy Tao
2026-05-13 10:14:30 -07:00
91 changed files with 2099 additions and 1197 deletions
@@ -319,6 +319,7 @@ exports[`coreTools snapshots for specific models > Model: gemini-2.5-pro > snaps
},
"context": {
"description": "Show this many lines of context around each match (equivalent to grep -C). Defaults to 0 if omitted.",
"minimum": 0,
"type": "integer",
},
"dir_path": {
@@ -416,7 +417,8 @@ exports[`coreTools snapshots for specific models > Model: gemini-2.5-pro > snaps
"properties": {
"end_line": {
"description": "Optional: The 1-based line number to end reading at (inclusive).",
"type": "number",
"minimum": 1,
"type": "integer",
},
"file_path": {
"description": "The path to the file to read.",
@@ -424,7 +426,8 @@ exports[`coreTools snapshots for specific models > Model: gemini-2.5-pro > snaps
},
"start_line": {
"description": "Optional: The 1-based line number to start reading from.",
"type": "number",
"minimum": 1,
"type": "integer",
},
},
"required": [
@@ -1114,6 +1117,7 @@ exports[`coreTools snapshots for specific models > Model: gemini-3-pro-preview >
},
"context": {
"description": "Show this many lines of context around each match (equivalent to grep -C). Defaults to 0 if omitted.",
"minimum": 0,
"type": "integer",
},
"dir_path": {
@@ -1211,7 +1215,8 @@ exports[`coreTools snapshots for specific models > Model: gemini-3-pro-preview >
"properties": {
"end_line": {
"description": "Optional: The 1-based line number to end reading at (inclusive).",
"type": "number",
"minimum": 1,
"type": "integer",
},
"file_path": {
"description": "The path to the file to read.",
@@ -1219,7 +1224,8 @@ exports[`coreTools snapshots for specific models > Model: gemini-3-pro-preview >
},
"start_line": {
"description": "Optional: The 1-based line number to start reading from.",
"type": "number",
"minimum": 1,
"type": "integer",
},
},
"required": [
@@ -94,12 +94,14 @@ export const DEFAULT_LEGACY_SET: CoreToolSet = {
[READ_FILE_PARAM_START_LINE]: {
description:
'Optional: The 1-based line number to start reading from.',
type: 'number',
type: 'integer',
minimum: 1,
},
[READ_FILE_PARAM_END_LINE]: {
description:
'Optional: The 1-based line number to end reading at (inclusive).',
type: 'number',
type: 'integer',
minimum: 1,
},
},
required: [PARAM_FILE_PATH],
@@ -220,6 +222,7 @@ export const DEFAULT_LEGACY_SET: CoreToolSet = {
description:
'Show this many lines of context around each match (equivalent to grep -C). Defaults to 0 if omitted.',
type: 'integer',
minimum: 0,
},
[GREP_PARAM_AFTER]: {
description:
@@ -103,12 +103,14 @@ export const GEMINI_3_SET: CoreToolSet = {
[READ_FILE_PARAM_START_LINE]: {
description:
'Optional: The 1-based line number to start reading from.',
type: 'number',
type: 'integer',
minimum: 1,
},
[READ_FILE_PARAM_END_LINE]: {
description:
'Optional: The 1-based line number to end reading at (inclusive).',
type: 'number',
type: 'integer',
minimum: 1,
},
},
required: [PARAM_FILE_PATH],
@@ -227,6 +229,7 @@ export const GEMINI_3_SET: CoreToolSet = {
description:
'Show this many lines of context around each match (equivalent to grep -C). Defaults to 0 if omitted.',
type: 'integer',
minimum: 0,
},
[GREP_PARAM_AFTER]: {
description:
+6 -4
View File
@@ -148,18 +148,20 @@ describe('ReadFileTool', () => {
it('should throw error if start_line is less than 1', () => {
const params: ReadFileToolParams = {
file_path: path.join(tempRootDir, 'test.txt'),
file_path: 'test.txt',
start_line: 0,
};
expect(() => tool.build(params)).toThrow('start_line must be at least 1');
expect(() => tool.build(params)).toThrow(
'params/start_line must be >= 1',
);
});
it('should throw error if end_line is less than 1', () => {
const params: ReadFileToolParams = {
file_path: path.join(tempRootDir, 'test.txt'),
file_path: 'test.txt',
end_line: 0,
};
expect(() => tool.build(params)).toThrow('end_line must be at least 1');
expect(() => tool.build(params)).toThrow('params/end_line must be >= 1');
});
it('should throw error if start_line is greater than end_line', () => {
-6
View File
@@ -255,12 +255,6 @@ export class ReadFileTool extends BaseDeclarativeTool<
return validationError;
}
if (params.start_line !== undefined && params.start_line < 1) {
return 'start_line must be at least 1';
}
if (params.end_line !== undefined && params.end_line < 1) {
return 'end_line must be at least 1';
}
if (
params.start_line !== undefined &&
params.end_line !== undefined &&