fix(rpc): register missing MCP and tool registry RPC handlers#2803
fix(rpc): register missing MCP and tool registry RPC handlers#2803graycyrus wants to merge 2 commits into
Conversation
The five legacy method names that appeared in Sentry (CORE-RUST-DR/DS/DT/DV/DW) were not registered in either the server-side or client-side alias tables: - openhuman.tool_registry_call (early mis-spelling of mcp_clients_tool_call) - openhuman.mcp_servers_list (old list method name) - openhuman.mcp_list (bare name before namespacing) - openhuman.mcp_clients_list (pre-canonical list method) - mcp_clients.list (dotted-namespace variant) Added symmetric aliases to both: - src/core/legacy_aliases.rs: server-side rewrite before dispatch (Tier 0 in dispatch.rs), so older shipped bundles calling the legacy names are silently routed to the canonical handlers without "unknown method" errors. - app/src/services/rpcMethods.ts: CORE_RPC_METHODS entries for the two canonical methods (mcp_clients_installed_list, mcp_clients_tool_call) and LEGACY_METHOD_ALIASES entries for all five legacy names, so newer frontend builds also normalise outgoing calls before they hit the wire. Added unit tests in rpcMethods.test.ts covering each legacy alias, the pass-through of canonical names, and a drift-guard that cross-checks CORE_RPC_METHODS entries against the mcp_registry/schemas.rs catalog. Closes tinyhumansai#2789
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis PR adds support for legacy MCP method naming by introducing two canonical RPC method identifiers on the frontend, mapping historic naming variants to those identifiers on both client and server sides, and validating the mappings through test coverage and schema validation. ChangesMCP Client Method Alias Resolution
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Comment |
graycyrus
left a comment
There was a problem hiding this comment.
@graycyrus hey! the code looks good to me, but E2E (Windows / Appium Chromium) is still red. once that passes, i'll come back and approve this.
Walkthrough
Fixes five missing legacy RPC method aliases that were generating "unknown method" errors on older bundles. Three files touched:
src/core/legacy_aliases.rs— adds the five aliases to the static LEGACY_ALIASES tableapp/src/services/rpcMethods.ts— adds the two canonical method constants and the five frontend-side aliasesapp/src/services/__tests__/rpcMethods.test.ts— 7 new alias resolution tests + extends the drift guard to cover the mcp_registry schema source
The approach is correct: alias at dispatch rather than adding duplicate handlers. Rust and TypeScript tables are in sync. Coverage gate passed. No breaking changes — purely additive.
One thing to sort before this lands: the PR body mentions bypassing the pre-push hook with --no-verify. I know those 62 setState-in-effects warnings are pre-existing, but landing with a suppressed hook makes it easy to miss when new warnings sneak in. Worth either fixing the upstream warnings or adjusting the lint rule so the hook can run clean.
Summary
openhuman.tool_registry_call,openhuman.mcp_servers_list,openhuman.mcp_list,openhuman.mcp_clients_list,mcp_clients.list) to both the server-sidesrc/core/legacy_aliases.rsand the frontendapp/src/services/rpcMethods.tsopenhuman.mcp_clients_installed_listandopenhuman.mcp_clients_tool_callcontrollers, which are already registered in the MCP registry domainRoot cause
The
mcp_registrydomain was introduced in a prior PR but the legacy method names that older bundles used were never registered in the alias tables. Calls from clients still using the legacy names fell through to the "unknown method" error path at Tier 3 indispatch.rs.Test plan
rpcMethods.test.ts: 14 tests pass, including 7 new MCP-specific casesCloses #2789
Sentry: CORE-RUST-DW, DV, DT, DS, DR
Summary by CodeRabbit
Bug Fixes
Tests