From 622e1263d2bb8a20e3561cfc5ce08b5aacb8c6a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Catriel=20M=C3=BCller?= Date: Fri, 1 May 2026 00:51:19 -0300 Subject: [PATCH] refactor: address comments --- packages/kilo-vscode/src/kiloclaw/kilo-chat-client.ts | 5 +++-- packages/opencode/src/kilocode/claw/kilo-chat-client.ts | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/kilo-vscode/src/kiloclaw/kilo-chat-client.ts b/packages/kilo-vscode/src/kiloclaw/kilo-chat-client.ts index 51ddb59ee4d..41ee4dd59d3 100644 --- a/packages/kilo-vscode/src/kiloclaw/kilo-chat-client.ts +++ b/packages/kilo-vscode/src/kiloclaw/kilo-chat-client.ts @@ -128,11 +128,12 @@ export class KiloChatClient { }) const next = prev.then(send, send) this.sendQueues.set(req.conversationId, next) - void next.finally(() => { + const cleanup = () => { if (this.sendQueues.get(req.conversationId) === next) { this.sendQueues.delete(req.conversationId) } - }) + } + void next.then(cleanup, cleanup) return next } diff --git a/packages/opencode/src/kilocode/claw/kilo-chat-client.ts b/packages/opencode/src/kilocode/claw/kilo-chat-client.ts index 7b5c73d7391..af6cdf448b4 100644 --- a/packages/opencode/src/kilocode/claw/kilo-chat-client.ts +++ b/packages/opencode/src/kilocode/claw/kilo-chat-client.ts @@ -119,11 +119,12 @@ export class KiloChatClient { }) const next = prev.then(send, send) this.sendQueues.set(req.conversationId, next) - void next.finally(() => { + const cleanup = () => { if (this.sendQueues.get(req.conversationId) === next) { this.sendQueues.delete(req.conversationId) } - }) + } + void next.then(cleanup, cleanup) return next }