Compare commits

...

1 Commits

Author SHA1 Message Date
Aiden 81ec913d5d fix(core): remove per-delta tracing overhead
Co-authored-by: Hona <10430890+Hona@users.noreply.github.com>
2026-08-21 04:28:17 +00:00
2 changed files with 9 additions and 2 deletions
@@ -864,7 +864,7 @@ const onContentBlockStart = (state: ParserState, event: AnthropicEvent): StepRes
return [{ ...state, lifecycle: Lifecycle.stepStart(state.lifecycle, events) }, [...events, result]]
}
const onContentBlockDelta = Effect.fn("AnthropicMessages.onContentBlockDelta")(function* (
const onContentBlockDelta = Effect.fnUntraced(function* (
state: ParserState,
event: AnthropicEvent,
) {
@@ -385,7 +385,7 @@ export const createLLMEventPublisher = (bus: Pick<Bus.Interface, "publish">, inp
return tool ? Effect.succeed(tool.assistantMessageID) : Effect.die(new Error(`Unknown tool call: ${id}`))
}
const publish = Effect.fn("SessionRunner.publishLLMEvent")(function* (event: LLMEvent) {
const dispatch = Effect.fnUntraced(function* (event: LLMEvent) {
switch (event.type) {
case "step-start":
yield* startAssistant()
@@ -542,6 +542,13 @@ export const createLLMEventPublisher = (bus: Pick<Bus.Interface, "publish">, inp
return
}
})
const publishTraced = Effect.fn("SessionRunner.publishLLMEvent")(function* (event: LLMEvent) {
return yield* dispatch(event)
})
const publish = (event: LLMEvent) =>
event.type === "text-delta" || event.type === "reasoning-delta" || event.type === "tool-input-delta"
? dispatch(event)
: publishTraced(event)
const progress = Effect.fnUntraced(function* (id: string, update: Tool.Metadata) {
const tool = tools.get(id)