fix(client-runtime): settle-only dispatch windows carry null callTime

Responding to ds-review-bot on #664 (root cause lives here): when a history
window carries a tool/code-dispatch settle without its paired start, the
runtime fabricated callTime = settle time, so downstream duration views
presented a measured 0 ms. Match the native tool-result contract instead —
callTime: null = unknown — and pin it; the trajectory cell already renders
null as the em dash, and the waterfall gains explicit unknown handling in
its own PR.
This commit is contained in:
Tianyi Cui
2026-07-26 14:04:29 +08:00
parent 06556237f4
commit 3e1a22eb2b
2 files changed
+7 -2

No files matched your search

@@ -661,8 +661,10 @@ export class Session implements ObservableSnapshot<ConversationSnapshot> {
kind: 'tool-result', seq: event.seq, time: event.time,
callId: data.subCallId,
call: { name: data.name, argsRaw: JSON.stringify(data.arguments) },
// Duration source: the paired start's time when observed.
callTime: started === undefined ? event.time : started.time,
// Duration source: the paired start's time when observed; null =
// unknown (settle-only window), matching the native tool-result
// contract so views never present a fabricated zero duration.
callTime: started === undefined ? null : started.time,
content: data.content, isError: data.isError,
callView: null, resultView: null,
}