mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 03:11:35 +00:00
chore: Fix types in tests 1/N.
This commit is contained in:
@@ -102,6 +102,7 @@ vi.mock("../../gateway/call.js", () => ({
|
||||
callGateway: (opts: unknown) => callGatewayMock(opts),
|
||||
}));
|
||||
|
||||
import type { HandleCommandsParams } from "./commands-types.js";
|
||||
import { buildCommandContext, handleCommands } from "./commands.js";
|
||||
|
||||
// Avoid expensive workspace scans during /context tests.
|
||||
@@ -504,6 +505,7 @@ describe("/compact command", () => {
|
||||
...params,
|
||||
sessionEntry: {
|
||||
sessionId: "session-1",
|
||||
updatedAt: Date.now(),
|
||||
groupId: "group-1",
|
||||
groupChannel: "#general",
|
||||
space: "workspace-1",
|
||||
@@ -651,7 +653,7 @@ function buildPolicyParams(
|
||||
commandBody: string,
|
||||
cfg: OpenClawConfig,
|
||||
ctxOverrides?: Partial<MsgContext>,
|
||||
) {
|
||||
): HandleCommandsParams {
|
||||
const ctx = {
|
||||
Body: commandBody,
|
||||
CommandBody: commandBody,
|
||||
@@ -670,7 +672,7 @@ function buildPolicyParams(
|
||||
commandAuthorized: true,
|
||||
});
|
||||
|
||||
return {
|
||||
const params: HandleCommandsParams = {
|
||||
ctx,
|
||||
cfg,
|
||||
command,
|
||||
@@ -679,14 +681,15 @@ function buildPolicyParams(
|
||||
sessionKey: "agent:main:main",
|
||||
workspaceDir: "/tmp",
|
||||
defaultGroupActivation: () => "mention",
|
||||
resolvedVerboseLevel: "off" as const,
|
||||
resolvedReasoningLevel: "off" as const,
|
||||
resolvedVerboseLevel: "off",
|
||||
resolvedReasoningLevel: "off",
|
||||
resolveDefaultThinkingLevel: async () => undefined,
|
||||
provider: "telegram",
|
||||
model: "test-model",
|
||||
contextTokens: 0,
|
||||
isGroup: false,
|
||||
};
|
||||
return params;
|
||||
}
|
||||
|
||||
describe("handleCommands /allowlist", () => {
|
||||
|
||||
Reference in New Issue
Block a user