Skip to content

feat: Stream tool progress messages to Open WebUI#4032

Closed
sroecker wants to merge 1 commit into
NousResearch:mainfrom
sroecker:feature/stream-tool-messages
Closed

feat: Stream tool progress messages to Open WebUI#4032
sroecker wants to merge 1 commit into
NousResearch:mainfrom
sroecker:feature/stream-tool-messages

Conversation

@sroecker

Copy link
Copy Markdown
Contributor

Summary

This PR adds visibility for Hermes Agent tool execution in Open WebUI streaming responses. Users will now see inline tool progress messages (e.g., "🐍 exec python code...", "📖 read file...") as the agent works.

Changes

run_agent.py

  • Added stream_delta_callback calls in _execute_tool_calls_sequential for tool completion messages
  • Fixed _has_stream_consumers() to include tool_gen_callback check (fixes streaming path decision)
  • Added tool name length validation (≥3 chars) to prevent truncated names

api_server.py

  • Removed redundant _on_tool_progress callback
  • Tool messages now stream directly via stream_delta_callback
  • Messages appear as inline content with emoji icons

Testing

  • ✅ Verified working in Open WebUI with new chats
  • ✅ Codex code review passed (0 issues found)
  • ✅ Tested execute_code, read_file, web_search tools

Examples

Users will see messages like:

🐍 exec      python calculation  0.5s
📖 read_file    /etc/os-release  0.3s
🔍 web_search    "Python 3.12 release"  1.2s

Notes

  • Tool messages appear inline with LLM responses
  • Works with streaming enabled (stream: true)
  • Requires starting new chat (old chats may be cached)

Add tool execution progress visibility in Open WebUI streaming responses:

- Add stream_delta_callback calls in _execute_tool_calls_sequential for
tool completion messages (both concurrent and sequential paths)
- Add _has_stream_consumers() check to include tool_gen_callback in
streaming path decision
- Add tool name length validation to prevent truncated names (<3 chars)
- Stream tool messages as inline content using emoji icons

Changes:
- run_agent.py: Tool completion callbacks and streaming consumer check
- api_server.py: Remove redundant _on_tool_progress, use direct callback

Fixes codex review findings:
- Streaming consumer registration
- Truncated tool name handling
teknium1 added a commit that referenced this pull request Mar 31, 2026
Wire the existing tool_progress_callback through the API server's
streaming handler so Open WebUI users see what tool is running.

Uses the existing 3-arg callback signature (name, preview, args)
that fires at tool start — no changes to run_agent.py needed.
Progress appears as inline markdown in the SSE content stream.

Inspired by PR #4032 by sroecker, reimplemented to avoid breaking
the callback signature used by CLI and gateway consumers.
@teknium1

Copy link
Copy Markdown
Contributor

Merged via #4092 with a reimplemented approach. Your idea of streaming tool progress to Open WebUI was the right call — the implementation needed to use the existing 3-arg callback signature to avoid breaking CLI and gateway consumers. Thanks for the inspiration @sroecker!

@teknium1 teknium1 closed this Mar 31, 2026
teknium1 added a commit that referenced this pull request Mar 31, 2026
Wire the existing tool_progress_callback through the API server's
streaming handler so Open WebUI users see what tool is running.

Uses the existing 3-arg callback signature (name, preview, args)
that fires at tool start — no changes to run_agent.py needed.
Progress appears as inline markdown in the SSE content stream.

Inspired by PR #4032 by sroecker, reimplemented to avoid breaking
the callback signature used by CLI and gateway consumers.
angelburgosrosado pushed a commit to angelburgosrosado/hermes-agent that referenced this pull request Apr 27, 2026
Wire the existing tool_progress_callback through the API server's
streaming handler so Open WebUI users see what tool is running.

Uses the existing 3-arg callback signature (name, preview, args)
that fires at tool start — no changes to run_agent.py needed.
Progress appears as inline markdown in the SSE content stream.

Inspired by PR NousResearch#4032 by sroecker, reimplemented to avoid breaking
the callback signature used by CLI and gateway consumers.
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
Wire the existing tool_progress_callback through the API server's
streaming handler so Open WebUI users see what tool is running.

Uses the existing 3-arg callback signature (name, preview, args)
that fires at tool start — no changes to run_agent.py needed.
Progress appears as inline markdown in the SSE content stream.

Inspired by PR NousResearch#4032 by sroecker, reimplemented to avoid breaking
the callback signature used by CLI and gateway consumers.
olympus-terminal pushed a commit to olympus-terminal/hermes-agent that referenced this pull request May 16, 2026
Wire the existing tool_progress_callback through the API server's
streaming handler so Open WebUI users see what tool is running.

Uses the existing 3-arg callback signature (name, preview, args)
that fires at tool start — no changes to run_agent.py needed.
Progress appears as inline markdown in the SSE content stream.

Inspired by PR NousResearch#4032 by sroecker, reimplemented to avoid breaking
the callback signature used by CLI and gateway consumers.
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
Wire the existing tool_progress_callback through the API server's
streaming handler so Open WebUI users see what tool is running.

Uses the existing 3-arg callback signature (name, preview, args)
that fires at tool start — no changes to run_agent.py needed.
Progress appears as inline markdown in the SSE content stream.

Inspired by PR NousResearch#4032 by sroecker, reimplemented to avoid breaking
the callback signature used by CLI and gateway consumers.
Egavasyug pushed a commit to Egavasyug/hermes-agent that referenced this pull request Jun 10, 2026
Wire the existing tool_progress_callback through the API server's
streaming handler so Open WebUI users see what tool is running.

Uses the existing 3-arg callback signature (name, preview, args)
that fires at tool start — no changes to run_agent.py needed.
Progress appears as inline markdown in the SSE content stream.

Inspired by PR NousResearch#4032 by sroecker, reimplemented to avoid breaking
the callback signature used by CLI and gateway consumers.
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.

2 participants