@@ -13,12 +13,14 @@ import {
1313} from "../../test/helpers/openclaw-test-instance.js" ;
1414import { isProcessAlive , waitForPidFile } from "../../test/helpers/process-wait.js" ;
1515import { createDeferred } from "../../test/helpers/promise.js" ;
16- import { loadPersistedAuthProfileStore } from "../agents/auth-profiles/persisted.js" ;
16+ import { reloadSharedAuthStoreOwnership } from "../agents/auth-profiles/path-resolve.js" ;
17+ import { loadAuthProfileStoreForRuntime } from "../agents/auth-profiles/store.js" ;
1718import { resolveAgentModelPrimaryValue } from "../config/model-input.js" ;
1819import type { ModelProviderConfig } from "../config/types.models.js" ;
1920import type { OpenClawConfig } from "../config/types.openclaw.js" ;
2021import { connectGatewayClient } from "../gateway/test-helpers.e2e.js" ;
2122import { runExec } from "../process/exec.js" ;
23+ import { withEnv } from "../test-utils/env.js" ;
2224import { killPidIfAlive } from "../test-utils/process-tree.js" ;
2325import { sleep } from "../utils/sleep.js" ;
2426import { GatewayChatClient } from "./gateway-chat.js" ;
@@ -1587,7 +1589,13 @@ export default {
15871589 const agentDir = path . join ( fixture . stateDir , "agents" , "main" , "agent" ) ;
15881590 const sqlitePath = path . join ( agentDir , "openclaw-agent.sqlite" ) ;
15891591 expect ( await stat ( sqlitePath ) . then ( ( entry ) => entry . isFile ( ) ) ) . toBe ( true ) ;
1590- const store = loadPersistedAuthProfileStore ( agentDir ) ;
1592+ const store = withEnv ( { OPENCLAW_STATE_DIR : fixture . stateDir } , ( ) => {
1593+ reloadSharedAuthStoreOwnership ( ) ;
1594+ return loadAuthProfileStoreForRuntime ( agentDir , {
1595+ readOnly : true ,
1596+ syncExternalCli : false ,
1597+ } ) ;
1598+ } ) ;
15911599 const profile = store ?. profiles [ profileId ] ;
15921600 expect ( profile ?. type === "api_key" ) . toBe ( true ) ;
15931601 expect ( profile ?. provider === providerId ) . toBe ( true ) ;
0 commit comments