@@ -24,6 +24,7 @@ import { registerGeneratedMediaTaskActivity } from "../../tasks/generated-media-
2424import { resetGeneratedMediaTaskActivityForTests } from "../../tasks/task-runtime.test-helpers.js" ;
2525import { captureEnv , setTestEnvValue } from "../../test-utils/env.js" ;
2626import { saveAuthProfileStore } from "../auth-profiles/store.js" ;
27+ import { testing as cliBackendsTesting } from "../cli-backends.test-support.js" ;
2728import type { EmbeddedAgentRunResult } from "../embedded-agent.js" ;
2829import { FailoverError } from "../failover-error.js" ;
2930import { attachToolAllowlistIntersection } from "../tool-policy.js" ;
@@ -608,6 +609,24 @@ describe("CLI attempt execution", () => {
608609 providerAuthAliasMocks . resolveProviderAuthAliasMap . mockClear ( ) ;
609610 providerAuthAliasMocks . resolveProviderIdForAuth . mockClear ( ) ;
610611 sessionWriteLockMocks . acquireSessionWriteLock . mockClear ( ) ;
612+ cliBackendsTesting . setDepsForTest ( {
613+ resolvePluginSetupCliBackend : ( ) => undefined ,
614+ resolvePluginSetupRegistry : ( ) => ( { cliBackends : [ ] } ) as never ,
615+ resolveRuntimeCliBackends : ( ) => [
616+ {
617+ id : "claude-cli" ,
618+ modelProvider : "anthropic" ,
619+ pluginId : "anthropic" ,
620+ config : { command : "claude" , forkArg : "--fork-session" } ,
621+ } ,
622+ {
623+ id : "google-gemini-cli" ,
624+ modelProvider : "google" ,
625+ pluginId : "google" ,
626+ config : { command : "gemini" } ,
627+ } ,
628+ ] ,
629+ } ) ;
611630 } ) ;
612631
613632 async function writeSessionStoreSeed ( sessionStore : Record < string , SessionEntry > ) : Promise < void > {
@@ -648,9 +667,10 @@ describe("CLI attempt execution", () => {
648667
649668 afterEach ( async ( ) => {
650669 vi . useRealTimers ( ) ;
670+ cliBackendsTesting . resetDepsForTest ( ) ;
671+ closeOpenClawAgentDatabasesForTest ( ) ;
651672 homeEnvSnapshot ?. restore ( ) ;
652673 homeEnvSnapshot = undefined ;
653- closeOpenClawAgentDatabasesForTest ( ) ;
654674 await fs . rm ( tmpDir , { recursive : true , force : true } ) ;
655675 } ) ;
656676
0 commit comments