@@ -108,7 +108,7 @@ describe("v2 thread shell lists", () => {
108108 registry . dispose ( ) ;
109109 } ) ;
110110
111- it ( "counts a subagent question on its parent only while the subagent runs " , ( ) => {
111+ it ( "keeps a live subagent question inside the parent without flagging its thread " , ( ) => {
112112 const { registry, threads, snapshotAtom } = makeHarness ( ) ;
113113 const root = v2ThreadShell ;
114114 const child = {
@@ -132,6 +132,10 @@ describe("v2 thread shell lists", () => {
132132 const dispose = registry . mount ( inputs ) ;
133133 registry . set ( snapshotAtom ( environmentId ) , { ...v2ShellSnapshot , threads : [ root , child ] } ) ;
134134 expect ( registry . get ( inputs ) . map ( ( thread ) => thread . id ) ) . toEqual ( [ child . id ] ) ;
135+ expect (
136+ registry . get ( threads . threadShellAtom ( { environmentId, threadId : root . id } ) )
137+ ?. pendingSubagentRequest ,
138+ ) . toBeNull ( ) ;
135139 registry . set ( snapshotAtom ( environmentId ) , {
136140 ...v2ShellSnapshot ,
137141 threads : [ root , { ...child , status : "queued" as const } ] ,
@@ -272,6 +276,16 @@ describe("v2 thread shell lists", () => {
272276 `${ remoteEnvironmentId } /${ helper . id } ` ,
273277 ] ) ;
274278
279+ registry . set ( snapshotAtom ( remoteEnvironmentId ) , {
280+ ...v2ShellSnapshot ,
281+ threads : [
282+ task ,
283+ { ...helper , pendingRuntimeRequest : { ...approval , kind : "user_input" as const } } ,
284+ ] ,
285+ } ) ;
286+ expect ( registry . get ( threads . threadShellAtom ( parentRef ) ) ?. pendingSubagentRequest ) . toBeNull ( ) ;
287+ expect ( registry . get ( inputs ) . map ( ( thread ) => thread . id ) ) . toEqual ( [ helper . id ] ) ;
288+
275289 // A task whose parent is gone there is listed on its own, as is one whose
276290 // parent's environment is switched off.
277291 registry . set ( snapshotAtom ( environmentId ) , { ...v2ShellSnapshot , threads : [ ] } ) ;
0 commit comments