mirror of
https://gitee.com/zhangsken/opencode.git
synced 2026-10-16 10:30:01 +08:00
fix(core): skip tracing streamed LLM deltas (#45761)
Co-authored-by: jlongster <17031+jlongster@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
8381153418
commit
5d4ce14dc4
@@ -378,7 +378,7 @@ export const createLLMEventPublisher = (bus: Pick<Bus.Interface, "publish">, inp
|
||||
(error: SessionError.Error, scope: "hosted" | "all" = "all") => failTools(error, scope),
|
||||
)
|
||||
|
||||
const publish = Effect.fn("SessionRunner.publishLLMEvent")(function* (event: LLMEvent) {
|
||||
const publish = Effect.fnUntraced(function* (event: LLMEvent) {
|
||||
switch (event.type) {
|
||||
case "step-start":
|
||||
yield* startAssistant()
|
||||
@@ -535,6 +535,8 @@ export const createLLMEventPublisher = (bus: Pick<Bus.Interface, "publish">, inp
|
||||
}
|
||||
})
|
||||
|
||||
const publishTraced = Effect.fn("SessionRunner.publishLLMEvent")(publish)
|
||||
|
||||
const progress = Effect.fnUntraced(function* (id: string, update: Tool.Metadata) {
|
||||
const tool = tools.get(id)
|
||||
if (!tool?.called || tool.settled) return yield* Effect.die(new Error(`Tool progress outside running call: ${id}`))
|
||||
@@ -573,7 +575,11 @@ export const createLLMEventPublisher = (bus: Pick<Bus.Interface, "publish">, inp
|
||||
})
|
||||
|
||||
return {
|
||||
publish,
|
||||
publish: (event: LLMEvent) => {
|
||||
if (event.type === "text-delta" || event.type === "reasoning-delta" || event.type === "tool-input-delta")
|
||||
return publish(event)
|
||||
return publishTraced(event)
|
||||
},
|
||||
progress,
|
||||
toolExecution,
|
||||
flush,
|
||||
|
||||
Reference in New Issue
Block a user