From 5d4ce14dc476123032ecbcff31bbd51f03831530 Mon Sep 17 00:00:00 2001 From: "opencode-agent[bot]" <219766164+opencode-agent[bot]@users.noreply.github.com> Date: Thu, 27 Aug 2026 17:59:43 -0400 Subject: [PATCH] fix(core): skip tracing streamed LLM deltas (#45761) Co-authored-by: jlongster <17031+jlongster@users.noreply.github.com> --- packages/core/src/session/runner/publish-llm-event.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/core/src/session/runner/publish-llm-event.ts b/packages/core/src/session/runner/publish-llm-event.ts index a03da9734b8..3c51cb18d72 100644 --- a/packages/core/src/session/runner/publish-llm-event.ts +++ b/packages/core/src/session/runner/publish-llm-event.ts @@ -378,7 +378,7 @@ export const createLLMEventPublisher = (bus: Pick, 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, 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, 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,