@@ -54,14 +54,16 @@ type MockSubagentRun = {
5454 task : string ;
5555 cleanup : "keep" | "delete" ;
5656 createdAt : number ;
57- endedAt ?: number ;
57+ execution : {
58+ endedAt ?: number ;
59+ outcome ?: {
60+ status : "ok" | "timeout" | "error" | "unknown" ;
61+ error ?: string ;
62+ } ;
63+ } ;
5864 cleanupCompletedAt ?: number ;
5965 label ?: string ;
6066 frozenResultText ?: string | null ;
61- outcome ?: {
62- status : "ok" | "timeout" | "error" | "unknown" ;
63- error ?: string ;
64- } ;
6567} ;
6668type SessionEntryFixture = Partial < Omit < SessionEntry , "updatedAt" > > & {
6769 updatedAt ?: number ;
@@ -2474,10 +2476,9 @@ describe("subagent announce formatting", () => {
24742476 label : "child-stale" ,
24752477 cleanup : "keep" ,
24762478 createdAt : 1 ,
2477- endedAt : 2 ,
2479+ execution : { endedAt : 2 , outcome : { status : "ok" } } ,
24782480 cleanupCompletedAt : 3 ,
24792481 frozenResultText : "stale result that should be filtered" ,
2480- outcome : { status : "ok" } ,
24812482 } ,
24822483 ] ;
24832484 }
@@ -2491,10 +2492,9 @@ describe("subagent announce formatting", () => {
24912492 label : "child-a" ,
24922493 cleanup : "keep" ,
24932494 createdAt : 10 ,
2494- endedAt : 20 ,
2495+ execution : { endedAt : 20 , outcome : { status : "ok" } } ,
24952496 cleanupCompletedAt : 21 ,
24962497 frozenResultText : "result from child a" ,
2497- outcome : { status : "ok" } ,
24982498 } ,
24992499 {
25002500 runId : "run-child-b" ,
@@ -2505,10 +2505,9 @@ describe("subagent announce formatting", () => {
25052505 label : "child-b" ,
25062506 cleanup : "keep" ,
25072507 createdAt : 11 ,
2508- endedAt : 21 ,
2508+ execution : { endedAt : 21 , outcome : { status : "ok" } } ,
25092509 cleanupCompletedAt : 22 ,
25102510 frozenResultText : "result from child b" ,
2511- outcome : { status : "ok" } ,
25122511 } ,
25132512 ] ;
25142513 } ,
@@ -2562,10 +2561,9 @@ describe("subagent announce formatting", () => {
25622561 label : "child-a" ,
25632562 cleanup : "keep" ,
25642563 createdAt : 10 ,
2565- endedAt : 20 ,
2564+ execution : { endedAt : 20 , outcome : { status : "ok" } } ,
25662565 cleanupCompletedAt : 21 ,
25672566 frozenResultText : "stale result from child a" ,
2568- outcome : { status : "ok" } ,
25692567 } ,
25702568 {
25712569 runId : "run-child-current" ,
@@ -2576,10 +2574,9 @@ describe("subagent announce formatting", () => {
25762574 label : "child-a" ,
25772575 cleanup : "keep" ,
25782576 createdAt : 11 ,
2579- endedAt : 22 ,
2577+ execution : { endedAt : 22 , outcome : { status : "ok" } } ,
25802578 cleanupCompletedAt : 23 ,
25812579 frozenResultText : "current result from child a" ,
2582- outcome : { status : "ok" } ,
25832580 } ,
25842581 {
25852582 runId : "run-child-b" ,
@@ -2590,10 +2587,9 @@ describe("subagent announce formatting", () => {
25902587 label : "child-b" ,
25912588 cleanup : "keep" ,
25922589 createdAt : 12 ,
2593- endedAt : 24 ,
2590+ execution : { endedAt : 24 , outcome : { status : "ok" } } ,
25942591 cleanupCompletedAt : 25 ,
25952592 frozenResultText : "result from child b" ,
2596- outcome : { status : "ok" } ,
25972593 } ,
25982594 ] ;
25992595 } ,
@@ -2638,10 +2634,9 @@ describe("subagent announce formatting", () => {
26382634 label : "shared-child" ,
26392635 cleanup : "keep" ,
26402636 createdAt : 10 ,
2641- endedAt : 20 ,
2637+ execution : { endedAt : 20 , outcome : { status : "ok" } } ,
26422638 cleanupCompletedAt : 21 ,
26432639 frozenResultText : "stale old parent result" ,
2644- outcome : { status : "ok" } ,
26452640 } ,
26462641 ] ;
26472642 } ,
@@ -2660,10 +2655,9 @@ describe("subagent announce formatting", () => {
26602655 label : "shared-child" ,
26612656 cleanup : "keep" ,
26622657 createdAt : 11 ,
2663- endedAt : 22 ,
2658+ execution : { endedAt : 22 , outcome : { status : "ok" } } ,
26642659 cleanupCompletedAt : 23 ,
26652660 frozenResultText : "current new parent result" ,
2666- outcome : { status : "ok" } ,
26672661 } ;
26682662 } ,
26692663 ) ;
@@ -2713,10 +2707,9 @@ describe("subagent announce formatting", () => {
27132707 label : "child-a" ,
27142708 cleanup : "keep" ,
27152709 createdAt : 10 ,
2716- endedAt : 20 ,
2710+ execution : { endedAt : 20 , outcome : { status : "ok" } } ,
27172711 cleanupCompletedAt : 21 ,
27182712 frozenResultText : "result from child a" ,
2719- outcome : { status : "ok" } ,
27202713 } ,
27212714 {
27222715 runId : "run-child-b" ,
@@ -2727,10 +2720,9 @@ describe("subagent announce formatting", () => {
27272720 label : "child-b" ,
27282721 cleanup : "keep" ,
27292722 createdAt : 11 ,
2730- endedAt : 21 ,
2723+ execution : { endedAt : 21 , outcome : { status : "ok" } } ,
27312724 cleanupCompletedAt : 22 ,
27322725 frozenResultText : "result from child b" ,
2733- outcome : { status : "ok" } ,
27342726 } ,
27352727 ] ;
27362728 } ,
@@ -2793,10 +2785,9 @@ describe("subagent announce formatting", () => {
27932785 label : "child-a" ,
27942786 cleanup : "keep" ,
27952787 createdAt : 10 ,
2796- endedAt : 20 ,
2788+ execution : { endedAt : 20 , outcome : { status : "ok" } } ,
27972789 cleanupCompletedAt : 21 ,
27982790 frozenResultText : "result from child a" ,
2799- outcome : { status : "ok" } ,
28002791 } ,
28012792 ] ;
28022793 } ,
@@ -2849,10 +2840,9 @@ describe("subagent announce formatting", () => {
28492840 label : "grandchild" ,
28502841 cleanup : "keep" ,
28512842 createdAt : 10 ,
2852- endedAt : 20 ,
2843+ execution : { endedAt : 20 , outcome : { status : "ok" } } ,
28532844 cleanupCompletedAt : 21 ,
28542845 frozenResultText : "grandchild final output" ,
2855- outcome : { status : "ok" } ,
28562846 } ,
28572847 ] ;
28582848 }
@@ -2867,10 +2857,9 @@ describe("subagent announce formatting", () => {
28672857 label : "child" ,
28682858 cleanup : "keep" ,
28692859 createdAt : 11 ,
2870- endedAt : 21 ,
2860+ execution : { endedAt : 21 , outcome : { status : "ok" } } ,
28712861 cleanupCompletedAt : 22 ,
28722862 frozenResultText : "child synthesized output from grandchild" ,
2873- outcome : { status : "ok" } ,
28742863 } ,
28752864 ] ;
28762865 }
@@ -3182,10 +3171,12 @@ describe("subagent announce formatting", () => {
31823171 label : params . label ,
31833172 cleanup : "keep" as const ,
31843173 createdAt : params . createdAt ,
3185- endedAt : params . endedAt ?? params . createdAt + 1 ,
3174+ execution : {
3175+ endedAt : params . endedAt ?? params . createdAt + 1 ,
3176+ outcome : params . outcome ?? ( { status : "ok" } as const ) ,
3177+ } ,
31863178 cleanupCompletedAt : params . cleanupCompletedAt ?? params . createdAt + 2 ,
31873179 frozenResultText : params . frozenResultText ,
3188- outcome : params . outcome ?? ( { status : "ok" } as const ) ,
31893180 } ;
31903181 }
31913182
0 commit comments