fix(chat): keep tool totals neutral and count individual errors
This commit is contained in:
@@ -235,6 +235,11 @@ export function toolCallCount(parts) {
|
||||
return (parts ?? []).filter((part) => part?.type === PART_TOOL).length;
|
||||
}
|
||||
|
||||
/** Errors belong to individual calls, not the entire turn's tool total. */
|
||||
export function toolFailureCount(parts) {
|
||||
return (parts ?? []).filter((part) => part?.type === PART_TOOL && toolFailed(part.state)).length;
|
||||
}
|
||||
|
||||
/** True while any tool call in [parts] is still in flight. */
|
||||
export function toolsRunning(parts) {
|
||||
return (parts ?? []).some((part) => toolRunning(part));
|
||||
|
||||
Reference in New Issue
Block a user