@@ -31,6 +31,10 @@ import {
3131import { withKeyedLock } from '@agent-device/kernel/keyed-lock' ;
3232import type { DaemonRequest } from '../../core/daemon-request.ts' ;
3333import { mkdtempForTestSync , createTestHostEnvironment } from '@agent-device/test-kit' ;
34+ import {
35+ platformRequestScopeFixture ,
36+ unavailableDeviceRuntimeGateway ,
37+ } from '../../__tests__/support/unavailable-device-runtime-gateway.ts' ;
3438
3539const TEST_ROOT = mkdtempForTestSync ( 'agent-device-session-idle-activity-' ) ;
3640const LOG_PATH = path . join ( TEST_ROOT , 'diagnostics.log' ) ;
@@ -62,6 +66,8 @@ test('a command that completes under the session lock stamps the session it ran
6266 host : createTestHostEnvironment ( ) ,
6367 platformServices : daemonPlatformServicesFixture ( ) ,
6468 claimRecoveryGateway : daemonClaimRecoveryGatewayFixture ( ) ,
69+ deviceRuntimeGateway : unavailableDeviceRuntimeGateway ,
70+ platformRequestScope : platformRequestScopeFixture ( ) ,
6571 req : makeRequest ( { command : 'snapshot' } ) ,
6672 sessionStore,
6773 leaseRegistry : new LeaseRegistry ( ) ,
@@ -92,6 +98,8 @@ test('ordinary failed lease admission retains the session activity stamp', async
9298 host : createTestHostEnvironment ( ) ,
9399 platformServices : daemonPlatformServicesFixture ( ) ,
94100 claimRecoveryGateway : daemonClaimRecoveryGatewayFixture ( ) ,
101+ deviceRuntimeGateway : unavailableDeviceRuntimeGateway ,
102+ platformRequestScope : platformRequestScopeFixture ( ) ,
95103 req : makeRequest ( { command : 'home' , meta : { leaseId : 'foreign-lease' } } ) ,
96104 sessionStore,
97105 leaseRegistry,
@@ -111,6 +119,8 @@ test('a lock-exempt inventory command reports no activity, even against a claim-
111119 host : createTestHostEnvironment ( ) ,
112120 platformServices : daemonPlatformServicesFixture ( ) ,
113121 claimRecoveryGateway : daemonClaimRecoveryGatewayFixture ( ) ,
122+ deviceRuntimeGateway : unavailableDeviceRuntimeGateway ,
123+ platformRequestScope : platformRequestScopeFixture ( ) ,
114124 req : makeRequest ( { command : 'devices' } ) ,
115125 sessionStore,
116126 leaseRegistry : new LeaseRegistry ( ) ,
@@ -134,6 +144,8 @@ test('a command whose client hung up mid-flight preserves no activity', async ()
134144 host : createTestHostEnvironment ( ) ,
135145 platformServices : daemonPlatformServicesFixture ( ) ,
136146 claimRecoveryGateway : daemonClaimRecoveryGatewayFixture ( ) ,
147+ deviceRuntimeGateway : unavailableDeviceRuntimeGateway ,
148+ platformRequestScope : platformRequestScopeFixture ( ) ,
137149 req : makeRequest ( { command : 'snapshot' , meta : { requestId } } ) ,
138150 sessionStore,
139151 leaseRegistry : new LeaseRegistry ( ) ,
@@ -164,6 +176,8 @@ test('a command still running when the expiry arrives blocks it until the stamp
164176 host : createTestHostEnvironment ( ) ,
165177 platformServices : daemonPlatformServicesFixture ( ) ,
166178 claimRecoveryGateway : daemonClaimRecoveryGatewayFixture ( ) ,
179+ deviceRuntimeGateway : unavailableDeviceRuntimeGateway ,
180+ platformRequestScope : platformRequestScopeFixture ( ) ,
167181 req : makeRequest ( { command : 'snapshot' } ) ,
168182 sessionStore,
169183 leaseRegistry,
@@ -217,6 +231,8 @@ test('the reaper never observes a mid-command session through the shared map', a
217231 host : createTestHostEnvironment ( ) ,
218232 platformServices : daemonPlatformServicesFixture ( ) ,
219233 claimRecoveryGateway : daemonClaimRecoveryGatewayFixture ( ) ,
234+ deviceRuntimeGateway : unavailableDeviceRuntimeGateway ,
235+ platformRequestScope : platformRequestScopeFixture ( ) ,
220236 req : makeRequest ( { command : 'snapshot' } ) ,
221237 sessionStore,
222238 leaseRegistry,
0 commit comments