Skip to content

Commit 63a28b8

Browse files
authored
Merge pull request aws#7013 from jguoamz/toolSize
fix(chat): Reduce maxToolResponseSize from 800K to 200K
2 parents 9e88de6 + 5a44253 commit 63a28b8

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-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: 5 additions & 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 4000 lines at once, for example: after reading [1, 4000], read [4000, 8000] next and repeat.",
1414
"items": {
1515
"type": "integer"
1616
},
@@ -26,6 +26,10 @@
2626
"inputSchema": {
2727
"type": "object",
2828
"properties": {
29+
"explanation": {
30+
"description": "One sentence explanation as to why this tool is being used, and how it contributes to the goal.",
31+
"type": "string"
32+
},
2933
"command": {
3034
"type": "string",
3135
"enum": ["create", "strReplace", "insert", "append"],

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)