Skip to content

fix(cli): show delegate_task subagent tool calls in CLI scrollback - #16994

Open
rabi wants to merge 1 commit into
NousResearch:mainfrom
rabi:fix/delegate-task-cli-tool-display
Open

fix(cli): show delegate_task subagent tool calls in CLI scrollback#16994
rabi wants to merge 1 commit into
NousResearch:mainfrom
rabi:fix/delegate-task-cli-tool-display

Conversation

@rabi

@rabi rabi commented Apr 28, 2026

Copy link
Copy Markdown

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

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

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

  • Start the CLI with tool progress on all (default): hermes
  • Ask the agent to delegate a single task, e.g. "use delegate_task to read cli.py and summarize it"
  • Verify that while the subagent runs, you see indented tool call lines in the scrollback (e.g. ├─ 📄 read_file "cli.py") — no [N] prefix for single tasks
  • Ask the agent to delegate multiple tasks at once, e.g. "use delegate_task with tasks: 1) read cli.py 2) read run_agent.py 3) read model_tools.py, summarize each"
  • Verify each subagent's lines are prefixed with [1], [2], [3] so you can tell them apart as they interleave
  • Toggle to /verbose off and repeat — subagent tool lines should not appear

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard tool/delegate Subagent delegation labels Apr 28, 2026

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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:7517 excludes verbose. Children are constructed with quiet_mode=True (tools/delegate_tool.py:1315), and child completion events are not relayed (tools/delegate_tool.py:938-939), so subagent.tool is 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.

Comment thread cli.py Outdated
Comment thread tests/cli/test_tool_progress_scrollback.py
@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users labels Jul 12, 2026

@GottZ GottZ left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 missing subagent.tool scrollback 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 an on_tool_progress plugin 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>
@rabi
rabi force-pushed the fix/delegate-task-cli-tool-display branch from f6eb1ba to e9f6138 Compare July 29, 2026 03:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades tool/delegate Subagent delegation type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants