mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 05:40:44 +00:00
Agents: use runtime config for commitments command (#74189)
This commit is contained in:
committed by
Vignesh
parent
95bf450dc9
commit
f569ed0803
@@ -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[] } {
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user