@@ -40,6 +40,7 @@ import * as ProjectionStore from "./ProjectionStore.ts";
4040import * as ProviderAdapterRegistry from "./ProviderAdapterRegistry.ts" ;
4141import * as ThreadManagementService from "./ThreadManagementService.ts" ;
4242import * as ProviderReplayHarness from "./testkit/ProviderReplayHarness.ts" ;
43+ import * as IdAllocator from "@t3tools/provider-core/server/IdAllocator" ;
4344import type * as ProviderAdapter from "@t3tools/provider-core/server/ProviderAdapter" ;
4445
4546const instanceId = ProviderInstanceId . make ( "codex" ) ;
@@ -1678,6 +1679,10 @@ it.effect("Force stop answers an unresponsive Stop of an ended run's background
16781679 const attempt = started . attempts [ 0 ] ! ;
16791680 const providerThreadId = run . providerThreadId ! ;
16801681 const providerTurnId = ProviderTurnId . make ( "provider-turn:force-stop-ended" ) ;
1682+ const requestId = IdAllocator . derive . runSignalTurnItem ( {
1683+ runId : run . id ,
1684+ signal : "interrupt-request" ,
1685+ } ) ;
16811686 const apply = ( event : Omit < OrchestrationV2DomainEvent , "id" | "threadId" > ) =>
16821687 projections . apply ( {
16831688 ...event ,
@@ -1721,7 +1726,7 @@ it.effect("Force stop answers an unresponsive Stop of an ended run's background
17211726 runId : run . id ,
17221727 occurredAt : now ,
17231728 payload : {
1724- id : TurnItemId . make ( "turn-item:force-stop-ended:interrupt-request" ) ,
1729+ id : requestId ,
17251730 threadId,
17261731 runId : run . id ,
17271732 nodeId : run . rootNodeId ! ,
@@ -1759,6 +1764,7 @@ it.effect("Force stop answers an unresponsive Stop of an ended run's background
17591764 "Force stopped by user" ,
17601765 "Force stop must answer the unresponsive Stop of an ended run" ,
17611766 ) ;
1767+ assert . equal ( result ?. parentItemId , requestId ) ;
17621768 assert . deepEqual (
17631769 settled . runs . map ( ( candidate ) => candidate . status ) ,
17641770 [ "completed" ] ,
0 commit comments