fix(cli): show delegate_task subagent tool calls in CLI scrollback - #16994
fix(cli): show delegate_task subagent tool calls in CLI scrollback#16994rabi wants to merge 1 commit into
Conversation
teknium1
left a comment
There was a problem hiding this comment.
Thanks for tracing the callback path; the underlying CLI gap is still present on current main. tools/delegate_tool.py:987 relays each child tool call as subagent.tool, while cli.py:11049 currently discards every non-tool.started event.
Problems
cli.py:7517excludesverbose. Children are constructed withquiet_mode=True(tools/delegate_tool.py:1315), and child completion events are not relayed (tools/delegate_tool.py:938-939), sosubagent.toolis the only CLI display path. Suppressing it leaves verbose mode without child tool lines, despite its richer-display contract (cli.py:9328).- The new-mode branch prints every repeated child tool, unlike the existing new-mode contract to skip consecutive repeats (
cli.py:11011-11015,cli.py:9326). - Please add CLI tests for batch
[N]prefixes and repeated subagent tools in new mode; the added tests do not cover either behavior.
This is an automated hermes-sweeper review.
GottZ
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
Summary
Two PRs touch the tool-progress path, but only #16994 addresses the reported CLI visibility gap by rendering relayed subagent.tool events in scrollback. #38742 instead adds tool_call_id metadata and a plugin observer hook, so it does not fix missing child-tool display.
Related pull requests
- #16994
related— (+72/-0) — keep open, revisions required: The diff adds the missingsubagent.toolscrollback path and relevant baseline tests, but, as the keep_open contributor review notes, it incorrectly suppresses child-tool lines in verbose mode, does not deduplicate consecutive tools in new mode, and lacks batch-prefix and repetition coverage. - #38742 [closed]
related— (+76/-4) — remain closed, not a duplicate: The diff exposes correlated tool lifecycle metadata through anon_tool_progressplugin hook rather than rendering delegated child-tool events; it remains relevant only as adjacent observer work and was closed as superseded by the merged, broader telemetry hooks in #38232.
Suggested consolidation
Keep #16994 open as the sole direct fix, but do not merge it until the contributor review is addressed with verbose-mode support, new-mode repeat suppression, and the requested batch/repetition tests. Keep #38742 closed as superseded adjacent work; neither PR should be closed as a duplicate of the other.
Cross-PR triage: Reviewed 2 pull requests and 0 issues in this complex. Each diff was read against this issue; Assessment working set: 13 kB of PR diffs, 6 kB of issue/PR text, 1 kB of discussion (2 comments), 0 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch.
_on_tool_progress dropped subagent.* events relayed from child agents because it only handled tool.started and tool.completed. The fallback _delegate_spinner path was also dead (tool_progress_callback is always set in the CLI, so _should_emit_quiet_tool_messages() returns False). Handle subagent.tool events as indented tree-view scrollback lines. Signed-off-by: rabi <mishra.rabi@gmail.com>
f6eb1ba to
e9f6138
Compare
What does this PR do?
_on_tool_progress dropped subagent.* events relayed from child agents because it only handled tool.started and tool.completed. The fallback _delegate_spinner path was also dead (tool_progress_callback is always set in the CLI, so _should_emit_quiet_tool_messages() returns False).
Handle subagent.tool events as indented tree-view scrollback lines.
Type of Change
Changes Made
cli.py (_on_tool_progress): Handled subagent.tool events relayed from delegate_task child agents. When tool_progress_mode is "all" or "new", prints an indented tree-view scrollback line. Batch mode prefixes lines with [N] per subagent.
tests/cli/test_tool_progress_scrollback.py: Added TestSubagentEventScrollback with 4 tests — core display behavior, off mode suppression, verbose mode suppression, and silent consumption of lifecycle events.
How to Test