fix: expose context engine tools with saved toolsets (salvage of #31194) - #33719
Merged
Conversation
Contributor
🔎 Lint report:
|
19 tasks
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Plugin context engines like hermes-lcm expose runtime tools through
get_tool_schemas().AIAgentonly injects those schemas when thecontext_enginetoolset is enabled (agent/agent_init.py:1497). But:context_enginewasn't a registered toolset intoolsets.pyhermes tools(web,terminal, etc.) never included itSo an active LCM session running with
context.engine: lcmwould never see thelcm_*tools — the schemas existed but the toolset gate filtered them out.This adds a first-class
context_enginetoolset and auto-enables it when a non-defaultcontext.engineis configured, while preserving the explicit empty-selection contract (a user who deliberately deselects everything still gets nothing).Changes
toolsets.py— adds a staticcontext_enginetoolset entry (empty tool list; engines populate at runtime viaget_tool_schemas())hermes_cli/tools_config.py— addscontext_enginetoCONFIGURABLE_TOOLSETS;_get_platform_tools()auto-enables it whencontext.engineis set to anything other than the defaultcompressor, unless the user has explicitly saved an empty selectiontests/hermes_cli/test_tools_config.py— 40 lines of regressions for visibility with explicit platform toolsets, default compressor behavior, and the empty-selection contracttests/run_agent/test_plugin_context_engine_init.py— end-to-end regression proving a plugin context engine's tool schema reachesAIAgent.valid_tool_namesafter platform tool resolutionValidation
Salvage notes
Salvage of PR #31194 by @stephenschoettler — original commit
6bd2b5b43cherry-picked onto current main with authorship preserved (455 commits behind when picked, conflict-free auto-merge). Original PR will be closed with credit after merge.Related: stephenschoettler/hermes-lcm#200.