count_unemitted_tool_calls(
buffers: Iterable[ToolCallBuffer],
) -> UnemittedToolCalls| Name | Type | Description |
|---|---|---|
buffers* | Iterable[ToolCallBuffer] | The in-progress tool-call buffers remaining at stream end. |
Classify buffered tool calls that never emitted a tool.use.
Both surfaces log the same end-of-stream diagnostic for tool calls still in
their buffer map when the stream ends: those whose args never parsed, and
those whose args parsed but whose tool_id stayed None (so tool.use was
gated out). Sharing the classification here keeps the two diagnostics from
drifting; each surface still emits its own log lines.
parse_args is safe to re-run: a re-run populates the incremental scan and
the join/parse memos but returns the same value, and its one-shot warned
latch fires at most once per payload. Only the log line is suppressed on a
repeat; the classification below is unaffected either way, since a warned
payload counts as unparsed however often it is re-read.