From ab7ec84dee014f12b2a31deb463fc1d181c30299 Mon Sep 17 00:00:00 2001 From: "cyrus@tinyhumans.ai" Date: Thu, 28 May 2026 18:45:02 +0530 Subject: [PATCH 1/2] fix(rpc): add health_snapshot legacy alias for bare method calls (Sentry CORE-RUST-FG) Older clients and some SDK callers issue `health_snapshot` without the `openhuman.` namespace prefix. Add the server-side legacy alias so the call resolves to `openhuman.health_snapshot`, matching the symmetric fix on the frontend side. Closes #2852. --- app/src/services/rpcMethods.ts | 3 +++ src/core/legacy_aliases.rs | 15 +++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/app/src/services/rpcMethods.ts b/app/src/services/rpcMethods.ts index a5cb50490f..fbb07e1820 100644 --- a/app/src/services/rpcMethods.ts +++ b/app/src/services/rpcMethods.ts @@ -35,6 +35,7 @@ export const CORE_RPC_METHODS = { embeddingsClearApiKey: 'openhuman.embeddings_clear_api_key', embeddingsEmbed: 'openhuman.embeddings_embed', embeddingsTestConnection: 'openhuman.embeddings_test_connection', + healthSnapshot: 'openhuman.health_snapshot', } as const; export type CoreRpcMethod = (typeof CORE_RPC_METHODS)[keyof typeof CORE_RPC_METHODS]; @@ -66,6 +67,8 @@ export const LEGACY_METHOD_ALIASES: Record = { 'openhuman.local_ai_presets': CORE_RPC_METHODS.inferencePresets, 'openhuman.providers_list_models': CORE_RPC_METHODS.inferenceListModels, 'openhuman.inference_embed': CORE_RPC_METHODS.embeddingsEmbed, + // bare form used by older clients before the `openhuman.` prefix was established + health_snapshot: CORE_RPC_METHODS.healthSnapshot, }; export function normalizeRpcMethod(method: string): string { diff --git a/src/core/legacy_aliases.rs b/src/core/legacy_aliases.rs index bb9e476438..644e392c1c 100644 --- a/src/core/legacy_aliases.rs +++ b/src/core/legacy_aliases.rs @@ -95,6 +95,9 @@ const LEGACY_ALIASES: &[(&str, &str)] = &[ "openhuman.local_ai_diagnostics", "openhuman.inference_diagnostics", ), + // bare `health_snapshot` (no namespace prefix) was used by older clients + // before the canonical `openhuman.health_snapshot` form was established. + ("health_snapshot", "openhuman.health_snapshot"), ("openhuman.inference_embed", "openhuman.embeddings_embed"), ("openhuman.local_ai_presets", "openhuman.inference_presets"), ( @@ -352,6 +355,18 @@ mod tests { ); } + #[test] + fn resolve_legacy_rewrites_bare_health_snapshot() { + // Sentry CORE-RUST-FG: older clients (and some SDK callers) issued + // `health_snapshot` without the `openhuman.` namespace prefix. The + // alias table must rewrite it to the canonical form so the call + // resolves against the registered controller. + assert_eq!( + resolve_legacy("health_snapshot"), + "openhuman.health_snapshot", + ); + } + #[test] fn resolve_legacy_passes_through_unknown_methods() { assert_eq!( From 846335dec72ed684743da9e860b9c9e9b9c04204 Mon Sep 17 00:00:00 2001 From: M3gA-Mind Date: Thu, 28 May 2026 22:44:40 +0530 Subject: [PATCH 2/2] fix(rpc): fix drift-guard CI failures for health_snapshot alias - Remove inline comment from LEGACY_METHOD_ALIASES that broke the Rust parse_frontend_legacy_aliases parser (// lines weren't filtered before .join(" ").split(","), causing a panic at legacy_aliases.rs:174) - Add src/openhuman/health/schemas.rs to the schemaSources array in the Vitest drift guard so openhuman.health_snapshot is found in the schema catalog (addresses @oxoxDev Edit A) - Add health_ namespace branch to the namespace inference chain so health_snapshot resolves to namespace "health", not the "config" fallback (addresses @oxoxDev Edit B) Fixes: test / Frontend Unit Tests, test / Rust Core Tests + Quality, Frontend Coverage (Vitest), Rust Core Coverage CI failures. --- app/src/services/__tests__/rpcMethods.test.ts | 8 +++++++- app/src/services/rpcMethods.ts | 1 - 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/src/services/__tests__/rpcMethods.test.ts b/app/src/services/__tests__/rpcMethods.test.ts index b9f03846c6..3f669e7f03 100644 --- a/app/src/services/__tests__/rpcMethods.test.ts +++ b/app/src/services/__tests__/rpcMethods.test.ts @@ -75,6 +75,10 @@ describe('rpcMethods catalog', () => { path.resolve(__dirname, '../../../../src/openhuman/embeddings/schemas.rs'), 'utf8' ), + fs.readFileSync( + path.resolve(__dirname, '../../../../src/openhuman/health/schemas.rs'), + 'utf8' + ), ].join('\n'); for (const method of Object.values(CORE_RPC_METHODS)) { @@ -89,7 +93,9 @@ describe('rpcMethods catalog', () => { ? 'embeddings' : methodRoot.startsWith('providers_') ? 'providers' - : 'config'; + : methodRoot.startsWith('health_') + ? 'health' + : 'config'; const fnName = methodRoot.slice(`${namespace}_`.length); expect(schemaSources).toContain(`namespace: "${namespace}"`); expect(schemaSources).toContain(`function: "${fnName}"`); diff --git a/app/src/services/rpcMethods.ts b/app/src/services/rpcMethods.ts index fbb07e1820..f6b665ea29 100644 --- a/app/src/services/rpcMethods.ts +++ b/app/src/services/rpcMethods.ts @@ -67,7 +67,6 @@ export const LEGACY_METHOD_ALIASES: Record = { 'openhuman.local_ai_presets': CORE_RPC_METHODS.inferencePresets, 'openhuman.providers_list_models': CORE_RPC_METHODS.inferenceListModels, 'openhuman.inference_embed': CORE_RPC_METHODS.embeddingsEmbed, - // bare form used by older clients before the `openhuman.` prefix was established health_snapshot: CORE_RPC_METHODS.healthSnapshot, };