Skip to content

Commit 9b73ef9

Browse files
committed
Agents: use runtime config for commitments command (#74189)
1 parent 3004336 commit 9b73ef9

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎src/commands/commitments.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const mocks = vi.hoisted(() => ({
77
listCommitments: vi.fn(),
88
markCommitmentsStatus: vi.fn(),
99
resolveCommitmentStorePath: vi.fn(() => "/tmp/openclaw-commitments.json"),
10-
loadConfig: vi.fn(() => ({
10+
getRuntimeConfig: vi.fn(() => ({
1111
commitments: {
1212
store: "/tmp/openclaw-commitments.json",
1313
},
@@ -21,7 +21,7 @@ vi.mock("../commitments/store.js", () => ({
2121
}));
2222

2323
vi.mock("../config/config.js", () => ({
24-
loadConfig: mocks.loadConfig,
24+
getRuntimeConfig: mocks.getRuntimeConfig,
2525
}));
2626

2727
function createRuntime(): { runtime: RuntimeEnv; logs: string[] } {

‎src/commands/commitments.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
resolveCommitmentStorePath,
55
} from "../commitments/store.js";
66
import type { CommitmentRecord, CommitmentStatus } from "../commitments/types.js";
7-
import { loadConfig } from "../config/config.js";
7+
import { getRuntimeConfig } from "../config/config.js";
88
import { info } from "../globals.js";
99
import type { RuntimeEnv } from "../runtime.js";
1010
import { normalizeOptionalString } from "../shared/string-coerce.js";
@@ -87,7 +87,7 @@ export async function commitmentsListCommand(
8787
opts: { json?: boolean; status?: string; all?: boolean; agent?: string },
8888
runtime: RuntimeEnv,
8989
): Promise<void> {
90-
const cfg = loadConfig();
90+
const cfg = getRuntimeConfig();
9191
const status = opts.all ? undefined : parseStatus(opts.status ?? "pending", runtime);
9292
if (!opts.all && opts.status && !status) {
9393
return;
@@ -144,7 +144,7 @@ export async function commitmentsDismissCommand(
144144
runtime.exit(1);
145145
return;
146146
}
147-
const cfg = loadConfig();
147+
const cfg = getRuntimeConfig();
148148
await markCommitmentsStatus({
149149
cfg,
150150
ids,

0 commit comments

Comments
 (0)