Skip to content

Commit f81a3b5

Browse files
committed
fix(chat): Reduce maxToolResponseSize from 800K to 200K
1 parent 4e0659c commit f81a3b5

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

packages/core/src/codewhispererChat/tools/toolShared.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import path from 'path'
77
import fs from '../../shared/fs/fs'
88

9-
export const maxToolResponseSize = 800_000
9+
export const maxToolResponseSize = 200_000
1010

1111
export enum OutputKind {
1212
Text = 'text',

packages/core/src/codewhispererChat/tools/tool_index.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"type": "string"
1111
},
1212
"readRange": {
13-
"description": "Optional parameter when reading files.\n * If none is given, the full file is shown. If provided, the file will be shown in the indicated line number range, e.g. [11, 12] will show lines 11 and 12. Indexing at 1 to start. Setting `[startLine, -1]` shows all lines from `startLine` to the end of the file.",
13+
"description": "Optional parameter when reading files.\n * If none is given, the full file is shown. If provided, the file will be shown in the indicated line number range, e.g. [11, 12] will show lines 11 and 12. Indexing at 1 to start. Setting `[startLine, -1]` shows all lines from `startLine` to the end of the file. If the whole file is too large, try reading every 2000 lines, for example: [ 0, 2000 ], [ 2000, 4000 ].",
1414
"items": {
1515
"type": "integer"
1616
},

packages/core/src/test/codewhispererChat/tools/toolShared.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ describe('ToolUtils', function () {
162162
const output: InvokeOutput = {
163163
output: {
164164
kind: OutputKind.Text,
165-
content: 'a'.repeat(700_000),
165+
content: 'a'.repeat(150_000),
166166
},
167167
}
168168
assert.doesNotThrow(() => ToolUtils.validateOutput(output))
@@ -171,12 +171,12 @@ describe('ToolUtils', function () {
171171
const output: InvokeOutput = {
172172
output: {
173173
kind: OutputKind.Text,
174-
content: 'a'.repeat(900_000), // 900,000 characters
174+
content: 'a'.repeat(200_001), // 200,001 characters
175175
},
176176
}
177177
assert.throws(() => ToolUtils.validateOutput(output), {
178178
name: 'Error',
179-
message: 'Tool output exceeds maximum character limit of 800000',
179+
message: 'Tool output exceeds maximum character limit of 200000',
180180
})
181181
})
182182
})

0 commit comments

Comments
 (0)