Files
deepseek-harness/apps
涂轶翔 8b04316918 feat(ui-tool): fold run_code subcalls (#8834)
* feat(ui-tool): fold program sub-call lists by default

* feat(ui-tool): show a program call as one row over its source and sub-calls

A run_code or cua_run_code call renders as one collapsed row with the
program's description and its sub-call count. Opening it lists the PTC
source code row and then the sub-calls. A failed call shows its first
error line in place of the count, and an interrupted call shows that it
stopped.

A call with more than 32 sub-calls lists the first 10 and the last 10
around a row that states how many are omitted. The three numbers are
constants in ToolCallTree.

The row replaces the separate collapsed count row. A collapsed program
call mounts neither its own toolview nor its sub-calls.

* feat(ui-tool): title the program source row "Source code"

The row also heads cua_run_code programs in Standard mode, where "PTC"
names a different agent mode.

* test(web): refresh the scoped PTC round goldens for the program call row

The persistent-in-memory variant of the PTC round renders the same
program call row as the per-call variant.

* fix(ui-tool): keep the program call state whole and move the error line to the source row

A failed program call shows "Failed" after its description, the way an
interrupted call shows "Stopped". The count and both states never
shrink, so a narrow row truncates only the description. The error line
could shrink together with the description, which clipped "Stopped"
beside a long description and hid a short description beside a long
error line.

The source code row shows the first error line without its "Error: "
lead.

* feat(ui-tool): mark the program call row with a hub icon

Add the hub-outline product glyph, a central node wired to three
satellite nodes, and use it for the program call header instead of
layers-outline, which keeps its other uses.

* feat(ui-tool): reveal omitted program sub-calls 50 per side on click

Lower the sub-call list threshold to 24. The omission row becomes a
"Show more (N hidden)" button that lists up to 50 more sub-calls on each
side per activation; reopening the program call returns to the first and
last 10.

* docs(ui-tool): describe the sub-call list constants as the initial window

* feat(ui-tool): list the first 20 sub-calls and double the list per show-more click

A program call with more than 24 sub-calls now lists its first 20 followed
by the "Show more" row; each click doubles the listed count (20, 40,
80, ...) until every sub-call is listed. Reopening the program call returns
to the first 20.

* fix(ui-tool): show a failed program call's error line with its "Error: " lead

The source code row of a failed program call shows the result's first
line unchanged, like every other failed tool row. The "Error: " lead is
the tool pipeline's model-facing failure text; removing it in the card
with a pattern match edited recorded text for one tool variant only.

* feat(ui-tool): render a program call's own row through a dedicated source row

`run_code` and `cua_run_code` register `SourceCodeRow` in
`tool.call.toolview`. It shows the program and its output, with the
first error line on failure, and no description, because the program
call's header row shows it. `GenericToolCard` keeps no program-call
branch. Image labels in flattened result text move to
`formatResultImage`, which both rows use.

The two registrations add two occupant lines to the
`tool.call.toolview` slot report, so its catalog budget rises to 136.
2026-11-27 19:21:49 +08:00
..