Conversation
|
Orb Code Review (powered by GLM 5.1 on Orb Cloud) PR #9849 — fix(mcp): resolve toolsets from live registryWhat it doesReplaces the pattern of mutating the static Observations✅ Architectural improvement ✅ Clean deregistration ✅ Good test refactoring
for alias, canonical in aliases.items():
if canonical == ts_name and alias not in TOOLSETS:
names.add(alias)
break
else:
names.add(ts_name)The Summary: Solid architectural improvement that eliminates runtime TOOLSETS mutation in favor of live registry lookups. Clean implementation with proper cleanup semantics. Minor notes about sorted ordering change and readability. Assessment: approve |
|
Merged via PR #9947. Your commits were cherry-picked onto current main with your authorship preserved in git log. Thanks for the clean refactoring — single source of truth for MCP toolset membership is the right call. |
What changed
This PR removes the MCP-side
_sync_mcp_toolsets()path and stops mutatingtoolsets.TOOLSETSat runtime.Instead:
mcp-<server>toolset in the live registrygithuborfsare now explicit registry aliases for those canonical MCP toolsetsWhy
The old flow had two sources of truth for MCP toolsets:
TOOLSETSThat created a real stale-state problem. When an MCP server refreshed its tool list via
notifications/tools/list_changed, the registry was updated, but raw server-name toolset aliases depended on a separate_sync_mcp_toolsets()mutation path. It also meant MCP cleanup relied on manually injecting and scrubbing tools from unrelatedhermes-*toolsets.This PR makes the ownership boundary explicit:
toolsets.pyresolves static toolsets plus live registry-backed aliasesImpact
mcp-<server>remains availablehermes-*toolsetsValidation
Scoped validation that covers the changed subsystem:
python -m pytest tests/test_toolsets.py tests/tools/test_mcp_dynamic_discovery.py tests/tools/test_mcp_tool.py tests/test_model_tools.py tests/hermes_cli/test_tools_config.py -qResult:
238 passedRepresentative attribution check for broader repo reds:
I re-ran a subset of the failing full-suite tests on a clean
origin/mainworktree in the same local environment. These failures reproduce there too, so they are not introduced by this PR:tests/agent/test_auxiliary_client.py::TestReadCodexAccessToken::test_missing_returns_nonetests/hermes_cli/test_gateway_wsl.py::TestSupportsSystemdServicesWSL::test_native_linuxtests/tools/test_file_staleness.py::TestStalenessCheck::test_warning_when_file_modified_externallyI did not widen this PR to chase those unrelated failures.