@@ -435,18 +435,20 @@ describe("qa scenario catalog", () => {
435435 expect ( readQaScenarioById ( "long-context-progress-watchdog" ) . sourcePath ) . toBe (
436436 "qa/scenarios/runtime/long-context-progress-watchdog.yaml" ,
437437 ) ;
438- expect (
439- JSON . stringify ( readQaScenarioById ( "gateway-restart-inflight-run" ) . execution . flow ) ,
440- ) . toContain ( "EmbeddedAttemptSessionTakeoverError" ) ;
441- expect (
442- JSON . stringify ( readQaScenarioById ( "gateway-restart-inflight-run" ) . execution . flow ) ,
443- ) . toContain ( "AbortError" ) ;
444- expect (
445- JSON . stringify ( readQaScenarioById ( "gateway-restart-inflight-run" ) . execution . flow ) ,
446- ) . toContain ( "This operation was aborted" ) ;
447- expect (
448- JSON . stringify ( readQaScenarioById ( "gateway-restart-inflight-run" ) . execution . flow ) ,
449- ) . toContain ( "liveTurnTimeoutMs(env, 180000)" ) ;
438+ const gatewayRestartFlow = readQaScenarioById ( "gateway-restart-inflight-run" ) . execution . flow ;
439+ const interruptedStatusAssertion = gatewayRestartFlow ?. steps
440+ . flatMap ( ( step ) => step . actions )
441+ . find ( ( action ) =>
442+ JSON . stringify ( action ) . includes ( "interrupted agent run ended with unexpected status" ) ,
443+ ) ;
444+ expect ( interruptedStatusAssertion ) . toBeDefined ( ) ;
445+ const interruptedStatusContract = JSON . stringify ( interruptedStatusAssertion ) ;
446+ expect ( interruptedStatusContract ) . toContain ( "waited.stopReason === 'restart'" ) ;
447+ expect ( interruptedStatusContract ) . toContain ( "waited.stopReason === 'aborted'" ) ;
448+ expect ( interruptedStatusContract ) . toContain ( "EmbeddedAttemptSessionTakeoverError" ) ;
449+ expect ( interruptedStatusContract ) . toContain ( "AbortError" ) ;
450+ expect ( interruptedStatusContract ) . toContain ( "This operation was aborted" ) ;
451+ expect ( JSON . stringify ( gatewayRestartFlow ) ) . toContain ( "liveTurnTimeoutMs(env, 180000)" ) ;
450452 const longContextFlow = JSON . stringify (
451453 readQaScenarioById ( "long-context-progress-watchdog" ) . execution . flow ,
452454 ) ;
0 commit comments