mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-29 01:52:04 +00:00
test: refresh agent harness and latest-main type fixes
This commit is contained in:
@@ -770,9 +770,12 @@ describe("discord component interactions", () => {
|
||||
const acknowledge = vi.fn().mockResolvedValue(undefined);
|
||||
const reply = vi.fn().mockResolvedValue(undefined);
|
||||
const update = vi.fn().mockResolvedValue(undefined);
|
||||
const baseInteraction = createComponentButtonInteraction().interaction;
|
||||
const baseInteraction = createComponentButtonInteraction().interaction as unknown as Record<
|
||||
string,
|
||||
unknown
|
||||
>;
|
||||
const interaction = {
|
||||
...(baseInteraction as object),
|
||||
...baseInteraction,
|
||||
acknowledge,
|
||||
reply,
|
||||
update,
|
||||
@@ -822,9 +825,12 @@ describe("discord component interactions", () => {
|
||||
const button = createDiscordComponentButton(createComponentContext());
|
||||
const acknowledge = vi.fn().mockResolvedValue(undefined);
|
||||
const followUp = vi.fn().mockResolvedValue(undefined);
|
||||
const baseInteraction = createComponentButtonInteraction().interaction;
|
||||
const baseInteraction = createComponentButtonInteraction().interaction as unknown as Record<
|
||||
string,
|
||||
unknown
|
||||
>;
|
||||
const interaction = {
|
||||
...(baseInteraction as object),
|
||||
...baseInteraction,
|
||||
acknowledge,
|
||||
followUp,
|
||||
} as unknown as ButtonInteraction;
|
||||
|
||||
@@ -155,6 +155,8 @@ vi.mock("@mariozechner/pi-coding-agent", () => {
|
||||
AuthStorage,
|
||||
createAgentSession: (...args: unknown[]) => hoisted.createAgentSessionMock(...args),
|
||||
DefaultResourceLoader,
|
||||
estimateTokens: () => 0,
|
||||
generateSummary: async () => "",
|
||||
ModelRegistry,
|
||||
SessionManager: {
|
||||
open: (...args: unknown[]) => hoisted.sessionManagerOpenMock(...args),
|
||||
@@ -264,6 +266,8 @@ vi.mock("../../session-write-lock.js", () => ({
|
||||
}));
|
||||
|
||||
vi.mock("../tool-result-context-guard.js", () => ({
|
||||
formatContextLimitTruncationNotice: (truncatedChars: number) =>
|
||||
`[... ${Math.max(1, Math.floor(truncatedChars))} more characters truncated]`,
|
||||
installToolResultContextGuard: (...args: unknown[]) =>
|
||||
(hoisted.installToolResultContextGuardMock as (...args: unknown[]) => unknown)(...args),
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user