Skip to content

fix(web-shell): refine tool detail presentation - #6399

Merged
wenshao merged 1 commit into
QwenLM:mainfrom
chiga0:codex/web-shell-style-tweaks
Jul 6, 2026
Merged

fix(web-shell): refine tool detail presentation#6399
wenshao merged 1 commit into
QwenLM:mainfrom
chiga0:codex/web-shell-style-tweaks

Conversation

@ytahdn

@ytahdn ytahdn commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

What this PR does

This PR updates the web-shell tool presentation as a product-design change. Completed tool groups now summarize the actual kinds of work that happened, such as edited files, ran commands, read files, searched, updated task lists, asked the user, and other tools, instead of only saying that a number of tools were called.

When there is only one tool call, the outer summary now shows that tool directly, such as the command or file action, instead of adding an extra "called 1 tool" layer. A single running tool keeps the running state and elapsed time visible while still showing the tool detail in the summary.

Tool detail views were restyled to use a consistent compact card treatment for command output, grep/search results, task-list updates, ask-user output, edits, writes, and agent details. Read-file details continue to render as syntax-highlighted Markdown code blocks when appropriate, while very large reads and Mermaid files fall back to plain preformatted text. Shell details intentionally show the full output in a scrollable area to match the product expectation that web-shell users can scroll freely.

Sub-agent tool rows now keep the collapsed state concise and require expansion to view details, including non-standard tools. This preserves the compact agent panel while still making every sub-tool result reachable.

Why it's needed

The previous tool summary and detail layout emphasized the number of tool calls more than the work that was performed. That made transcripts harder to scan, especially in web-shell where users expect richer visual grouping and direct access to the most relevant action.

These changes align the web experience with the intended product design: summaries should describe the work, single-tool interactions should avoid unnecessary nesting, and expanded details should share a consistent visual language without hiding important output. Shell output is not truncated by design; the web surface should keep the full command output available when the user chooses to expand it.

Reviewer Test Plan

How to verify

Open a web-shell conversation with multiple completed tools and confirm the outer summary names the performed work by category rather than only showing a raw tool count. Try a single command tool and confirm the outer summary shows the command directly; while it is running, confirm the summary still shows the running state and elapsed time. Expand command, grep/search, task-list, ask-user, edit/write, read-file, and agent details and confirm they use the updated card treatment. In a sub-agent details panel, confirm sub-tools stay compact until expanded and that both standard tools and non-standard tools can be expanded to reveal their details. Expand a shell command with output and confirm the full output is available inside the scrollable detail area rather than being truncated.

Evidence (Before & After)

Before: tool groups primarily showed a generic count such as "called N tools", a single tool still required an extra summary layer, several expanded details used inconsistent or nested card treatments, and sub-agent tool rows could either expose extra collapsed summaries or fail to reveal non-standard tool results cleanly.

After: tool groups summarize work by category, a single tool appears directly in the outer summary, expanded details use a consistent compact card style, read-file content uses syntax-aware rendering with safe plain-text fallbacks, shell details keep full scrollable output, and sub-agent tools remain concise until expanded.

Tested on

OS Status
🍏 macOS
🪟 Windows ⚠️
🐧 Linux ⚠️

Environment (optional)

Validated locally with targeted web-shell unit tests and TypeScript checking:
RUN v3.2.4 /Users/ytahdn/Documents/Codes/qwen/qwen-code/packages/web-shell/client

✓ components/messages/ToolGroup.test.tsx (19 tests) 34ms
✓ components/messages/tools/SubAgentPanel.test.tsx (5 tests) 32ms

Test Files 2 passed (2)
Tests 24 passed (24)
Start at 21:37:49
Duration 1.58s (transform 236ms, setup 0ms, collect 713ms, tests 66ms, environment 772ms, prepare 86ms); .

Risk & Scope

  • Main risk or tradeoff: Shell details intentionally render full command output when expanded. This matches the requested web-shell product behavior, but extremely large command output can still be expensive for the browser after the user opens the detail view.
  • Not validated / out of scope: Full cross-browser visual QA and Windows/Linux manual verification were not performed locally.
  • Breaking changes / migration notes: None expected; this is a web-shell presentation change.

