Skip to content

feat(tools): expose tool progress metadata hook - #38742

Closed
sasan1200 wants to merge 1 commit into
NousResearch:mainfrom
sasan1200:codex/upstream-tool-progress-metadata
Closed

sasan1200 wants to merge 1 commit into
NousResearch:mainfrom
sasan1200:codex/upstream-tool-progress-metadata

Conversation

@sasan1200

@sasan1200 sasan1200 commented Jun 4, 2026

Copy link
Copy Markdown

What does this PR do?

Adds structured tool-progress metadata for tool callbacks and exposes a defensive on_tool_progress plugin hook.

This lets plugin authors and external control planes observe tool lifecycle events without scraping CLI display text. The important value is correlation: concurrent tool calls can now be matched by tool_call_id from tool.started through tool.completed, while existing callback behavior such as result= on completion remains intact.

Related Issue

No issue.

Related but not duplicative:

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

  • agent/tool_executor.py: passes tool_call_id through tool.started and tool.completed progress callbacks in both concurrent and sequential execution paths.
  • cli.py: invokes the on_tool_progress plugin hook from the existing CLI progress callback while preserving core scrollback behavior.
  • hermes_cli/plugins.py: registers on_tool_progress as a valid plugin hook.
  • tests/cli/test_tool_progress_scrollback.py: covers plugin hook invocation and metadata forwarding.
  • tests/hermes_cli/test_plugins.py: covers hook registration.
  • tests/run_agent/test_tool_call_guardrail_runtime.py: verifies callback metadata while preserving completion result= behavior.

How to Test

PYTHONPATH="$PWD" python -m pytest tests/cli/test_tool_progress_scrollback.py tests/run_agent/test_tool_call_guardrail_runtime.py tests/hermes_cli/test_plugins.py -q -k "tool_progress or tool_call_id" --tb=short -p no:xdist -o addopts=

Result: 17 passed, 82 deselected.

PYTHONPATH="$PWD" python -m pytest tests/cli/test_tool_progress_scrollback.py tests/run_agent/test_tool_call_guardrail_runtime.py tests/hermes_cli/test_plugins.py -q --tb=short -p no:xdist -o addopts=

Result: 99 passed.

python -m ruff check .
git diff --check upstream/main
git merge-tree upstream/main HEAD

Results: ruff passed, diff-check passed, and merge-tree returned a clean tree id with no conflicts.

CI / Baseline Note

The full-suite checkbox below is intentionally left unchecked. This PR was validated with the focused tool-progress tests, the complete touched test files, lint, whitespace, and merge conflict preview.

After the latest synchronize, GitHub currently reports an empty status check rollup for this fork PR, so there is no upstream CI result to claim here. That is outside this code change; the exact local gates above passed.

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: macOS

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide
  • I've updated tool descriptions/schemas if I changed tool behavior — N/A

Screenshots / Logs

Not applicable.

@alt-glitch alt-glitch added type/feature New feature or request comp/tools Tool registry, model_tools, toolsets comp/cli CLI entry point, hermes_cli/, setup wizard comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have labels Jun 4, 2026
@sasan1200
sasan1200 force-pushed the codex/upstream-tool-progress-metadata branch 3 times, most recently from 8af7132 to 3561aa2 Compare June 4, 2026 09:00
@sasan1200
sasan1200 force-pushed the codex/upstream-tool-progress-metadata branch 3 times, most recently from f2aefb2 to a0bc6d6 Compare June 4, 2026 17:58
@sasan1200
sasan1200 force-pushed the codex/upstream-tool-progress-metadata branch from a0bc6d6 to fccafca Compare June 4, 2026 18:09
@sasan1200

Copy link
Copy Markdown
Author

Closing as superseded: the merged observer telemetry hooks in #38232 already expose pre_tool_call and post_tool_call plugin hooks at the agent core (carrying tool_call_id, duration_ms, status, error_type/message, and correlation IDs) — a superset of this branch's CLI-only on_tool_progress hook. No need to add a third, narrower hook. Thanks!

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 comp/plugins Plugin system and bundled plugins comp/tools Tool registry, model_tools, toolsets P3 Low — cosmetic, nice to have type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants