fix(desktop): drop noisy "returned N items / empty object" stub strings

When a tool returns nothing useful, the row should be silent — the title
("Search Files", etc.) already tells the user what happened. Counting the
fields in an opaque payload is engineer-noise.

`formatToolResultSummary` and `minimalValueSummary` now return '' for
empty arrays / records / unrecognized values; tool-fallback already hides
the detail section when its body is empty.
This commit is contained in:
Brooklyn Nicholson
2026-05-13 19:25:00 -05:00
parent f08cc6bbeb
commit 4afbdf58b3
2 changed files with 13 additions and 36 deletions
@@ -833,30 +833,14 @@ export function inlineDiffFromResult(result: unknown): string {
return typeof value === 'string' ? stripInlineDiffChrome(value) : ''
}
// Falls back to a string only when there's something concrete to render —
// counts of opaque items/fields are noise, not signal.
function minimalValueSummary(value: unknown): string {
if (value == null) {
return ''
}
if (value == null) return ''
if (typeof value === 'string') return value
if (typeof value === 'number' || typeof value === 'boolean') return String(value)
if (typeof value === 'string') {
return value
}
if (typeof value === 'number' || typeof value === 'boolean') {
return String(value)
}
if (Array.isArray(value)) {
return value.length ? `Returned ${value.length} items.` : 'No items returned.'
}
if (isRecord(value)) {
const count = Object.keys(value).length
return count ? `Returned object with ${count} fields.` : 'Returned an empty object.'
}
return String(value)
return ''
}
function fallbackDetailText(args: unknown, result: unknown): string {