fix: stabilize ci checks

This commit is contained in:
Peter Steinberger
2026-01-19 00:34:16 +00:00
parent 2f6b5ffdfe
commit d9384785a3
35 changed files with 197 additions and 268 deletions

View File

@@ -22,8 +22,7 @@ import { getApiKeyForModel } from "./model-auth.js";
import { normalizeProviderId, parseModelRef } from "./model-selection.js";
import { ensureClawdbotModelsJson } from "./models-config.js";
const LIVE =
isTruthyEnvValue(process.env.LIVE) || isTruthyEnvValue(process.env.CLAWDBOT_LIVE_TEST);
const LIVE = isTruthyEnvValue(process.env.LIVE) || isTruthyEnvValue(process.env.CLAWDBOT_LIVE_TEST);
const SETUP_TOKEN_RAW = process.env.CLAWDBOT_LIVE_SETUP_TOKEN?.trim() ?? "";
const SETUP_TOKEN_VALUE = process.env.CLAWDBOT_LIVE_SETUP_TOKEN_VALUE?.trim() ?? "";
const SETUP_TOKEN_PROFILE = process.env.CLAWDBOT_LIVE_SETUP_TOKEN_PROFILE?.trim() ?? "";

View File

@@ -22,11 +22,7 @@ vi.mock("../config/config.js", async (importOriginal) => {
import { createClawdbotTools } from "./clawdbot-tools.js";
const waitForCalls = async (
getCount: () => number,
count: number,
timeoutMs = 2000,
) => {
const waitForCalls = async (getCount: () => number, count: number, timeoutMs = 2000) => {
const start = Date.now();
while (getCount() < count) {
if (Date.now() - start > timeoutMs) {
@@ -254,18 +250,9 @@ describe("sessions tools", () => {
runId: "run-1",
delivery: { status: "pending", mode: "announce" },
});
await waitForCalls(
() => calls.filter((call) => call.method === "agent").length,
4,
);
await waitForCalls(
() => calls.filter((call) => call.method === "agent.wait").length,
4,
);
await waitForCalls(
() => calls.filter((call) => call.method === "chat.history").length,
4,
);
await waitForCalls(() => calls.filter((call) => call.method === "agent").length, 4);
await waitForCalls(() => calls.filter((call) => call.method === "agent.wait").length, 4);
await waitForCalls(() => calls.filter((call) => call.method === "chat.history").length, 4);
const waitPromise = tool.execute("call6", {
sessionKey: "main",
@@ -279,18 +266,9 @@ describe("sessions tools", () => {
delivery: { status: "pending", mode: "announce" },
});
expect(typeof (waited.details as { runId?: string }).runId).toBe("string");
await waitForCalls(
() => calls.filter((call) => call.method === "agent").length,
8,
);
await waitForCalls(
() => calls.filter((call) => call.method === "agent.wait").length,
8,
);
await waitForCalls(
() => calls.filter((call) => call.method === "chat.history").length,
8,
);
await waitForCalls(() => calls.filter((call) => call.method === "agent").length, 8);
await waitForCalls(() => calls.filter((call) => call.method === "agent.wait").length, 8);
await waitForCalls(() => calls.filter((call) => call.method === "chat.history").length, 8);
const agentCalls = calls.filter((call) => call.method === "agent");
const waitCalls = calls.filter((call) => call.method === "agent.wait");

View File

@@ -3,8 +3,7 @@ import { describe, expect, it } from "vitest";
import { isTruthyEnvValue } from "../infra/env.js";
const GEMINI_KEY = process.env.GEMINI_API_KEY ?? "";
const LIVE =
isTruthyEnvValue(process.env.GEMINI_LIVE_TEST) || isTruthyEnvValue(process.env.LIVE);
const LIVE = isTruthyEnvValue(process.env.GEMINI_LIVE_TEST) || isTruthyEnvValue(process.env.LIVE);
const describeLive = LIVE && GEMINI_KEY ? describe : describe.skip;

View File

@@ -5,8 +5,7 @@ import { isTruthyEnvValue } from "../infra/env.js";
const MINIMAX_KEY = process.env.MINIMAX_API_KEY ?? "";
const MINIMAX_BASE_URL = process.env.MINIMAX_BASE_URL?.trim() || "https://api.minimax.io/anthropic";
const MINIMAX_MODEL = process.env.MINIMAX_MODEL?.trim() || "MiniMax-M2.1";
const LIVE =
isTruthyEnvValue(process.env.MINIMAX_LIVE_TEST) || isTruthyEnvValue(process.env.LIVE);
const LIVE = isTruthyEnvValue(process.env.MINIMAX_LIVE_TEST) || isTruthyEnvValue(process.env.LIVE);
const describeLive = LIVE && MINIMAX_KEY ? describe : describe.skip;

View File

@@ -15,8 +15,7 @@ import { getApiKeyForModel } from "./model-auth.js";
import { ensureClawdbotModelsJson } from "./models-config.js";
import { isRateLimitErrorMessage } from "./pi-embedded-helpers/errors.js";
const LIVE =
isTruthyEnvValue(process.env.LIVE) || isTruthyEnvValue(process.env.CLAWDBOT_LIVE_TEST);
const LIVE = isTruthyEnvValue(process.env.LIVE) || isTruthyEnvValue(process.env.CLAWDBOT_LIVE_TEST);
const DIRECT_ENABLED = Boolean(process.env.CLAWDBOT_LIVE_MODELS?.trim());
const REQUIRE_PROFILE_KEYS = isTruthyEnvValue(process.env.CLAWDBOT_LIVE_REQUIRE_PROFILE_KEYS);

View File

@@ -6,8 +6,7 @@ import type { ClawdbotConfig } from "../config/config.js";
import { applyExtraParamsToAgent } from "./pi-embedded-runner.js";
const OPENAI_KEY = process.env.OPENAI_API_KEY ?? "";
const LIVE =
isTruthyEnvValue(process.env.OPENAI_LIVE_TEST) || isTruthyEnvValue(process.env.LIVE);
const LIVE = isTruthyEnvValue(process.env.OPENAI_LIVE_TEST) || isTruthyEnvValue(process.env.LIVE);
const describeLive = LIVE && OPENAI_KEY ? describe : describe.skip;