mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 13:00:44 +00:00
refactor(config): migrate plugin config access
This commit is contained in:
@@ -105,7 +105,7 @@ describe("gateway multi-instance e2e", () => {
|
||||
const idempotencyKey = `idem-${randomUUID()}`;
|
||||
const sendRes = await chatClient.request("chat.send", {
|
||||
sessionKey,
|
||||
message: "/context list",
|
||||
message: "/whoami",
|
||||
idempotencyKey,
|
||||
});
|
||||
expect(sendRes.status).toBe("started");
|
||||
|
||||
@@ -75,6 +75,24 @@ export function createPluginRuntimeMock(overrides: DeepPartial<PluginRuntime> =
|
||||
const base: PluginRuntime = {
|
||||
version: "1.0.0-test",
|
||||
config: {
|
||||
current: vi.fn(() => ({})) as unknown as PluginRuntime["config"]["current"],
|
||||
mutateConfigFile: vi.fn(async () => ({
|
||||
path: "/tmp/openclaw.json",
|
||||
previousHash: null,
|
||||
snapshot: {} as never,
|
||||
nextConfig: {},
|
||||
afterWrite: { mode: "auto" },
|
||||
followUp: { mode: "auto", requiresRestart: false },
|
||||
result: undefined,
|
||||
})) as unknown as PluginRuntime["config"]["mutateConfigFile"],
|
||||
replaceConfigFile: vi.fn(async ({ nextConfig }) => ({
|
||||
path: "/tmp/openclaw.json",
|
||||
previousHash: null,
|
||||
snapshot: {} as never,
|
||||
nextConfig,
|
||||
afterWrite: { mode: "auto" },
|
||||
followUp: { mode: "auto", requiresRestart: false },
|
||||
})) as unknown as PluginRuntime["config"]["replaceConfigFile"],
|
||||
loadConfig: vi.fn(() => ({})) as unknown as PluginRuntime["config"]["loadConfig"],
|
||||
writeConfigFile: vi.fn() as unknown as PluginRuntime["config"]["writeConfigFile"],
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user