diff --git a/src/commands/commitments.test.ts b/src/commands/commitments.test.ts index 0c20d7b6d93..f563872a49a 100644 --- a/src/commands/commitments.test.ts +++ b/src/commands/commitments.test.ts @@ -7,7 +7,7 @@ const mocks = vi.hoisted(() => ({ listCommitments: vi.fn(), markCommitmentsStatus: vi.fn(), resolveCommitmentStorePath: vi.fn(() => "/tmp/openclaw-commitments.json"), - loadConfig: vi.fn(() => ({ + getRuntimeConfig: vi.fn(() => ({ commitments: { store: "/tmp/openclaw-commitments.json", }, @@ -21,7 +21,7 @@ vi.mock("../commitments/store.js", () => ({ })); vi.mock("../config/config.js", () => ({ - loadConfig: mocks.loadConfig, + getRuntimeConfig: mocks.getRuntimeConfig, })); function createRuntime(): { runtime: RuntimeEnv; logs: string[] } { diff --git a/src/commands/commitments.ts b/src/commands/commitments.ts index 871ccf4b72f..c3e7b09cef8 100644 --- a/src/commands/commitments.ts +++ b/src/commands/commitments.ts @@ -4,7 +4,7 @@ import { resolveCommitmentStorePath, } from "../commitments/store.js"; import type { CommitmentRecord, CommitmentStatus } from "../commitments/types.js"; -import { loadConfig } from "../config/config.js"; +import { getRuntimeConfig } from "../config/config.js"; import { info } from "../globals.js"; import type { RuntimeEnv } from "../runtime.js"; import { normalizeOptionalString } from "../shared/string-coerce.js"; @@ -87,7 +87,7 @@ export async function commitmentsListCommand( opts: { json?: boolean; status?: string; all?: boolean; agent?: string }, runtime: RuntimeEnv, ): Promise { - const cfg = loadConfig(); + const cfg = getRuntimeConfig(); const status = opts.all ? undefined : parseStatus(opts.status ?? "pending", runtime); if (!opts.all && opts.status && !status) { return; @@ -144,7 +144,7 @@ export async function commitmentsDismissCommand( runtime.exit(1); return; } - const cfg = loadConfig(); + const cfg = getRuntimeConfig(); await markCommitmentsStatus({ cfg, ids,