fix(client-runtime): settled-only dispatch index carries null callTime; README matches

Responding to ds-review-bot round 2 on #653: the tool/code-dispatch event
is appended at settlement, so using its time as callTime fabricated a
zero-duration call for duration-aware consumers — it is now null (start
unknown) per the ToolResultNode contract, pinned in the session spec. The
README's codeDispatches section described the PR3 running→settled
lifecycle a stack ahead of this tree; it now documents the settled-only
index this PR ships (the running shape lands with the start event in
#658, which already merges cleanly over this).
This commit is contained in:
Tianyi Cui
2026-07-26 14:51:03 +08:00
parent 9bf0318690
commit acf0d42ed8
3 changed files with 8 additions and 2 deletions
@@ -638,7 +638,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) },
callTime: event.time,
// The settle event is the only timestamp this event carries; the
// start time is unknown (null per the ToolResultNode contract), so
// duration-aware consumers never see a fabricated zero-duration call.
callTime: null,
content: data.content, isError: data.isError,
callView: null, resultView: null,
}