interruptions work

This commit is contained in:
Andrew Pareles
2025-04-29 00:25:16 -07:00
parent af64d8d123
commit a0930cdf7d
@@ -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)
}