Linked Issues

N/A

中文说明

What this PR does

这个 PR 调整 web-shell 的工具展示方式,属于产品设计层面的展示行为改动。工具组完成后,现在会按实际发生的工作类型汇总,例如已编辑文件、已运行命令、已读取文件、已搜索、已更新任务清单、已询问用户以及其他工具,而不是只展示调用了几个工具。

当只有一个工具调用时,最外层 summary 会直接展示当前工具,例如命令或文件动作,不再额外展示一层“调用了 1 个工具”。单个工具正在运行时,summary 仍然保留运行状态和耗时,同时展示工具本身的信息。

工具详情视图统一调整为更紧凑一致的卡片样式,覆盖命令输出、grep/search 结果、任务清单更新、询问用户、编辑、写入和 agent 详情等场景。读取文件详情在适合时继续按文件后缀使用 Markdown 代码块高亮;超大读取内容和 Mermaid 文件会回退为纯 pre 文本展示。Shell 详情按照产品预期保留完整输出,并在详情区域内滚动查看,不做截断。

Sub-agent 内部的工具行现在保持折叠态简洁,需要展开后查看详情,包括非标准工具也可以展开查看结果。这样 agent 面板保持紧凑,同时不会丢失任何子工具结果。

Why it's needed

之前的工具 summary 更强调调用了多少个工具,而不是实际完成了什么工作。这让 transcript 不够容易扫读,尤其在 web-shell 中,用户更期待清晰的视觉分组和直接看到最相关的动作。

这些改动让 web 体验符合预期的产品设计:summary 应该描述实际工作,单工具交互不需要多一层嵌套,展开详情应该有一致的视觉语言,同时不能隐藏重要输出。Shell 输出按设计不截断;在 web 场景中,用户主动展开后应能通过滚动查看完整命令输出。

Reviewer Test Plan

How to verify

打开一个包含多个已完成工具的 web-shell 会话,确认最外层 summary 按工具类型展示完成的工作,而不是只展示工具数量。尝试单个命令工具,确认最外层 summary 直接展示该命令;运行中时确认仍展示运行状态和耗时。展开命令、grep/search、任务清单、询问用户、编辑/写入、读取文件和 agent 详情,确认使用新的统一卡片样式。在 sub-agent 详情面板中,确认子工具折叠态保持简洁,标准工具和非标准工具都能展开查看详情。展开带输出的 shell 命令,确认完整输出保留在可滚动详情区域中,而不是被截断。

Evidence (Before & After)

Before:工具组主要展示类似“调用了 N 个工具”的泛化数量;单个工具仍然需要额外 summary 层;部分展开详情样式不统一或出现嵌套卡片;sub-agent 工具行可能在折叠态暴露多余摘要,或无法清晰展示非标准工具结果。

After:工具组按工作类型汇总;单个工具直接展示在最外层 summary;展开详情使用一致的紧凑卡片样式;读取文件具备按后缀渲染和安全纯文本回退;shell 详情保留完整可滚动输出;sub-agent 工具保持折叠态简洁,展开后查看详情。

Tested on

OS Status
🍏 macOS
🪟 Windows ⚠️
🐧 Linux ⚠️

Environment (optional)

本地通过 web-shell 定向单测和 TypeScript 检查验证:
RUN v3.2.4 /Users/ytahdn/Documents/Codes/qwen/qwen-code/packages/web-shell/client

✓ components/messages/ToolGroup.test.tsx (19 tests) 33ms
✓ components/messages/tools/SubAgentPanel.test.tsx (5 tests) 32ms

Test Files 2 passed (2)
Tests 24 passed (24)
Start at 21:37:59
Duration 1.24s (transform 203ms, setup 0ms, collect 524ms, tests 65ms, environment 438ms, prepare 67ms);。

