@@ -40,16 +40,15 @@ function makeStoreStub(
4040 * `parent`. Without flushPendingToolResultsToHistory the method hits its
4141 * non-fatal flush-error branch and never reaches the happy delegation path.
4242 */
43- const makeParentTask = ( ) =>
44- ( {
45- taskId : "parent-1" ,
46- apiConfiguration : { apiProvider : providerIdentifiers . anthropic , anthropicApiKey : "task-local-key" } ,
47- getTaskMode : vi . fn ( ) . mockResolvedValue ( "code" ) ,
48- getTaskApiConfigName : vi . fn ( ) . mockResolvedValue ( "task-local-profile" ) ,
49- emit : vi . fn ( ) ,
50- flushPendingToolResultsToHistory : vi . fn ( ) . mockResolvedValue ( true ) ,
51- retrySaveApiConversationHistory : vi . fn ( ) ,
52- } ) as any
43+ const makeParentTask = ( ) => ( {
44+ taskId : "parent-1" ,
45+ apiConfiguration : { apiProvider : providerIdentifiers . anthropic , anthropicApiKey : "task-local-key" } ,
46+ getTaskMode : vi . fn ( ) . mockResolvedValue ( "code" ) ,
47+ getTaskApiConfigName : vi . fn ( ) . mockResolvedValue ( "task-local-profile" ) ,
48+ emit : vi . fn ( ) ,
49+ flushPendingToolResultsToHistory : vi . fn ( ) . mockResolvedValue ( true ) ,
50+ retrySaveApiConversationHistory : vi . fn ( ) ,
51+ } )
5352
5453describe ( "ClineProvider.delegateParentAndOpenChild()" , ( ) => {
5554 it ( "rejects a stale restored action before delegation side effects" , async ( ) => {
@@ -150,7 +149,7 @@ describe("ClineProvider.delegateParentAndOpenChild()", () => {
150149 }
151150 const parentTask = makeParentTask ( )
152151 const child = { taskId : "child-1" , run : vi . fn ( ) . mockResolvedValue ( undefined ) }
153- const getCurrentTask = vi . fn ( ( ) => parentTask )
152+ const getCurrentTask = vi . fn ( ( ) : { taskId : string } => parentTask )
154153 const createTask = vi . fn ( async ( ) => {
155154 getCurrentTask . mockReturnValue ( child )
156155 return child
@@ -218,7 +217,7 @@ describe("ClineProvider.delegateParentAndOpenChild()", () => {
218217 taskHistoryStore,
219218 } as unknown as ClineProvider
220219
221- const child = await ( ClineProvider . prototype as any ) . delegateParentAndOpenChild . call ( provider , {
220+ const child = await ClineProvider . prototype . delegateParentAndOpenChild . call ( provider , {
222221 parentTaskId : "parent-1" ,
223222 message : "Do something" ,
224223 initialTodos : [ ] ,
@@ -416,7 +415,7 @@ describe("ClineProvider.delegateParentAndOpenChild()", () => {
416415 taskHistoryStore,
417416 } as unknown as ClineProvider
418417
419- await ( ClineProvider . prototype as any ) . delegateParentAndOpenChild . call ( provider , {
418+ await ClineProvider . prototype . delegateParentAndOpenChild . call ( provider , {
420419 parentTaskId : "parent-1" ,
421420 message : "Do something" ,
422421 initialTodos : [ ] ,
@@ -450,7 +449,7 @@ describe("ClineProvider.delegateParentAndOpenChild()", () => {
450449 taskHistoryStore,
451450 } as unknown as ClineProvider
452451
453- await ( ClineProvider . prototype as any ) . delegateParentAndOpenChild . call ( provider , {
452+ await ClineProvider . prototype . delegateParentAndOpenChild . call ( provider , {
454453 parentTaskId : "parent-1" ,
455454 message : "Do something" ,
456455 initialTodos : [ ] ,
@@ -491,7 +490,7 @@ describe("ClineProvider.delegateParentAndOpenChild()", () => {
491490 taskHistoryStore,
492491 } as unknown as ClineProvider
493492
494- await ( ClineProvider . prototype as any ) . delegateParentAndOpenChild . call ( provider , {
493+ await ClineProvider . prototype . delegateParentAndOpenChild . call ( provider , {
495494 parentTaskId : "parent-1" ,
496495 message : "Do something" ,
497496 initialTodos : [ ] ,
@@ -538,7 +537,7 @@ describe("ClineProvider.delegateParentAndOpenChild()", () => {
538537 taskHistoryStore,
539538 } as unknown as ClineProvider
540539
541- await ( ClineProvider . prototype as any ) . delegateParentAndOpenChild . call ( provider , {
540+ await ClineProvider . prototype . delegateParentAndOpenChild . call ( provider , {
542541 parentTaskId : "parent-1" ,
543542 message : "Continue" ,
544543 initialTodos : [ ] ,
@@ -603,7 +602,7 @@ describe("ClineProvider.delegateParentAndOpenChild()", () => {
603602 } as unknown as ClineProvider
604603
605604 await expect (
606- ( ClineProvider . prototype as any ) . delegateParentAndOpenChild . call ( provider , {
605+ ClineProvider . prototype . delegateParentAndOpenChild . call ( provider , {
607606 parentTaskId : "parent-1" ,
608607 message : "Continue" ,
609608 initialTodos : [ ] ,
@@ -614,7 +613,7 @@ describe("ClineProvider.delegateParentAndOpenChild()", () => {
614613 // The authoritative preflight rejects before either provider mutates its stack.
615614 expect ( child . run ) . not . toHaveBeenCalled ( )
616615 expect ( createTask ) . not . toHaveBeenCalled ( )
617- expect ( ( provider as any ) . deleteTaskWithId ) . not . toHaveBeenCalled ( )
616+ expect ( provider . deleteTaskWithId ) . not . toHaveBeenCalled ( )
618617 } )
619618
620619 it ( "rejects a delegated parent whose awaited-child identity is missing" , async ( ) => {
@@ -744,7 +743,7 @@ describe("ClineProvider.delegateParentAndOpenChild()", () => {
744743 } as unknown as ClineProvider
745744
746745 await expect (
747- ( ClineProvider . prototype as any ) . delegateParentAndOpenChild . call ( provider , {
746+ ClineProvider . prototype . delegateParentAndOpenChild . call ( provider , {
748747 parentTaskId : "parent-1" ,
749748 message : "Do something" ,
750749 initialTodos : [ ] ,
0 commit comments