Skip to content

Commit 97c4815

Browse files
committed
fix task agent performance issues
1 parent 7d1a166 commit 97c4815

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

packages/opencode/src/session/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ export namespace Session {
584584
break
585585

586586
case "tool-call-delta":
587-
break
587+
continue
588588

589589
// for some reason ai sdk claims to not send this part but it does
590590
// @ts-expect-error
@@ -619,6 +619,7 @@ export namespace Session {
619619
l.info("unhandled", {
620620
type: value.type,
621621
})
622+
continue
622623
}
623624
await updateMessage(next)
624625
}

packages/opencode/src/tool/task.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,16 @@ export const TaskTool = Tool.define({
3434
}
3535

3636
const unsub = Bus.subscribe(Message.Event.Updated, async (evt) => {
37-
if (evt.properties.info.metadata.sessionID !== ctx.sessionID) return
37+
if (evt.properties.info.metadata.sessionID !== session.id) return
3838
ctx.metadata({
3939
title: params.description,
4040
summary: summary(evt.properties.info),
4141
})
4242
})
4343

44+
ctx.abort.addEventListener("abort", () => {
45+
Session.abort(session.id)
46+
})
4447
const result = await Session.chat({
4548
sessionID: session.id,
4649
modelID: metadata.modelID,

0 commit comments

Comments
 (0)