feat(tools): add notification_tool for desktop/system notifications#170
feat(tools): add notification_tool for desktop/system notifications#170ygd58 wants to merge 36 commits into
Conversation
This script provides functions to search Notion pages by title and retrieve database schema properties.
Adds a function to fetch model metadata from Hugging Face.
Added operational guidelines for Hugging Face model expertise.
This function executes a Python code snippet in a secure subprocess, capturing output or errors. It includes error handling for timeouts and system errors.
Added operational guidelines for the Autonomous Code Verification Skill.
This skill enables Hermes to autonomously extend its own capabilities by writing new Python tools from scratch, testing them, and registering them without human intervention.
This script fetches current weather data for any city using the Open-Meteo API without requiring an API key. It includes geocoding functionality to convert city names to geographic coordinates.
This file contains a suite of tests for the weather tool, checking various scenarios including valid and invalid city inputs, temperature units, and response structure.
Added documentation for the Adventure Log and self-tool building capabilities of Hermes Agent, including installation instructions and test results.
Introduced a self-tool builder skill for Hermes that enables autonomous tool creation, testing, and registration without human intervention. Includes demo tools and tests.
Implemented the mcp-server command for Hermes CLI with options for HTTP transport, host, and port.
Implemented the mcp-server command for the CLI, allowing users to start the Hermes MCP Server with HTTP options.
Implement session analytics for the /stats command, reading from the session database and rendering a summary.
Removed docstrings from several functions to streamline code.
|
This does look interesting and useful - I see you've made a lot of extra commits - would you say its ready for review now? |
Yes, it's ready for review! The relevant commits are the last 3: feat(tools): add notification_tool with desktop/system notifications The earlier commits in the branch are unrelated work from my fork. The actual changes are clean — one new file (tools/notification_tool.py) and two small modifications (toolsets.py, model_tools.py). Happy to clean up the branch history if needed! |
Refactor pomodoro tool to use function-based handlers instead of registry-based registration. Update notification handling and add availability check.
|
Hey @ygd58 — this is Hermes-Agent (Teknium's AI assistant) doing code review on this PR. The notification concept is great — alerting users when long tasks finish is a real gap, especially for CLI users. However, there are several blocking issues that mean this needs a ground-up rebuild rather than fixes on top. I'll break them down: 1. Stale Branch (blocker)The PR touches 22 files but only 3 are relevant to notifications ( 2. Wrong Registration Pattern (blocker — tool won't load)The PR uses a # What the PR does:
def register(registry):
registry.register(name=..., description=..., parameters=..., handler=...)
# What the codebase actually expects (see tools/tts_tool.py, tools/terminal_tool.py, etc.):
from tools.registry import registry
registry.register(
name="tool_name",
toolset="toolset_name", # required, missing from PR
schema={...}, # full OpenAI-format schema dict, not separate params
handler=lambda args, **kw: ...,
check_fn=check_function,
)The tool would fail to load entirely because 3. Handler Signature Mismatch (blocker)PR handlers: Even if registration worked, every call would crash with a TypeError. Existing tools use lambda wrappers: handler=lambda args, **kw: handle_notify(
title=args.get("title", ""),
message=args.get("message", ""),
urgency=args.get("urgency", "normal"),
)4. Remote Machine / SSH (design issue)This is the big conceptual problem. Hermes often runs on remote machines via SSH — which is exactly the scenario where "long-running task finished" notifications are most wanted. But:
Over SSH, none of these work. The 5. Command Injection Vulnerability (security)
def _esc(s: str) -> str:
return s.replace("'", "\\'").replace('"', '\\"')This is interpolated directly into shell commands:
User-controlled input should never be interpolated into shell command strings. Use 6. Platform Compatibility Issues
RecommendationThe concept is solid and we'd love to have notification support. I'm opening a separate issue to track this as a feature request. A clean rebuild should:
Thanks for the contribution and the idea! 🙏 |
Summary
Adds a new
notification_toolthat lets Hermes send desktop notifications and play alert sounds — no messaging platform (Telegram/Discord) required.Motivation
Hermes runs long tasks but had no way to alert the user when finished unless a gateway was running. This tool fills that gap using OS built-ins only.
Changes
tools/notification_tool.py(new): two tools —notifyandnotify_soundtoolsets.py: registerednotificationtoolsetmodel_tools.py: added to tool discoveryTools added
notify— desktop notification (Linux: notify-send, macOS: osascript, Windows: PowerShell toast)notify_sound— system alert sound (paplay/afplay/PowerShell)Notes