refactor(test): reuse command test harness

This commit is contained in:
Peter Steinberger
2026-02-15 15:01:00 +00:00
parent d3d82a1c19
commit 8b2a5672be
2 changed files with 7 additions and 38 deletions

View File

@@ -7,6 +7,9 @@ export function buildCommandTestParams(
commandBody: string,
cfg: OpenClawConfig,
ctxOverrides?: Partial<MsgContext>,
options?: {
workspaceDir?: string;
},
) {
const ctx = {
Body: commandBody,
@@ -33,7 +36,7 @@ export function buildCommandTestParams(
directives: parseInlineDirectives(commandBody),
elevated: { enabled: true, allowed: true, failures: [] },
sessionKey: "agent:main:main",
workspaceDir: "/tmp",
workspaceDir: options?.workspaceDir ?? "/tmp",
defaultGroupActivation: () => "mention",
resolvedVerboseLevel: "off" as const,
resolvedReasoningLevel: "off" as const,