From 3d21b9420c00f35032f4c084d7820f074eb25f53 Mon Sep 17 00:00:00 2001 From: Tyrone Smith Date: Fri, 18 Apr 2025 11:31:01 -0700 Subject: [PATCH 1/2] fix(amazonq): Do not include references in request history --- packages/core/src/shared/db/chatDb/util.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/core/src/shared/db/chatDb/util.ts b/packages/core/src/shared/db/chatDb/util.ts index 8995db90e8a..696ad0d06cd 100644 --- a/packages/core/src/shared/db/chatDb/util.ts +++ b/packages/core/src/shared/db/chatDb/util.ts @@ -68,7 +68,6 @@ export function messageToChatMessage(msg: Message): ChatMessage { assistantResponseMessage: { messageId: msg.messageId, content: msg.body, - references: msg.codeReference || [], toolUses: msg.toolUses || [], }, } From 84bfb5c428a132d5e5d2e66e580cbff92cf261af Mon Sep 17 00:00:00 2001 From: Tyrone Smith Date: Fri, 18 Apr 2025 11:55:30 -0700 Subject: [PATCH 2/2] feat(amazonq): Update tool spec to restrict `strReplace` to single-line edits only --- packages/core/src/codewhispererChat/tools/tool_index.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/codewhispererChat/tools/tool_index.json b/packages/core/src/codewhispererChat/tools/tool_index.json index 73658d60dac..1d31c2390f3 100644 --- a/packages/core/src/codewhispererChat/tools/tool_index.json +++ b/packages/core/src/codewhispererChat/tools/tool_index.json @@ -22,7 +22,7 @@ }, "fsWrite": { "name": "fsWrite", - "description": "A tool for creating and editing a file.\n * The `create` command will override the file at `path` if it already exists as a file, and otherwise create a new file\n * The `append` command will add content to the end of an existing file, automatically adding a newline if the file doesn't end with one. The file must exist.\n Notes for using the `strReplace` command:\n * The `oldStr` parameter should match EXACTLY one or more consecutive lines from the original file. Be mindful of whitespaces!\n * If the `oldStr` parameter is not unique in the file, the replacement will not be performed. Make sure to include enough context in `oldStr` to make it unique\n * The `newStr` parameter should contain the edited lines that should replace the `oldStr`. The `insert` command will insert `newStr` after `insertLine` and place it on its own line.", + "description": "A tool for creating and editing a file.\n * The `create` command will override the file at `path` if it already exists as a file, and otherwise create a new file\n * The `append` command will add content to the end of an existing file, automatically adding a newline if the file doesn't end with one. The file must exist.\n Notes for using the `strReplace` command:\n * IMPORTANT: For the `fsWrite` tool, only use the `strReplace` command for simple, isolated single-line replacements. If you are editing multiple lines, always prefer the `create` command and replace the entire file content instead.\n * The `oldStr` parameter should match EXACTLY one or more consecutive lines from the original file. Be mindful of whitespaces!\n * If the `oldStr` parameter is not unique in the file, the replacement will not be performed. Make sure to include enough context in `oldStr` to make it unique\n * The `newStr` parameter should contain the edited lines that should replace the `oldStr`. The `insert` command will insert `newStr` after `insertLine` and place it on its own line.", "inputSchema": { "type": "object", "properties": {