@@ -2,7 +2,7 @@ import { beforeEach, describe, expect, it, vi } from "vitest";
22import { waitFor } from "@testing-library/react" ;
33import type { Thread } from "@/shared/contracts" ;
44import { useAppStore } from "@/renderer/state/appStore" ;
5- import { openThread , toggleMarkThreadDone } from "./threadActions" ;
5+ import { openThread , reopenStoredThread , toggleMarkThreadDone } from "./threadActions" ;
66
77const { bridge } = vi . hoisted ( ( ) => ( {
88 bridge : {
@@ -126,6 +126,25 @@ describe("threadActions", () => {
126126 } ) ;
127127 } ) ;
128128
129+ it ( "marks inactive GUI threads launching when reopening" , ( ) => {
130+ const thread = makeThread ( {
131+ presentationMode : "gui" ,
132+ status : "inactive" ,
133+ sessionRef : {
134+ providerSessionId : "session-1" ,
135+ discoveredAt : "2026-03-22T00:00:00.000Z" ,
136+ } ,
137+ } ) ;
138+ useAppStore . setState ( ( state ) => ( { ...state , threads : [ thread ] } ) ) ;
139+
140+ reopenStoredThread ( thread . id ) ;
141+
142+ const reopened = useAppStore . getState ( ) . threads [ 0 ] ;
143+ expect ( reopened ?. status ) . toBe ( "launching" ) ;
144+ expect ( reopened ?. attention ) . toBe ( "none" ) ;
145+ expect ( useAppStore . getState ( ) . pendingThreadLaunches [ thread . id ] ) . toBe ( "" ) ;
146+ } ) ;
147+
129148 it ( "closes a live CLI thread when marking done even before a session ref is known" , async ( ) => {
130149 const project = useAppStore . getState ( ) . addProject ( {
131150 kind : "posix" ,
0 commit comments