Skip to content

Commit f7249d6

Browse files
waleedlatif1claude
andcommitted
fix(traces): guard condition blocks from leaked metadata on old persisted logs
Extend isConditionBlockType guards to also skip setting span.providerTiming, span.cost, span.tokens, and span.model for condition blocks. This ensures old persisted logs (recorded before the filterSourceOutput fix) don't display misleading execution metadata on condition spans. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 23e1a15 commit f7249d6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

apps/sim/lib/logs/execution/trace-spans/trace-spans.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ export function buildTraceSpans(result: ExecutionResult): {
168168
...(log.parentIterations?.length && { parentIterations: log.parentIterations }),
169169
}
170170

171-
if (log.output?.providerTiming) {
171+
if (!isConditionBlockType(log.blockType) && log.output?.providerTiming) {
172172
const providerTiming = log.output.providerTiming as {
173173
duration: number
174174
startTime: string
@@ -190,15 +190,15 @@ export function buildTraceSpans(result: ExecutionResult): {
190190
}
191191
}
192192

193-
if (log.output?.cost) {
193+
if (!isConditionBlockType(log.blockType) && log.output?.cost) {
194194
span.cost = log.output.cost as {
195195
input?: number
196196
output?: number
197197
total?: number
198198
}
199199
}
200200

201-
if (log.output?.tokens) {
201+
if (!isConditionBlockType(log.blockType) && log.output?.tokens) {
202202
const t = log.output.tokens as
203203
| number
204204
| {
@@ -228,7 +228,7 @@ export function buildTraceSpans(result: ExecutionResult): {
228228
}
229229
}
230230

231-
if (log.output?.model) {
231+
if (!isConditionBlockType(log.blockType) && log.output?.model) {
232232
span.model = log.output.model as string
233233
}
234234

0 commit comments

Comments
 (0)