Skip to content

Commit 6492e9a

Browse files
committed
Adding comments
1 parent 6d776ad commit 6492e9a

File tree

2 files changed

+4
-18
lines changed

2 files changed

+4
-18
lines changed

packages/core/src/codewhispererChat/clients/chat/v0/chat.ts

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export class ChatSession {
3737
* _showDiffOnFileWrite = Controls whether to show diff view (true) or file context view (false) to the user
3838
* _context = Additional context to be passed to the LLM for generating the response
3939
* _messageIdToUpdate = messageId of a chat message to be updated, used for reducing consecutive tool messages
40+
* _messageOperations = Maps messageId to filePaths which helps to open the read files and to open the code diff accordingly.
4041
*/
4142
private _toolUseWithError: ToolUseWithError | undefined
4243
private _showDiffOnFileWrite: boolean = false
@@ -187,7 +188,7 @@ export class ChatSession {
187188
/**
188189
* Adds a file operation for a specific message
189190
* @param messageId The ID of the message
190-
* @param type The type of operation ('read' or 'write')
191+
* @param type The type of operation ('read' or 'listDir' or 'write')
191192
* @param filePaths Array of DocumentReference involved in the operation
192193
*/
193194
public addMessageOperation(messageId: string, type: OperationType, filePaths: DocumentReference[]) {
@@ -220,19 +221,4 @@ export class ChatSession {
220221
public getOperationTypeByMessageId(messageId: string): OperationType | undefined {
221222
return this._messageOperations.get(messageId)?.type
222223
}
223-
224-
/**
225-
* Clears the operation for a specific message
226-
* @param messageId The ID of the message
227-
*/
228-
public clearMessageOperation(messageId: string) {
229-
this._messageOperations.delete(messageId)
230-
}
231-
232-
/**
233-
* Clears all message operations
234-
*/
235-
public clearAllMessageOperations() {
236-
this._messageOperations.clear()
237-
}
238224
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,7 +1317,7 @@ export class ChatController {
13171317
this.processException(e, message.tabID)
13181318
}
13191319
}
1320-
private sessionCleanUp(session: ChatSession) {
1320+
private initialCleanUp(session: ChatSession) {
13211321
// Create a fresh token for this new conversation
13221322
session.createNewTokenSource()
13231323
session.setAgenticLoopInProgress(true)
@@ -1332,7 +1332,7 @@ export class ChatController {
13321332
if (session.agenticLoopInProgress) {
13331333
session.disposeTokenSource()
13341334
}
1335-
this.sessionCleanUp(session)
1335+
this.initialCleanUp(session)
13361336
this.editorContextExtractor
13371337
.extractContextForTrigger('ChatMessage')
13381338
.then(async (context) => {

0 commit comments

Comments
 (0)