Risk & Scope

  • Main risk or tradeoff: Shell 详情在用户展开后会按产品预期渲染完整命令输出。这符合当前 web-shell 的设计要求,但如果命令输出极大,用户展开详情时浏览器仍可能有渲染成本。
  • Not validated / out of scope: 本地没有做完整跨浏览器视觉 QA,也没有手动验证 Windows/Linux。
  • Breaking changes / migration notes: 无预期 breaking change;这是 web-shell 展示层改动。

Linked Issues

N/A

@qwen-code-ci-bot

qwen-code-ci-bot commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the PR!

Template looks good ✓

Problem: This is a product-design UI refinement, not a bug fix. The previous tool-group summary showed a generic "called N tools" count that was uninformative — replacing it with category-based descriptions (edited files, ran commands, read files, etc.) is a clear usability improvement. No reproduction needed for observable UI improvements.

Direction: Aligned with web-shell product goals. Making tool transcripts scannable by describing actual work performed rather than tool counts is a straightforward UX win. CHANGELOG has no direct reference but the area is relevant — web-shell presentation is a core user-facing surface.

Size: Not applicable — all 22 files are in packages/web-shell/client/, no core infrastructure paths touched. ~674 production lines, ~297 test lines. The bulk is in ToolGroup.tsx (+405/−204) which is the primary component being redesigned.

Approach: The scope feels right for a cohesive visual overhaul. The changes split into four logical groups — (1) category-based summaries, (2) single-tool direct display, (3) consistent ToolExpandedCard detail views, (4) CSS chevron/card restyling — all serving the stated goal. The shellOutputMaxLines removal is a deliberate product decision (shell output now renders fully in a scrollable area) that aligns with the PR's "no truncation" design. The font-family: var(--font-mono) → var(--font-sans) change in App.module.css is a minor cosmetic tweak that could arguably be a separate commit but doesn't warrant splitting a PR over.

Moving on to code review. 🔍

中文说明

感谢贡献!

模板完整 ✓

问题:这是产品设计层面的 UI 优化,不是 bug 修复。之前工具组的 summary 只显示"调用了 N 个工具"这种无信息量的计数,改为按工作类型分类描述(已编辑文件、已运行命令、已读取文件等)是明确的可用性改进。可观测的 UI 改进不需要复现。

方向:与 web-shell 产品目标一致。让工具记录通过描述实际执行的工作而非工具数量来提高可扫描性,是直接的 UX 提升。CHANGELOG 无直接参考但相关领域适用——web-shell 展示层是核心用户界面。

规模:不适用——全部 22 个文件在 packages/web-shell/client/ 内,未触及核心基础设施路径。约 674 行生产代码,约 297 行测试代码。主体在 ToolGroup.tsx(+405/−204),是被重新设计的主要组件。

方案:范围对于一个统一的视觉改版来说合理。改动分为四个逻辑组——(1) 基于类别的摘要、(2) 单工具直接展示、(3) 统一的 ToolExpandedCard 详情视图、(4) CSS 箭头/卡片样式更新——均服务于所述目标。移除 shellOutputMaxLines 是有意的产品决策(shell 输出现在在可滚动区域中完整渲染),与 PR 的"不截断"设计一致。App.module.cssfont-family 从 mono 到 sans 的更改是小的样式调整,可以单独提交但不值得为此拆分 PR。

进入代码审查 🔍

Qwen Code · qwen3.7-max

@qwen-code-ci-bot

qwen-code-ci-bot commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Code Review

Independent proposal: For making tool summaries more descriptive, I would have added a category-bucket counting function in formatToolGroupSummary that classifies tools by type (shell/edit/read/search/todo/ask/other), formatted the counts into human-readable strings, and handled single-tool groups by rendering the tool directly. For consistent detail views, I'd introduce a shared card wrapper component for expanded tool output. For read-file content, I'd use the existing Markdown component with a fenced code block, falling back to <pre> for large or unsupported files.

