@@ -5,8 +5,9 @@ import "../cron/isolated-agent.mocks.js";
55import { __testing as agentCommandTesting } from "../agents/agent-command.js" ;
66import { resolveSession } from "../agents/command/session.js" ;
77import * as commandConfigResolutionModule from "../cli/command-config-resolution.js" ;
8- import type { OpenClawConfig } from "../config/config.js" ;
9- import * as configModule from "../config/config.js" ;
8+ import * as configIoModule from "../config/io.js" ;
9+ import * as runtimeSnapshotModule from "../config/runtime-snapshot.js" ;
10+ import type { OpenClawConfig } from "../config/types.openclaw.js" ;
1011import {
1112 mockSharedAgentCommandConfig ,
1213 resetSharedAgentCommandRuntimeState ,
@@ -20,8 +21,11 @@ vi.mock("../agents/command/session-store.js", () => {
2021 } ;
2122} ) ;
2223
23- const configSpy = vi . spyOn ( configModule , "loadConfig" ) ;
24- const readConfigFileSnapshotForWriteSpy = vi . spyOn ( configModule , "readConfigFileSnapshotForWrite" ) ;
24+ const configSpy = vi . spyOn ( configIoModule , "loadConfig" ) ;
25+ const readConfigFileSnapshotForWriteSpy = vi . spyOn (
26+ configIoModule ,
27+ "readConfigFileSnapshotForWrite" ,
28+ ) ;
2529
2630async function withTempHome < T > ( fn : ( home : string ) => Promise < T > ) : Promise < T > {
2731 return withSharedAgentCommandTempHome ( "openclaw-agent-" , fn ) ;
@@ -42,7 +46,10 @@ beforeEach(() => {
4246describe ( "agentCommand runtime config" , ( ) => {
4347 it ( "sets runtime snapshots from source config before embedded agent run" , async ( ) => {
4448 await withTempHome ( async ( home ) => {
45- const setRuntimeConfigSnapshotSpy = vi . spyOn ( configModule , "setRuntimeConfigSnapshot" ) ;
49+ const setRuntimeConfigSnapshotSpy = vi . spyOn (
50+ runtimeSnapshotModule ,
51+ "setRuntimeConfigSnapshot" ,
52+ ) ;
4653
4754 const store = path . join ( home , "sessions.json" ) ;
4855 const loadedConfig = {
@@ -93,7 +100,7 @@ describe("agentCommand runtime config", () => {
93100 readConfigFileSnapshotForWriteSpy . mockResolvedValue ( {
94101 snapshot : { valid : true , resolved : sourceConfig } ,
95102 writeOptions : { } ,
96- } as Awaited < ReturnType < typeof configModule . readConfigFileSnapshotForWrite > > ) ;
103+ } as Awaited < ReturnType < typeof configIoModule . readConfigFileSnapshotForWrite > > ) ;
97104 const resolveConfigWithSecretsSpy = vi
98105 . spyOn ( commandConfigResolutionModule , "resolveCommandConfigWithSecrets" )
99106 . mockResolvedValueOnce ( {
0 commit comments