mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-14 10:41:23 +00:00
Tests: repair latest main type drift
This commit is contained in:
@@ -65,7 +65,7 @@ const runtimeStub = {
|
||||
|
||||
type DownloadGraphMediaParams = Parameters<typeof downloadMSTeamsGraphMedia>[0];
|
||||
type DownloadGraphMediaOverrides = Partial<
|
||||
Omit<DownloadGraphMediaParams, "messageUrl" | "tokenProvider" | "maxBytes">
|
||||
Omit<DownloadGraphMediaParams, "messageUrl" | "tokenProvider">
|
||||
>;
|
||||
type FetchFn = typeof fetch;
|
||||
type LabeledCase = { label: string };
|
||||
|
||||
@@ -10,7 +10,7 @@ const mocks = vi.hoisted(() => ({
|
||||
onAgentEvent: vi.fn(() => noop),
|
||||
loadConfig: vi.fn(() => ({
|
||||
agents: { defaults: { subagents: { archiveAfterMinutes: 0 } } },
|
||||
session: { mainKey: "main", scope: "per-sender" },
|
||||
session: { mainKey: "main", scope: "per-sender" as const },
|
||||
})),
|
||||
loadSessionStore: vi.fn(() => ({})),
|
||||
resolveAgentIdFromSessionKey: vi.fn((sessionKey: string) => {
|
||||
@@ -21,7 +21,9 @@ const mocks = vi.hoisted(() => ({
|
||||
emitSessionLifecycleEvent: vi.fn(),
|
||||
persistSubagentRunsToDisk: vi.fn(),
|
||||
restoreSubagentRunsFromDisk: vi.fn(() => 0),
|
||||
getSubagentRunsSnapshotForRead: vi.fn((runs: Map<string, unknown>) => new Map(runs)),
|
||||
getSubagentRunsSnapshotForRead: vi.fn(
|
||||
(runs: Map<string, import("./subagent-registry.types.js").SubagentRunRecord>) => new Map(runs),
|
||||
),
|
||||
resetAnnounceQueuesForTests: vi.fn(),
|
||||
captureSubagentCompletionReply: vi.fn(async () => "final completion reply"),
|
||||
runSubagentAnnounceFlow: vi.fn(async () => true),
|
||||
@@ -110,7 +112,7 @@ describe("subagent registry seam flow", () => {
|
||||
mocks.onAgentEvent.mockReturnValue(noop);
|
||||
mocks.loadConfig.mockReturnValue({
|
||||
agents: { defaults: { subagents: { archiveAfterMinutes: 0 } } },
|
||||
session: { mainKey: "main", scope: "per-sender" },
|
||||
session: { mainKey: "main", scope: "per-sender" as const },
|
||||
});
|
||||
mocks.resolveAgentIdFromSessionKey.mockImplementation((sessionKey: string) => {
|
||||
return sessionKey.match(/^agent:([^:]+)/)?.[1] ?? "main";
|
||||
|
||||
@@ -369,7 +369,6 @@ describe("sanitizeHostExecEnv", () => {
|
||||
GOPRIVATE: "example.invalid/*",
|
||||
GOENV: "/tmp/evil-goenv",
|
||||
GOPATH: "/tmp/evil-go",
|
||||
CARGO_HOME: "/tmp/evil-cargo",
|
||||
PYTHONUSERBASE: "/tmp/evil-python-userbase",
|
||||
VIRTUAL_ENV: "/tmp/evil-venv",
|
||||
SHELLOPTS: "xtrace",
|
||||
|
||||
Reference in New Issue
Block a user