interruptions work

This commit is contained in:
Andrew Pareles 2025-04-29 00:25:16 -07:00
parent 58804620f7
commit 413be993d8

View file

@ -485,10 +485,6 @@ class ChatThreadService extends Disposable implements IChatThreadService {
const thread = this.state.allThreads[threadId]
if (!thread) return // should never happen
// interrupt any effects
const interrupt = await this.streamState[threadId]?.interrupt
interrupt?.()
// add assistant message
if (this.streamState[threadId]?.isRunning === 'LLM') {
const { displayContentSoFar, reasoningSoFar, toolCallSoFar } = this.streamState[threadId].llmInfo
@ -506,6 +502,11 @@ class ChatThreadService extends Disposable implements IChatThreadService {
this.rejectLatestToolRequest(threadId)
}
// interrupt any effects
const interrupt = await this.streamState[threadId]?.interrupt
interrupt?.()
this._setStreamState(threadId, undefined)
}