@@ -29,21 +29,12 @@ describe("agent run terminal outcome", () => {
2929 } ) ;
3030
3131 it ( "normalizes lifecycle signals with timeout, cancellation, failure precedence" , ( ) => {
32- const bareAbort = { phase : "end" , data : { aborted : true } } as const ;
33- expect ( buildAgentRunTerminalOutcomeFromLifecycleEvent ( bareAbort ) ) . toMatchObject ( {
34- reason : "aborted" ,
35- status : "error" ,
36- stopReason : "aborted" ,
37- } ) ;
38- const explicitAbort = {
39- phase : "end" ,
40- data : { aborted : true , stopReason : "aborted" , livenessState : "blocked" } ,
41- } as const ;
42- expect ( buildAgentRunTerminalOutcomeFromLifecycleEvent ( explicitAbort ) ) . toMatchObject ( {
43- reason : "aborted" ,
44- status : "error" ,
45- stopReason : "aborted" ,
46- } ) ;
32+ expect (
33+ buildAgentRunTerminalOutcomeFromLifecycleEvent ( {
34+ phase : "end" ,
35+ data : { aborted : true } ,
36+ } ) ,
37+ ) . toMatchObject ( { reason : "aborted" , status : "error" , stopReason : "aborted" } ) ;
4738 expect (
4839 buildAgentRunTerminalOutcomeFromLifecycleEvent ( {
4940 phase : "end" ,
@@ -288,23 +279,20 @@ describe("agent run terminal outcome", () => {
288279 } ) ;
289280 } ) ;
290281
291- it . each ( [ "blocked" , "abandoned" ] ) (
292- "keeps explicit cancellation ahead of %s liveness" ,
293- ( livenessState ) => {
294- expect (
295- buildAgentRunTerminalOutcome ( {
296- status : "error" ,
297- stopReason : "stop" ,
298- livenessState,
299- } ) ,
300- ) . toEqual ( {
301- reason : "cancelled" ,
282+ it ( "keeps explicit cancellation ahead of abandoned liveness" , ( ) => {
283+ expect (
284+ buildAgentRunTerminalOutcome ( {
302285 status : "error" ,
303286 stopReason : "stop" ,
304- livenessState,
305- } ) ;
306- } ,
307- ) ;
287+ livenessState : "abandoned" ,
288+ } ) ,
289+ ) . toEqual ( {
290+ reason : "cancelled" ,
291+ status : "error" ,
292+ stopReason : "stop" ,
293+ livenessState : "abandoned" ,
294+ } ) ;
295+ } ) ;
308296
309297 it ( "keeps a hard timeout over later aborts or failures for the same run" , ( ) => {
310298 const timeout = buildAgentRunTerminalOutcome ( {
0 commit comments