@@ -935,20 +935,31 @@ describe("resolveSidebarThreadStatus", () => {
935935 const idle = { hasPendingApprovals : false , hasPendingUserInput : false , runtime : null } ;
936936
937937 it ( "prioritizes approval over a running runtime" , ( ) => {
938- expect ( resolveSidebarThreadStatus ( { ...idle , hasPendingApprovals : true , runtime } ) ) . toBe (
939- "approval" ,
940- ) ;
938+ expect (
939+ resolveSidebarThreadStatus ( {
940+ ...idle ,
941+ hasPendingApprovals : true ,
942+ runtime,
943+ blockedOnThreadWait : true ,
944+ } ) ,
945+ ) . toBe ( "approval" ) ;
941946 } ) ;
942947
943948 it ( "prioritizes awaiting input over a running runtime, below approval" , ( ) => {
944- expect ( resolveSidebarThreadStatus ( { ...idle , hasPendingUserInput : true , runtime } ) ) . toBe (
945- "input" ,
946- ) ;
949+ expect (
950+ resolveSidebarThreadStatus ( {
951+ ...idle ,
952+ hasPendingUserInput : true ,
953+ runtime,
954+ blockedOnThreadWait : true ,
955+ } ) ,
956+ ) . toBe ( "input" ) ;
947957 expect (
948958 resolveSidebarThreadStatus ( {
949959 ...idle ,
950960 hasPendingApprovals : true ,
951961 hasPendingUserInput : true ,
962+ blockedOnThreadWait : true ,
952963 runtime,
953964 } ) ,
954965 ) . toBe ( "approval" ) ;
@@ -960,6 +971,7 @@ describe("resolveSidebarThreadStatus", () => {
960971 resolveSidebarThreadStatus ( {
961972 ...idle ,
962973 runtime : { ...runtime , status : "starting" as const } ,
974+ blockedOnThreadWait : true ,
963975 } ) ,
964976 ) . toBe ( "working" ) ;
965977 } ) ;
@@ -1283,6 +1295,7 @@ describe("resolveThreadStatusPill", () => {
12831295 ...baseThread ,
12841296 hasPendingApprovals : true ,
12851297 hasPendingUserInput : true ,
1298+ blockedOnThreadWait : true ,
12861299 } ,
12871300 } ) ,
12881301 ) . toMatchObject ( { label : "Pending Approval" , pulse : false } ) ;
@@ -1294,6 +1307,7 @@ describe("resolveThreadStatusPill", () => {
12941307 thread : {
12951308 ...baseThread ,
12961309 hasPendingUserInput : true ,
1310+ blockedOnThreadWait : true ,
12971311 } ,
12981312 } ) ,
12991313 ) . toMatchObject ( { label : "Awaiting Input" , pulse : false } ) ;
@@ -1307,6 +1321,22 @@ describe("resolveThreadStatusPill", () => {
13071321 ) . toMatchObject ( { label : "Working" , pulse : true } ) ;
13081322 } ) ;
13091323
1324+ it ( "shows an active thread wait without a pulse and resumes Working when it ends" , ( ) => {
1325+ const blocked = { ...baseThread , blockedOnThreadWait : true } ;
1326+ expect ( resolveSidebarThreadStatus ( blocked ) ) . toBe ( "waiting" ) ;
1327+ expect ( resolveThreadStatusPill ( { thread : blocked } ) ) . toMatchObject ( {
1328+ label : "Waiting" ,
1329+ pulse : false ,
1330+ } ) ;
1331+
1332+ const resumed = { ...blocked , blockedOnThreadWait : false } ;
1333+ expect ( resolveSidebarThreadStatus ( resumed ) ) . toBe ( "working" ) ;
1334+ expect ( resolveThreadStatusPill ( { thread : resumed } ) ) . toMatchObject ( {
1335+ label : "Working" ,
1336+ pulse : true ,
1337+ } ) ;
1338+ } ) ;
1339+
13101340 it ( "shows waiting for an idle thread with pending background tasks" , ( ) => {
13111341 expect (
13121342 resolveThreadStatusPill ( {
0 commit comments