Skip to content

Commit 5ac03e7

Browse files
committed
Fix for fsWrite accept failures and chatHistory setup.
1 parent 9b5cef6 commit 5ac03e7

File tree

2 files changed

+1
-32
lines changed

2 files changed

+1
-32
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ export class Messenger {
295295
}
296296
return true
297297
},
298-
{ timeout: 60000, truthy: true }
298+
{ timeout: 600000, truthy: true }
299299
)
300300
.catch((error: any) => {
301301
let errorMessage = 'Error reading chat stream.'

packages/core/src/codewhispererChat/storages/chatHistory.ts

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -188,37 +188,6 @@ export class ChatHistoryManager {
188188
return newUserMessage
189189
}
190190
}
191-
} else {
192-
if (
193-
newUserMessage.userInputMessage?.userInputMessageContext?.toolResults &&
194-
newUserMessage.userInputMessage?.userInputMessageContext?.toolResults.length > 0
195-
) {
196-
// correct toolUse section of lastAssistantResponse in case of empty toolUse for user message with tool Results.
197-
const toolResults = newUserMessage.userInputMessage.userInputMessageContext.toolResults
198-
const updatedToolUses = toolResults.map((toolResult) => ({
199-
toolUseId: toolResult.toolUseId,
200-
name: lastHistoryMessage.assistantResponseMessage.toolUses?.find(
201-
(tu) => tu.toolUseId === toolResult.toolUseId
202-
)?.name,
203-
input: lastHistoryMessage.assistantResponseMessage.toolUses?.find(
204-
(tu) => tu.toolUseId === toolResult.toolUseId
205-
)?.input,
206-
}))
207-
208-
// Create a new assistant response message with updated toolUses
209-
const updatedAssistantResponseMessage = {
210-
...lastHistoryMessage.assistantResponseMessage,
211-
toolUses: updatedToolUses,
212-
}
213-
214-
// Create a new chat message with the updated assistant response
215-
const updatedChatMessage: ChatMessage = {
216-
assistantResponseMessage: updatedAssistantResponseMessage,
217-
}
218-
219-
// Replace the last message in history
220-
this.history[this.history.length - 1] = updatedChatMessage
221-
}
222191
}
223192
}
224193

0 commit comments

Comments
 (0)