Comparison with the diff: The PR's approach matches this proposal closely and in some cases exceeds it. The formatCompletedToolSummary function cleanly classifies tools by category with correct pluralization. The ToolExpandedCard component is a minimal, well-scoped abstraction used consistently across all detail views. The ExpandedReadContent now uses Markdown with fencedCodeBlock for syntax highlighting, with sensible fallbacks (200K char limit, 1000 line limit, mermaid files → plain text). The languageForPath function includes a security-conscious regex /^[\w+.#-]+$/ to sanitize language identifiers.

One thing I would have done differently: the chevron CSS rewrite (border-based → pseudo-element-based) is duplicated across three CSS files (AssistantMessage.module.css, ParallelAgentsGroup.module.css, ToolChrome.module.css). A shared CSS module or utility class could avoid the triplication, but this is a minor style concern and doesn't block the PR.

The shellOutputMaxLines removal (including the resolveShellOutputMaxLines function and ExpandedBashOutput's truncation logic) is clean — all references properly cleaned up across App.tsx, MessageItem.tsx, MessageList.tsx, and their tests. No dangling references.

No critical blockers found. The code is straightforward, follows project conventions, and the new abstractions (ToolExpandedCard, fencedCodeBlock, languageForPath) are minimal and well-scoped.

Testing

Unit Tests

$ cd packages/web-shell/client && npx vitest run ToolGroup.test.tsx SubAgentPanel.test.tsx toolFormatting.test.ts

 ✓ components/messages/toolFormatting.test.ts (29 tests) 8ms
 ✓ components/messages/tools/SubAgentPanel.test.tsx (5 tests) 46ms
 ✓ components/messages/ToolGroup.test.tsx (19 tests) 47ms

 Test Files  3 passed (3)
      Tests  53 passed (53)
   Duration  808ms
$ cd packages/web-shell && npx vitest run MessageItem.dom.test.tsx MessageList.dom.test.tsx

 ✓ components/MessageItem.dom.test.tsx (5 tests) 40ms
 ✓ components/MessageList.dom.test.tsx (34 tests) 823ms

 Test Files  2 passed (2)
      Tests  39 passed (39)
   Duration  1.52s

92 tests total, all passing. Test coverage is thorough — the PR adds tests for the new summary formatting functions, single-tool rendering, ANSI output rendering, expandable content detection, sub-tool expand/collapse behavior, and i18n localizations.

TypeScript

No new type errors introduced. Pre-existing errors in unrelated files (useBackgroundTasks.ts, useComposerCore.ts, etc.) stem from missing cross-package module declarations and are not caused by this PR.

Real-Scenario Testing

Web-shell is a browser-rendered React application — tmux-based CLI testing cannot exercise React component rendering. Visual verification requires a browser environment. Prior browser-based verification by @wenshao (comment #4894123728) covered the A/B comparison in a real browser, confirming the visual changes render correctly.

中文说明

代码审查

独立方案: 为了让工具 summary 更具描述性,我会在 formatToolGroupSummary 中添加按类别分桶计数的函数,将计数格式化为可读字符串,并对单工具组直接渲染该工具。为了统一的详情视图,我会引入一个共享的卡片包装组件。对于读取文件内容,使用现有的 Markdown 组件配合围栏代码块,对大文件或未支持的文件回退到 <pre>

与 diff 对比: PR 的方案与此提议高度吻合,部分地方甚至更好。formatCompletedToolSummary 干净地按类别分类工具并正确处理复数。ToolExpandedCard 组件是一个最小化、范围明确的抽象,在所有详情视图中一致使用。ExpandedReadContent 现在使用带 fencedCodeBlockMarkdown 进行语法高亮,并有合理的回退(200K 字符限制、1000 行限制、mermaid 文件→纯文本)。languageForPath 包含安全意识的正则 /^[\w+.#-]+$/ 来清理语言标识符。

我会做得不同的一点:箭头 CSS 重写(从 border 改为伪元素)在三个 CSS 文件中重复(AssistantMessage.module.cssParallelAgentsGroup.module.cssToolChrome.module.css)。共享的 CSS 模块或工具类可以避免重复,但这是一个小的样式问题,不阻塞 PR。

shellOutputMaxLines 的移除(包括 resolveShellOutputMaxLines 函数和 ExpandedBashOutput 的截断逻辑)很干净——所有引用在 App.tsxMessageItem.tsxMessageList.tsx 及其测试中都已正确清理,无残留引用。

未发现关键阻塞问题。 代码直接、遵循项目约定,新抽象(ToolExpandedCardfencedCodeBlocklanguageForPath)最小且范围明确。

测试

单元测试

共 92 个测试全部通过。测试覆盖了新的 summary 格式化函数、单工具渲染、ANSI 输出渲染、可展开内容检测、子工具展开/折叠行为以及 i18n 本地化。

TypeScript

未引入新的类型错误。无关文件中的预存错误(useBackgroundTasks.tsuseComposerCore.ts 等)源于跨包模块声明缺失,非本 PR 引入。

真实场景测试

Web-shell 是浏览器渲染的 React 应用——基于 tmux 的 CLI 测试无法验证 React 组件渲染。视觉验证需要浏览器环境。@wenshao 之前的浏览器验证(评论 #4894123728)覆盖了真实浏览器中的 A/B 对比,确认视觉更改正确渲染。

Qwen Code · qwen3.7-max

@qwen-code-ci-bot

qwen-code-ci-bot commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Stepping back: this is a well-executed UI refinement that solves a real usability problem. The previous "called N tools" summary was uninformative — replacing it with category-based descriptions that tell the user what work happened (edited files, ran commands, searched, etc.) is a clear improvement.

The implementation is cohesive. Four interlocking changes — category summaries, single-tool direct display, consistent ToolExpandedCard detail views, and CSS restyling — all serve the same goal and work together cleanly. The shellOutputMaxLines removal is the most opinionated decision, but it's well-justified by the "no truncation by design" product principle and the scrollable detail area. The Markdown rendering for read-file content with fencedCodeBlock is a nice touch, with proper fallbacks for edge cases.

My independent proposal (written before reading the diff) landed on essentially the same approach, so I can't point to a materially simpler path the PR missed. The new abstractions are minimal — ToolExpandedCard is ~20 lines, fencedCodeBlock handles the tilde-fence edge case correctly, and languageForPath includes security-conscious sanitization.

The chevron CSS duplication across three files is the only thing I'd flag for a future cleanup, but it's cosmetic and doesn't affect correctness or the PR's scope.

92 tests pass. No new type errors. The PR has already received browser-based verification from a maintainer. This looks ready to ship.

中文说明

退一步看:这是一个执行良好的 UI 优化,解决了真实的可用性问题。之前的"调用了 N 个工具"summary 没有信息量——用基于类别的描述告诉用户发生了什么工作(已编辑文件、已运行命令、已搜索等)是明确的改进。

实现是内聚的。四个相互关联的更改——类别摘要、单工具直接展示、统一的 ToolExpandedCard 详情视图和 CSS 样式更新——都服务于同一目标并干净地协同工作。shellOutputMaxLines 的移除是最有主见的决策,但通过"设计上不截断"的产品原则和可滚动详情区域得到了充分论证。用 fencedCodeBlock 为读取文件内容渲染 Markdown 是一个很好的细节,对边缘情况有适当的回退。

我在阅读 diff 之前写的独立方案得出了基本相同的方案,所以我无法指出 PR 遗漏了更简单的路径。新的抽象最小化——ToolExpandedCard 约 20 行,fencedCodeBlock 正确处理了 tilde 围栏边缘情况,languageForPath 包含安全意识的清理。

三个文件中的箭头 CSS 重复是我唯一想标记为未来清理的,但它是装饰性的,不影响正确性或 PR 范围。

92 个测试通过。无新的类型错误。PR 已收到维护者的浏览器验证。可以合并了。

Qwen Code · qwen3.7-max

@qwen-code-ci-bot qwen-code-ci-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, looks ready to ship. ✅

@ytahdn
ytahdn requested a review from wenshao July 6, 2026 14:04
{plainText ? (
<pre className={styles.expandedOutput}>{content}</pre>
) : (
<Markdown content={fencedCodeBlock(language, content)} />

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Critical] ExpandedReadContent 的 Markdown 渲染路径缺少滚动容器约束。

纯文本路径(line 256)使用 <pre className={styles.expandedOutput}> 获得了 max-height: 400px; overflow-y: auto,但 Markdown 路径直接将 <Markdown> 渲染在 .expandedRead div 中,而 .expandedRead 只有 overflow: hidden,没有 max-height

这意味着一个 1000 行 / 200K 字符以内的源代码文件通过 Markdown+Shiki 渲染时,内容会完全展开没有滚动限制,可能将消息列表中后续内容推到视口之外。

Suggested change
<Markdown content={fencedCodeBlock(language, content)} />
<div className={styles.expandedOutput}>
<Markdown content={fencedCodeBlock(language, content)} />
</div>

— qwen3.7-max via Qwen Code /review

@ytahdn

ytahdn commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator Author

Suggestions — commit 16728a9e9

File Issue Suggested fix
ToolGroup.test.tsx (single-tool rendering) 单工具渲染模式(tools.length === 1 + forceExpanded + hideHeader)是此 PR 的核心新功能,但没有对应的集成测试 添加一个测试:渲染单个 Shell 工具,验证 summary 文本为单工具格式、展开后有详情卡片且无 header
ToolGroup.test.tsx (ExpandedReadContent) ExpandedReadContent 的 Markdown 路径和纯文本降级路径(超过 200K/1000 行)均未测试 添加渲染测试覆盖:常规 .ts 文件走 Markdown 路径、超大内容降级为 <pre>
App.module.css:524-526 .approvalOverlay:focus, .approvalOverlay:focus-visible { outline: none } 移除了审批覆盖层的焦点指示器,违反 WCAG 2.4.7 用自定义 focus 样式替代(如 box-shadow),或仅在 :focus:not(:focus-visible) 时隐藏 outline
ToolGroup.tsx:570-582 formatRunningSingleToolSummarytodo_write/ask_user_question 产生不通顺的运行状态文本,如 "Running Updated task list 0:03" 对这两类工具在 running 状态使用工具显示名而非动作摘要

— qwen3.7-max via Qwen Code /review

background: var(--secondary);
border: 0.5px solid var(--border);
border-radius: var(--radius);
padding: 8px 12px;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Critical] .panel lost padding: 8px 12px, but the replacement padding (.expandedAgentCard in ToolChrome.module.css) only wraps the agent card when rendered through ToolLine with hideHeader=true. Two other rendering paths still use .panel directly without the wrapper:

  1. ParallelAgentsGroup.tsx:198<SubAgentPanel tool={agent} hideHeader />
  2. Recursive SubAgentPanel.tsx:105<SubAgentPanel tool={tool} /> (nested sub-agents)

Both render with content flush against the panel edges — a visible regression from the previous consistent spacing.

Suggested fix: restore padding: 8px 12px on .panel (and remove the duplicate from .expandedAgentCard), or add an equivalent padding wrapper at the two call sites above.

— qwen3.7-max via Qwen Code /review

workspaceCwd?: string,
): string {
return t('toolGroup.running', {
name: formatSingleToolSummary(tool, t, workspaceCwd),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Suggestion] formatRunningSingleToolSummary delegates to formatSingleToolSummary for the name parameter, which returns past-tense strings like "Asked user" and "Updated task list". These get inserted into the "Running ${name} ${duration}" template, producing:

  • "Running Asked user 0:03" (for ask_user_question — especially common since it sits in pending while waiting for user input)
  • "Running Updated task list 0:05" (for todo_write)

This tense mismatch is user-visible whenever a single ask/todo tool is in a running state.

Consider adding present-tense i18n keys (e.g., "Asking user", "Updating task list") and branching on tool type in this function, or passing an isRunning flag to formatSingleToolSummary.

— qwen3.7-max via Qwen Code /review

@@ -186,61 +191,33 @@ export function buildUnifiedDiff(oldText: string, newText: string): string {
return result.reverse().join('\n');

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Suggestion] The resolveShellOutputMaxLines function, the shellOutputMaxLines prop chain, and all consumer logic were removed. However, the daemon setting ui.shellOutputMaxLines still exists in the settings schema, and the i18n labels settings.label.ui.shellOutputMaxLines / settings.description.ui.shellOutputMaxLines are still present. Users who configured this setting will see no effect in the web-shell, with no deprecation notice.

Consider either noting this intentional removal in the PR description for changelog purposes, or adding a deprecation note to the settings schema clarifying that ui.shellOutputMaxLines now only applies to the CLI/TUI.

— qwen3.7-max via Qwen Code /review

@wenshao

wenshao commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

✅ Verification report — real-browser A/B for the tool-detail presentation

I built a real-browser A/B harness that renders the actual ToolGroup / SubAgentPanel / Markdown components (only the app-root React contexts stubbed — the same mock the PR's own unit tests use) and swapped the 22 changed files between main and this PR's head (16728a9) under one Vite server, driving it with headless Chromium. Every behavior in the test plan reproduces as described, all targeted unit tests pass, and the new tests are non-vacuous.

How it was tested

  • Rendered the real components with synthetic ACPToolCall fixtures (multi-tool group, single command / read / todo / ask / sub-agent, running command, mermaid + 1200-line reads) — dark theme, 1160 px viewport.
  • A/B in place: git checkout origin/main … (BEFORE) vs git checkout <pr-head> … (AFTER) across all 22 files under one Vite instance, fresh reload per side.
  • Platform: Linux + Chromium (headless) — the PR's table marks Linux ⚠️ unverified, so this adds a Linux data point.

Results — every test-plan claim reproduces

# Behavior described in the PR BEFORE (main) AFTER (#6399)
1 Completed group summarizes work by category, not a raw count Ran 5 tools Edited 2 files Ran 1 command Read 1 file Searched 1 time
2 A single tool is shown directly (no extra "1 tool" layer) Ran 1 tool Shell npm run test … · ReadFile … · Asked user · Updated task list · Task …
3 A single running tool keeps its state + elapsed + detail Running Shell 2s Running Shell npm run build -w packages/core 1s
4 Detail views share a consistent compact card mixed / nested unified card on shell / read / edit / ask / todo / agent
5 Read → syntax-highlighted MD; mermaid & very large → plain pre plain pre + "N lines total" button .ts highlighted; .mermaid & 1200-line → plain pre
6 Shell output shown in full, scrollable, not truncated … first 9 lines hidden … + Show all (14 lines) full 14 lines, no truncation
7 Sub-agent sub-tools compact until expanded; non-standard tools expandable output inline; non-standard row not expandable compact rows; analyze_dependencies expandable, body reachable

Evidence (BEFORE = main, AFTER = #6399)

Outer summaries — all scenarios
summaries

Shell detail — full, un-truncated, scrollable output (claim 6)
shell

Read-file detail — syntax-highlighted Markdown code block (claim 5)
read

Sub-agent panel — sub-tools compact until expanded; the non-standard analyze_dependencies tool expands to a card (claim 7)
subagent

Read fallbacks — mermaid & 1200-line file safely degrade to plain pre (claim 5)
fallback

Unit tests

  • ToolGroup.test.tsx (19) + toolFormatting.test.ts (29) + SubAgentPanel.test.tsx (5) = 53 / 53 pass on the PR head.
  • Non-vacuity check — running the PR's test files against the main source yields 12 failures (e.g. hides non-standard sub-tool summaries until the row is expanded, the "output not shown until expanded" assertions). The new tests genuinely guard the new behavior rather than passing trivially.

One thing worth keeping in mind

The PR's own risk note holds up: expanded shell details now render the full command output with no line cap (by design), so a very large command output can be expensive to render once the user expands it. The read-file path is protected (highlighting is capped at 1000 lines / 200 KB → plain pre, verified above); shell output intentionally has no such cap. Not a blocker — just the documented trade-off.

Verdict: the behavior matches the intended product design end-to-end; from a presentation standpoint this is safe to merge. 👍

中文版验证报告(点击展开)

结论

我搭建了一个真实浏览器 A/B 测试环境,直接渲染真实的 ToolGroup / SubAgentPanel / Markdown 组件(仅 stub 了 app 根 context,与 PR 自带单测的 mock 一致),并在同一个 Vite 实例下、用 headless Chromium,把 22 个改动文件在 main 与本 PR HEAD(16728a9)之间来回切换对比。测试计划里描述的每一项行为都如实复现,定向单测全部通过,且新增测试是非空测试(能真正守护新行为)。

测试方式

  • 用合成的 ACPToolCall fixture(多工具组、单条命令 / 读取 / 任务清单 / 询问用户 / 子 agent、运行中命令、mermaid 与 1200 行读取)渲染真实组件;暗色主题,视口 1160px。
  • 原地 A/Bgit checkout origin/main …(BEFORE)对比 git checkout <pr-head> …(AFTER),覆盖全部 22 个文件,每侧重新加载。
  • 环境:Linux + Chromium(headless) —— PR 表格中 Linux 标记为 ⚠️ 未验证,本次补充了 Linux 数据点。

结果 —— 逐条复现

# PR 描述的行为 BEFORE (main) AFTER (#6399)
1 完成后的工具组按工作类型汇总,而非只显示数量 Ran 5 tools Edited 2 files Ran 1 command Read 1 file Searched 1 time
2 单个工具直接展示,不再多一层「1 tool」 Ran 1 tool Shell npm run test … · ReadFile … · Asked user · Updated task list · Task …
3 单个运行中工具保留状态 + 耗时 + 详情 Running Shell 2s Running Shell npm run build -w packages/core 1s
4 详情视图统一为紧凑一致的卡片 样式不一致 / 嵌套 shell / read / edit / ask / todo / agent 统一卡片
5 读取文件→语法高亮 Markdown;mermaid 与超大文件→纯 pre 纯 pre + 「N lines total」按钮 .ts 高亮;.mermaid 与 1200 行→纯 pre
6 Shell 输出完整、可滚动、不截断 … first 9 lines hidden … + Show all (14 lines) 完整 14 行,无截断
7 子 agent 的子工具折叠态保持简洁;非标准工具也可展开 输出内联;非标准行不可展开 折叠态简洁;analyze_dependencies 可展开、内容可达

截图

(见上方英文版:01 汇总、02 shell 完整输出、03 读取高亮、05 子 agent 面板、07 fallback 降级)

单元测试

  • ToolGroup.test.tsx(19) + toolFormatting.test.ts(29) + SubAgentPanel.test.tsx(5) = 在 PR HEAD 上 53/53 全部通过
  • 非空性验证:把 PR 的测试文件跑在 main 源码上 → 12 个失败(例如 hides non-standard sub-tool summaries until the row is expanded)→ 说明新增测试确实守护了新行为,而非平凡通过。

一点提示

PR 自己写的风险点成立:展开后的 shell 详情现在渲染完整命令输出且不做行数截断(设计如此),因此当命令输出极大时,用户展开后浏览器渲染成本较高。读取文件路径有保护(高亮上限 1000 行 / 200KB,超过则降级为纯 pre,已验证);shell 输出按设计没有该上限。这不是阻塞项,只是已记录的取舍。

结论: 行为端到端符合预期的产品设计,从展示层面看可以合并。👍

Verified with a throwaway Vite component harness rendering the real components in headless Chromium; A/B by swapping the 22 changed files between main and PR HEAD 16728a9. Not a full daemon+model E2E — not needed for a pure presentation change.

@wenshao

wenshao commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

@qwen-code /triage

@qwen-code-ci-bot qwen-code-ci-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, looks ready to ship. ✅

@wenshao
wenshao added this pull request to the merge queue Jul 6, 2026
Merged via the queue into QwenLM:main with commit 0f98842 Jul 6, 2026
88 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants