Skip to content

Commit 8b53de4

Browse files
authored
fix(chat): Add session context for the agentic loop (aws#7004)
## Problem - Session context is missing for the follow ups in the agentic loop - Bug in parsing toolUseInput which causes JSON.parse error ## Solution - Add session context for the agentic loop - Fixed the bug in parsing toolUseInput --- - Treat all work as PUBLIC. Private `feature/x` branches will not be squash-merged at release time. - Your code changes must meet the guidelines in [CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines). - License: I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 5f8d9e5 commit 8b53de4

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

packages/core/src/codewhispererChat/controllers/chat/controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ export class ChatController {
776776
toolResults: toolResults,
777777
profile: AuthUtil.instance.regionProfileManager.activeRegionProfile,
778778
origin: Origin.IDE,
779-
context: [],
779+
context: session.context ?? [],
780780
relevantTextDocuments: [],
781781
additionalContents: [],
782782
documentReferences: [],

packages/core/src/codewhispererChat/controllers/chat/messenger/messenger.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -257,11 +257,7 @@ export class Messenger {
257257
}
258258

259259
const cwChatEvent: cwChatResponseStream = chatEvent
260-
if (
261-
cwChatEvent.toolUseEvent?.input !== undefined &&
262-
cwChatEvent.toolUseEvent.input.length > 0 &&
263-
!cwChatEvent.toolUseEvent.stop
264-
) {
260+
if (cwChatEvent.toolUseEvent?.input !== undefined && cwChatEvent.toolUseEvent.input.length > 0) {
265261
toolUseInput += cwChatEvent.toolUseEvent.input
266262
}
267263

0 commit comments

Comments
 (0)