Agents: use runtime config for commitments command (#74189)

This commit is contained in:
Vignesh Natarajan
2026-04-29 01:27:40 -07:00
committed by Vignesh
parent 95bf450dc9
commit f569ed0803
2 changed files with 5 additions and 5 deletions

View File

@@ -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[] } {

View File

@@ -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<void> {
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,