mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 03:42:43 +00:00
chore(tsgo/lint): fix CI errors
This commit is contained in:
@@ -2,6 +2,7 @@ import fs from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
import type { ModelProviderConfig } from "../config/types.models.js";
|
||||
import { validateConfigObject } from "../config/validation.js";
|
||||
import { resolveOpenClawAgentDir } from "./agent-paths.js";
|
||||
import {
|
||||
@@ -41,7 +42,7 @@ async function writeAgentModelsJson(content: unknown): Promise<void> {
|
||||
}
|
||||
|
||||
function createMergeConfigProvider() {
|
||||
return {
|
||||
const provider: ModelProviderConfig = {
|
||||
baseUrl: "https://config.example/v1",
|
||||
apiKey: "CONFIG_KEY",
|
||||
api: "openai-responses",
|
||||
@@ -56,7 +57,8 @@ function createMergeConfigProvider() {
|
||||
maxTokens: 2048,
|
||||
},
|
||||
],
|
||||
} as const;
|
||||
};
|
||||
return provider;
|
||||
}
|
||||
|
||||
async function runCustomProviderMergeTest(seedProvider: {
|
||||
|
||||
@@ -11,7 +11,6 @@ function applyThinkingDefault(thinking: ThinkingLevel) {
|
||||
harness.setSessionsSpawnConfigOverride({
|
||||
session: { mainKey: "main", scope: "per-sender" },
|
||||
agents: { defaults: { subagents: { thinking } } },
|
||||
routing: { sessions: { mainKey: MAIN_SESSION_KEY } },
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ function configureDefaultsWithoutTimeout() {
|
||||
setSessionsSpawnConfigOverride({
|
||||
session: { mainKey: "main", scope: "per-sender" },
|
||||
agents: { defaults: { subagents: { maxConcurrent: 8 } } },
|
||||
routing: { sessions: { mainKey: MAIN_SESSION_KEY } },
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@ function applySubagentTimeoutDefault(seconds: number) {
|
||||
sessionsHarness.setSessionsSpawnConfigOverride({
|
||||
session: { mainKey: "main", scope: "per-sender" },
|
||||
agents: { defaults: { subagents: { runTimeoutSeconds: seconds } } },
|
||||
routing: { sessions: { mainKey: MAIN_SESSION_KEY } },
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { vi } from "vitest";
|
||||
import { vi, type Mock } from "vitest";
|
||||
|
||||
type SessionsSpawnTestConfig = ReturnType<(typeof import("../config/config.js"))["loadConfig"]>;
|
||||
type CreateSessionsSpawnTool =
|
||||
@@ -16,10 +16,6 @@ type SessionsSpawnGatewayMockOptions = {
|
||||
agentWaitResult?: { status: "ok" | "timeout"; startedAt: number; endedAt: number };
|
||||
};
|
||||
|
||||
// Avoid exporting vitest mock types (TS2742 under pnpm + d.ts emit).
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
type AnyMock = any;
|
||||
|
||||
const hoisted = vi.hoisted(() => {
|
||||
const callGatewayMock = vi.fn();
|
||||
const defaultConfigOverride = {
|
||||
@@ -32,12 +28,12 @@ const hoisted = vi.hoisted(() => {
|
||||
return { callGatewayMock, defaultConfigOverride, state };
|
||||
});
|
||||
|
||||
export function getCallGatewayMock(): AnyMock {
|
||||
export function getCallGatewayMock(): Mock {
|
||||
return hoisted.callGatewayMock;
|
||||
}
|
||||
|
||||
export function getGatewayRequests(): Array<GatewayRequest> {
|
||||
return getCallGatewayMock().mock.calls.map((call: [unknown]) => call[0] as GatewayRequest);
|
||||
return getCallGatewayMock().mock.calls.map((call: unknown[]) => call[0] as GatewayRequest);
|
||||
}
|
||||
|
||||
export function getGatewayMethods(): Array<string | undefined> {
|
||||
|
||||
Reference in New Issue
Block a user