Repository navigation
Conversation
Astryx `ChatToolCalls` makes a row expandable whenever `call.resultDetail != null`, and `standardToolCall` always passed a `<ToolDetailReveal>`, so every tool row carried a chevron even when expanding it showed an empty panel, repeated the collapsed target (the single-line quietText invocation fallback), or a bare type token (`[summary]`, `[image]`, `[archived_tool_result]`). `standardToolCall` now computes the detail decision first and passes `resultDetail` only when the detail adds information beyond the collapsed row: banners (sandbox-blocked, requires-bypass) always count, a titleless single-line quiet text equal to the collapsed target and results whose preview would be only a type token do not. A `summary` result now renders its summarized body through the same redaction and line-cap pipeline as `text`, and a client plugin contribution to the `conversation.tool.detail` slot for that tool name keeps the row expandable. First slice of apache#4863. Fixes apache#5997 Generated-by: GLM-5.3-Flash (ZCode)
Astro-Han
left a comment
There was a problem hiding this comment.
Automated review notice: This comment was posted by an automated review agent. It is not an independent human review and does not replace one.
Reviewed: full PR, one commit 33cc4bed on main-base 6d53ca8e (4 files, +288/-31). This is the first review, so there are no prior findings.
The approach looks right. resultDetail is now passed only when toolDetailAddsInformation says the panel shows something the collapsed row does not, and a matching conversation.tool.detail contribution keeps the row expandable.
useMakaClientSlotEntryKeysmirrors the keyed outlet exactly: samespecDynamiclookup, same session-scope guard, sameoptions.key === entryKeymatch. So a chevron is never shown over a panel the outlet would leave empty.- The repeated-target check compares the full invocation text against the capped target. A single-line command longer than 120 characters therefore differs from its
…-truncated target and stays expandable, and so does any row whose target comes fromintent. This avoids losing the tail of a long command. - Summary bodies go through the same
redactSecrets → formatUserVisibleToolText → capLines → ToolCodeBlockplain-text path astext.originalis never rendered, so there is no new injection or secret-leak surface.
No P0–P2 defects found.
P3
-
tool-activity.tsx:696: an empty or whitespace-onlytextresult, or asummarywhosesummarizedis empty, still counts as information. The row expands to an empty code block, which is the case #5997 describes. -
tool-activity.tsx:696: rows with anarchived_tool_resultare now non-expandable, but the collapsed row says nothing about the archive. Before this PR the reader could at least expand to[archived_tool_result]; now there is no sign that the result exists but is not loaded (or is missing or corrupt). Consider surfacing the archive status instats. -
Overlap with #5999 (Colafornia,
fix(ui): hide empty tool details and render summary bodies, heade0291438, opened earlier). It fixes the same issue #5997 with essentially the same design:- It gates
resultDetailwith an almost identical predicate (toolCallHasDetail). - It adds an equivalent keyed-slot hook under a different name (
useMakaClientSlotOccupiedKeys). - It makes the same
ToolResultPreviewsummary change.
It also covers both P3s above, plus session-scope gating of the existing
useMakaClientSlotOccupied.git merge-treebetween the two heads conflicts intool-activity.tsxandtool-result-preview.tsx.client-plugin-slots.tsxauto-merges, which would leave two duplicate exported hooks. Only one of the two should land. I'd suggest coordinating with #5999 rather than merging both. - It gates
No protocol files are touched, so there is no epoch impact.
CI: test and label pass on 33cc4bed. Mergeable against main; awaiting review.
| return text !== collapsedTarget; | ||
| } | ||
| if (body.kind === 'result') { | ||
| return body.result.kind !== 'image' && body.result.kind !== 'archived_tool_result'; |
There was a problem hiding this comment.
P3: Every other result kind counts as information, including a text result whose text is empty or whitespace-only and a summary with an empty summarized. Both expand to an empty ToolCodeBlock, which is the case #5997 describes. Consider result.text.trim().length > 0 and result.summarized.trim().length > 0 here.
Also, hiding the archived_tool_result chevron removes the only sign the reader had that the result was archived. The row's stats still shows only outcomeWord. Consider adding the archive status (not_loaded / missing / corrupt) to the row.
| * keyed outlet performs, including its session-scope guard, so a caller can | ||
| * ask "would this entryKey render?" without mounting the outlet (#5997). | ||
| */ | ||
| export function useMakaClientSlotEntryKeys( |
There was a problem hiding this comment.
P3: #5999 adds an equivalent hook, useMakaClientSlotOccupiedKeys. This file auto-merges between the two PRs, so landing both would leave two exported hooks that do the same thing. The two PRs also conflict in tool-activity.tsx and tool-result-preview.tsx, so only one should land.
|
Closing as superseded: #5999 (opened earlier, same issue) implements the same design - the gated resultDetail predicate, the keyed-slot hook and the summary-body rendering - and covers the two observations from this review plus session-scope gating of the existing occupied-slot hook. @Colafornia's head should be the one to land; mine is freed. Thank you @Astro-Han for catching the overlap and for the archive-status observation. |
Summary
Every Desktop tool row carried an expand chevron because Astryx
ChatToolCallsmakes a row expandable whenevercall.resultDetail != null, andstandardToolCallalways passed a<ToolDetailReveal>— even when expanding showed an empty panel, repeated the collapsed target, or a bare type token. This PR makes a row expandable only when its detail adds information, and renderssummaryresults as their summarized body.Concretely:
standardToolCallcomputes the detail decision first and passesresultDetailonly when the detail adds information beyond the collapsed row (bug(desktop): tool rows expand to empty, repeated, or placeholder details #5997):nonewithout a banner does not;image,archived_tool_result) do not.summaryresult now renders itssummarizedbody through the same redaction and line-cap pipeline as thetextbranch, instead of[summary].conversation.tool.detailslot for that tool name keeps the row expandable, via a newuseMakaClientSlotEntryKeyshook that mirrors the keyed outlet's lookup (including its session-scope guard).Rows with diffs, terminal or shell output, web search results, JSON, live output, or banners keep their current behavior. Tool grouping, the process disclosure lifecycle, output length bounds, and the requires-bypass retry action are unchanged. This is the first slice of #4863; the remaining #4863 scope (WebFetch citation cards, shared bounds) stays there.
Fixes #5997
Verification
node --test dist/**/*.test.jsinpackages/ui(full suite, 721 tests, includes 8 newtool row expandability (#5997)cases)role="button"+ chevron;summarydetail renders[summary]instead of the bodynpx biome checkon the 4 changed filesnpm run check:asf-headersnpm run typecheck:stories(desktop, coverspackages/ui/stories/**against the changed source)smoke:storybookvisual smokeAI use
Tool(s) and scope: GLM-5.3-Flash (ZCode) — authored the failing tests, the fix, and this PR under the reporter's root-cause analysis in #5997.
Checklist
Does this PR entail a change in behavior?