Skip to content

fix: include non-configurable toolsets (messaging/send_message) in gateway reverse-map - #7333

Closed
akhater wants to merge 1 commit into
NousResearch:mainfrom
akhater:fix/messaging-toolset-reverse-map
Closed

fix: include non-configurable toolsets (messaging/send_message) in gateway reverse-map#7333
akhater wants to merge 1 commit into
NousResearch:mainfrom
akhater:fix/messaging-toolset-reverse-map

Conversation

@akhater

@akhater akhater commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

Problem

_get_platform_tools() builds the enabled toolset list via a reverse-mapping loop that only iterated over CONFIGURABLE_TOOLSETS. The messaging toolset (containing send_message) is intentionally not user-configurable, so it was never added to the enabled set.

Result: send_message was silently excluded before check_fn was even evaluated. The tool never appeared in the agent's schema when running via gateway.

Root cause

# Only checked CONFIGURABLE_TOOLSETS — messaging not in the list
for ts_key, _, _ in CONFIGURABLE_TOOLSETS:
    ts_tools = set(resolve_toolset(ts_key))
    if ts_tools and ts_tools.issubset(all_tool_names):
        enabled_toolsets.add(ts_key)

send_message is in _HERMES_CORE_TOOLS and fully present in hermes-telegram, but messaging was never reverse-mapped.

Fix

After the CONFIGURABLE_TOOLSETS loop, also scan toolsets defined in TOOLSETS that are neither configurable nor platform defaults. Any whose tools are fully covered by the base composite toolset are auto-included. Adds a logger.debug line for visibility.

Only affects the else branch (no explicit saved config) — profiles that have run hermes tools and saved explicit toolset lists are unaffected.

Test plan

  • Fresh profile with no platform_toolsets config: confirm send_message appears in agent tool schema
  • Profile with explicit platform_toolsets saved via hermes tools: confirm existing behaviour unchanged
  • Confirm check_fn is now actually evaluated (and passes when gateway is running)

🤖 Generated with Claude Code

…-mapping

_get_platform_tools() uses a reverse-mapping loop to infer which toolsets
are enabled when no explicit platform_toolsets config exists. The loop
iterated only over CONFIGURABLE_TOOLSETS, silently dropping any toolset
not listed there — including "messaging", which is the toolset containing
send_message.

send_message is in _HERMES_CORE_TOOLS and is fully present in the
hermes-telegram composite toolset, but because "messaging" was not in
CONFIGURABLE_TOOLSETS, it was never added to the enabled set. The
check_fn was never even evaluated — the tool was excluded before runtime.

Fix: after the CONFIGURABLE_TOOLSETS loop, also iterate over all
toolsets defined in TOOLSETS that are neither configurable nor platform
defaults. Any whose tools are fully covered by the base composite toolset
are added to enabled_toolsets. Adds a logger.debug line for visibility.

This only affects the else-branch (no explicit saved config), so
profiles that have run `hermes tools` and saved explicit toolset lists
are unaffected.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@teknium1

Copy link
Copy Markdown
Contributor

This is an automated hermes-sweeper review.

The bug described here — messaging/send_message being silently excluded from the enabled toolset set in _get_platform_tools() — is already fixed on main.

  • Commit da8bab77f (fix(cli): restore messaging toolset for gateway platforms) added ("messaging", "📨 Cross-Platform Messaging", "send_message") directly to CONFIGURABLE_TOOLSETS in hermes_cli/tools_config.py (line 68). This means messaging is now included in the existing reverse-map loop, which is a simpler fix than this PR's post-loop scan approach.
  • That same commit added the two tests from this PR's test plan: test_configurable_toolsets_include_messaging and test_get_platform_tools_default_telegram_includes_messaging in tests/hermes_cli/test_tools_config.py.
  • The fix is verified present in the current main checkout.

Thank you for the investigation and the well-structured PR — the root cause analysis here was accurate, and an independent fix landed just a few days later.

@teknium1 teknium1 closed this Apr 28, 2026
@akhater
akhater deleted the fix/messaging-toolset-reverse-map branch May 1, 2026 17:59
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