orphanReportKey function

String orphanReportKey(
  1. ToolResultMessage orphan
)

The stable latch key of an orphaned result (gh-1449 E1): canonical call id + tool name + the result's timestamp in epoch milliseconds. Ids reset per run, so the timestamp is the position discriminator — a reused id is a DIFFERENT orphan and is reported again; the same result rebuilds to the same key across requests, compactions and session resumes (the timestamp round-trips the session record).

Implementation

String orphanReportKey(ToolResultMessage orphan) =>
    '${canonicalToolCallId(orphan.toolCallId)}|'
    '${canonicalToolCallId(orphan.toolName)}|'
    '${orphan.timestamp.millisecondsSinceEpoch}';