Skip to content

feat(tool_search): add platform-aware core tool deferral config - #42551

Open
directorboint-arch wants to merge 1 commit into
NousResearch:mainfrom
directorboint-arch:feat/tool-search-platform-aware-core-deferral
Open

feat(tool_search): add platform-aware core tool deferral config#42551
directorboint-arch wants to merge 1 commit into
NousResearch:mainfrom
directorboint-arch:feat/tool-search-platform-aware-core-deferral

Conversation

@directorboint-arch

Copy link
Copy Markdown

Summary

  • Allow users to opt specific core tools/toolsets into progressive disclosure via a tool_search_deferred_core config key. This lets platforms that expose many tools (CLI, gateway, cron) control which core tools appear in the initial search vs. deferred discovery.
  • Wired through model_tools resolution so deferred tools remain discoverable but are not returned until explicitly requested.
  • Agent initialization now respects the deferred toolset list from config.

Local verification

  • Verified against origin/main (e881162). Four files: tools/tool_search.py, model_tools.py, agent/agent_init.py, agent/tool_executor.py. AST clean, no credential/IP leakage.

Commits
text
bfaeac0 feat(tool_search): add platform-aware core tool deferral config

Allow users to opt specific core tools/toolsets into progressive disclosure.
This enables platform-specific customization so heavy-hitting tools can be
deferrable on TUI/CLI while staying visible on Signal or Telegram.

- Add defer_core_tools, defer_core_toolsets, defer_core_platforms config keys
- Implement _string_list() helper and _configured_deferred_core_names() lookup
- Thread platform parameter through get_tool_definitions assemble chain
- Update is_deferrable_tool_name to respect user override + platform gating
@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/tools Tool registry, model_tools, toolsets comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint labels Jun 9, 2026

@tonydwb tonydwb 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.

Code Review Summary

Verdict: Approved

Overview

This PR adds platform-aware core tool deferral config to the tool_search feature.

Changes

  • Adds defer_core_tools, defer_core_toolsets, defer_core_platforms config options
  • Updates is_deferrable_tool_name to check platform-specific config
  • Passes platform through tool_search pipeline

Quality

  • Clean feature addition
  • No security concerns
  • Good documentation in code comments

Reviewed by Hermes Agent

@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 extending the existing bridge rather than adding new model tools. There are two blockers before this can be evaluated as a salvage candidate.

Problems

  • Current main deliberately defines core tools as always-direct: tools/tool_search.py:163-174, its regression test at tests/tools/test_tool_search.py:92-102, and the public contract at website/docs/user-guide/features/tool-search.md:18-24. Changing that invariant needs a maintainer design decision.
  • The platform allowlist does not reach the normal agent invocation path. The PR passes platform into scope construction at agent/tool_executor.py:173-175, but the executor still unwraps with no platform (current-main equivalents agent/tool_executor.py:403 and :1077) and calls handle_function_call without one (:1475-1487, :1517-1529). With defer_core_platforms set, a core tool can be deferred at assembly and then rejected when invoked.
  • The diff has no tests or docs, despite adding user-facing config.

Suggested changes

  • Resolve the core-tool contract first; if accepted, update the existing invariant tests and Tool Search documentation.
  • Propagate platform through every bridge unwrap/dispatch path and add an allowlisted-platform end-to-end bridge test.

Automated hermes-sweeper review.

Comment thread agent/tool_executor.py
disabled_toolsets=disabled,
quiet_mode=True,
skip_tool_search_assembly=True,
platform=getattr(agent, "platform", None),

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.

Passing platform only into scope construction is insufficient: the two executor resolve_underlying_call(function_args) sites and their later handle_function_call(...) calls still omit it. With a nonempty defer_core_platforms, a core tool deferred for this agent will fail to unwrap because those paths resolve with platform=None. Thread agent.platform through the complete invocation path and cover that configuration in an integration test.

@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-caching Sweeper risk: may break/degrade prompt caching or cache-key stability (invariant) sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users labels Jul 14, 2026
Tranquil-Flow pushed a commit to Tranquil-Flow/hermes-agent that referenced this pull request Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/tools Tool registry, model_tools, toolsets P3 Low — cosmetic, nice to have sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users sweeper:risk-caching Sweeper risk: may break/degrade prompt caching or cache-key stability (invariant) sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants