fix(tools): hidden tools promoted in the parent registry rather than the subagent's registry#2793
fix(tools): hidden tools promoted in the parent registry rather than the subagent's registry#2793bogdanovich wants to merge 2 commits intosipeed:mainfrom
Conversation
efee12b to
883c3f4
Compare
|
Addressed the review point. I removed the concrete-type switch from Also rebased the branch on current
Please take another look when convenient. |
883c3f4 to
cb606cd
Compare
|
Closing this as superseded by upstream. The requested architectural shape is now already present on |
Summary
Fix deferred tool discovery inside cloned tool registries, especially subagent turns.
ToolRegistry.Clone()previously shallow-copied every tool entry. Discovery tools such asBM25SearchToolandRegexSearchToolstore a pointer to the registry they search and promote tools in. After cloning a registry for a subagent, the cloned search tool still pointed at the parent registry.That meant a subagent could call
tool_search_tool_bm25, get a successful "promoted tools" result, but the hidden tools were promoted in the parent registry rather than the subagent's cloned registry. The next subagent LLM iteration still could not call the discovered tools.Changes
ToolRegistry.Clone()so they point at the cloned registry.Validation
go test ./pkg/tools -run 'TestToolRegistry_Clone_RebindsDiscoveryToolsToClone|TestToolRegistry_Clone' -count=1go test ./pkg/tools ./pkg/agent