@@ -120,14 +120,17 @@ it("keeps a subagent child awake when its parent thread is snoozed", () => {
120120 } ) ;
121121} ) ;
122122
123- it . effect . each ( [
124- [ "sql" , ProjectionStore . layer . pipe ( Layer . provideMerge ( SqlitePersistence . layerMemory ) ) ] ,
125- ] as const ) (
126- "%s: a pinned parent's subagent child is born unpinned and settles once idle" ,
127- ( [ , testLayer ] ) =>
123+ it . effect . each ( [ "provider" , "mcp" ] as const ) (
124+ "a %s child does not inherit parent settlement protections and settles once idle" ,
125+ ( creationSource ) =>
128126 Effect . gen ( function * ( ) {
129127 const store = yield * ProjectionStore . ProjectionStoreV2 ;
130- const parentThread = { ...makeParentThread ( ) , pinnedAt : parentCreatedAt , pinOrderKey : "a0" } ;
128+ const parentThread = {
129+ ...makeParentThread ( ) ,
130+ pinnedAt : parentCreatedAt ,
131+ pinOrderKey : "a0" ,
132+ autoSettleDisabledAt : parentCreatedAt ,
133+ } ;
131134 const childThread = makeSubagentChildThread ( {
132135 parentThread,
133136 childThreadId,
@@ -138,13 +141,14 @@ it.effect.each([
138141 title : "Child" ,
139142 now : childCreatedAt ,
140143 createdBy : "agent" ,
141- creationSource : "provider" ,
144+ creationSource,
142145 } ) ;
143146
144147 assert . equal ( parentThread . pinnedAt , parentCreatedAt ) ;
145148 assert . equal ( parentThread . pinOrderKey , "a0" ) ;
146149 assert . isNull ( childThread . pinnedAt ) ;
147150 assert . isNull ( childThread . pinOrderKey ) ;
151+ assert . isNull ( childThread . autoSettleDisabledAt ) ;
148152
149153 for ( const thread of [ parentThread , childThread ] ) {
150154 yield * store . apply ( {
@@ -158,6 +162,7 @@ it.effect.each([
158162 const savedParent = yield * store . getThread ( parentThreadId ) ;
159163 assert . deepEqual ( savedParent . pinnedAt , parentCreatedAt ) ;
160164 assert . equal ( savedParent . pinOrderKey , "a0" ) ;
165+ assert . deepEqual ( savedParent . autoSettleDisabledAt , parentCreatedAt ) ;
161166 const candidates = yield * store . getSettlementCandidates ( ) ;
162167 assert . deepEqual (
163168 candidates . map ( ( candidate ) => candidate . id ) ,
@@ -171,7 +176,9 @@ it.effect.each([
171176 autoSettleOnMerge : false ,
172177 } ) ;
173178 assert . equal ( settledAt && DateTime . formatIso ( settledAt ) , DateTime . formatIso ( childCreatedAt ) ) ;
174- } ) . pipe ( Effect . provide ( testLayer ) ) ,
179+ } ) . pipe (
180+ Effect . provide ( ProjectionStore . layer . pipe ( Layer . provideMerge ( SqlitePersistence . layerMemory ) ) ) ,
181+ ) ,
175182) ;
176183
177184function taskFixture ( ) {
0 commit comments