diff --git a/sdk/src/query-runtime-bridge.test.ts b/sdk/src/query-runtime-bridge.test.ts index 903ec3f2b..cb9233c90 100644 --- a/sdk/src/query-runtime-bridge.test.ts +++ b/sdk/src/query-runtime-bridge.test.ts @@ -117,6 +117,7 @@ describe('QueryRuntimeBridge observability', () => { type: 'query_hotpath_dispatch', command: 'commit', dispatchMode: 'subprocess', + reason: 'native_disabled', outcome: 'success', }), ); @@ -141,6 +142,7 @@ describe('QueryRuntimeBridge observability', () => { type: 'query_hotpath_dispatch', command: 'commit', dispatchMode: 'subprocess', + reason: 'policy_blocked', outcome: 'error', }), ); diff --git a/sdk/src/query-runtime-bridge.ts b/sdk/src/query-runtime-bridge.ts index ea2611bde..f37bca580 100644 --- a/sdk/src/query-runtime-bridge.ts +++ b/sdk/src/query-runtime-bridge.ts @@ -35,6 +35,7 @@ export interface RuntimeBridgeHotpathEvent { legacyCommand: string; mode: TransportMode; dispatchMode: 'native_hotpath' | 'subprocess'; + reason?: 'native_disabled' | 'policy_blocked'; durationMs: number; outcome: 'success' | 'error'; errorKind?: 'timeout' | 'failure'; @@ -168,6 +169,7 @@ export class QueryRuntimeBridge { legacyCommand, mode, dispatchMode: 'subprocess', + reason: 'policy_blocked', durationMs: Date.now() - startedAt, outcome: 'error', errorKind: 'failure', @@ -189,6 +191,7 @@ export class QueryRuntimeBridge { legacyCommand, mode, dispatchMode: useNative ? 'native_hotpath' : 'subprocess', + reason: useNative ? undefined : 'native_disabled', durationMs: Date.now() - startedAt, outcome: 'success', }); @@ -201,6 +204,7 @@ export class QueryRuntimeBridge { legacyCommand, mode, dispatchMode: useNative ? 'native_hotpath' : 'subprocess', + reason: useNative ? undefined : 'native_disabled', durationMs: Date.now() - startedAt, outcome: 'error', errorKind: kind,