@@ -24,16 +24,12 @@ function makeContextParams(
2424 overrides : Partial < GatewayRequestContextParams > = { } ,
2525) : GatewayRequestContextParams {
2626 const config = { } as never ;
27- const runtimeState : Pick < GatewayServerLiveState , "cronState" | "configReloader" > = {
27+ const runtimeState : Pick < GatewayServerLiveState , "cronState" > = {
2828 cronState : {
2929 cron : { start : vi . fn ( ) , stop : vi . fn ( ) } as never ,
3030 storePath : "/tmp/cron" ,
3131 cronEnabled : true ,
3232 } ,
33- configReloader : {
34- stop : vi . fn ( async ( ) => { } ) ,
35- notifyPluginMetadataChanged : vi . fn ( ) ,
36- } ,
3733 } ;
3834 return {
3935 deps : { } as never ,
@@ -103,6 +99,8 @@ function makeContextParams(
10399 channelWizardRunner : vi . fn ( async ( ) => undefined ) ,
104100 broadcastVoiceWakeChanged : vi . fn ( ) ,
105101 broadcastVoiceWakeRoutingChanged : vi . fn ( ) ,
102+ notifyPluginMetadataChanged : vi . fn ( ) ,
103+ getConfigReloaderHotReloadStatus : vi . fn ( ( ) => undefined ) ,
106104 unavailableGatewayMethods : new Set ( ) ,
107105 ...overrides ,
108106 } ;
@@ -161,16 +159,12 @@ describe("createGatewayRequestContext", () => {
161159 it ( "reads cron state live from runtime state" , ( ) => {
162160 const cronA = { start : vi . fn ( ) , stop : vi . fn ( ) } as never ;
163161 const cronB = { start : vi . fn ( ) , stop : vi . fn ( ) } as never ;
164- const runtimeState : Pick < GatewayServerLiveState , "cronState" | "configReloader" > = {
162+ const runtimeState : Pick < GatewayServerLiveState , "cronState" > = {
165163 cronState : {
166164 cron : cronA ,
167165 storePath : "/tmp/cron-a" ,
168166 cronEnabled : true ,
169167 } ,
170- configReloader : {
171- stop : vi . fn ( async ( ) => { } ) ,
172- notifyPluginMetadataChanged : vi . fn ( ) ,
173- } ,
174168 } ;
175169
176170 const context = createGatewayRequestContext ( makeContextParams ( { runtimeState } ) ) ;
@@ -188,38 +182,30 @@ describe("createGatewayRequestContext", () => {
188182 expect ( context . cronStorePath ) . toBe ( "/tmp/cron-b" ) ;
189183 } ) ;
190184
191- it ( "reads config hot-reload status live from runtime state" , ( ) => {
192- const runtimeState : Pick < GatewayServerLiveState , "cronState" | "configReloader" > = {
193- cronState : {
194- cron : { start : vi . fn ( ) , stop : vi . fn ( ) } as never ,
195- storePath : "/tmp/cron" ,
196- cronEnabled : true ,
197- } ,
198- configReloader : {
199- stop : vi . fn ( async ( ) => { } ) ,
200- notifyPluginMetadataChanged : vi . fn ( ) ,
201- } ,
202- } ;
203-
204- const context = createGatewayRequestContext ( makeContextParams ( { runtimeState } ) ) ;
185+ it ( "reads config hot-reload status through the live kernel bridge" , ( ) => {
186+ let status : "active" | "disabled" | undefined ;
187+ const context = createGatewayRequestContext (
188+ makeContextParams ( { getConfigReloaderHotReloadStatus : ( ) => status } ) ,
189+ ) ;
205190
206191 expect ( context . getConfigReloaderHotReloadStatus ?.( ) ) . toBeUndefined ( ) ;
207192
208- runtimeState . configReloader = {
209- stop : vi . fn ( async ( ) => { } ) ,
210- hotReloadStatus : ( ) => "active" ,
211- notifyPluginMetadataChanged : vi . fn ( ) ,
212- } ;
193+ status = "active" ;
213194 expect ( context . getConfigReloaderHotReloadStatus ?.( ) ) . toBe ( "active" ) ;
214195
215- runtimeState . configReloader = {
216- stop : vi . fn ( async ( ) => { } ) ,
217- hotReloadStatus : ( ) => "disabled" ,
218- notifyPluginMetadataChanged : vi . fn ( ) ,
219- } ;
196+ status = "disabled" ;
220197 expect ( context . getConfigReloaderHotReloadStatus ?.( ) ) . toBe ( "disabled" ) ;
221198 } ) ;
222199
200+ it ( "routes plugin metadata changes through the kernel bridge" , ( ) => {
201+ const notifyPluginMetadataChanged = vi . fn ( ) ;
202+ const context = createGatewayRequestContext ( makeContextParams ( { notifyPluginMetadataChanged } ) ) ;
203+
204+ context . notifyPluginMetadataChanged ( ) ;
205+
206+ expect ( notifyPluginMetadataChanged ) . toHaveBeenCalledOnce ( ) ;
207+ } ) ;
208+
223209 it ( "does not treat scoped CLI or backend callers as approval delivery routes" , ( ) => {
224210 const clients = new Set ( [
225211 makeGatewayClient ( {
0 commit comments