refactor(live-tests): stabilize docker live suites

This commit is contained in:
Peter Steinberger
2026-01-14 09:52:39 +00:00
parent e3ff8c4d28
commit 40fb59e5f7
2 changed files with 17 additions and 9 deletions

View File

@@ -15,6 +15,7 @@ import {
import { isModernModelRef } from "./live-model-filter.js";
import { getApiKeyForModel } from "./model-auth.js";
import { ensureClawdbotModelsJson } from "./models-config.js";
import { isRateLimitErrorMessage } from "./pi-embedded-helpers/errors.js";
const LIVE = process.env.LIVE === "1" || process.env.CLAWDBOT_LIVE_TEST === "1";
const DIRECT_ENABLED = Boolean(process.env.CLAWDBOT_LIVE_MODELS?.trim());
@@ -440,6 +441,15 @@ describeLive("live models (profile keys)", () => {
logProgress(`${progressLabel}: skip (minimax empty response)`);
break;
}
if (
allowNotFoundSkip &&
model.provider === "opencode" &&
isRateLimitErrorMessage(message)
) {
skipped.push({ model: id, reason: message });
logProgress(`${progressLabel}: skip (rate limit)`);
break;
}
logProgress(`${progressLabel}: failed`);
failures.push({ model: id, error: message });
break;

View File

@@ -11,6 +11,7 @@ import {
} from "@mariozechner/pi-coding-agent";
import { describe, it } from "vitest";
import { resolveClawdbotAgentDir } from "../agents/agent-paths.js";
import { resolveAgentWorkspaceDir } from "../agents/agent-scope.js";
import {
type AuthProfileStore,
ensureAuthProfileStore,
@@ -30,7 +31,6 @@ import {
GATEWAY_CLIENT_MODES,
GATEWAY_CLIENT_NAMES,
} from "../utils/message-channel.js";
import { resolveUserPath } from "../utils.js";
import { GatewayClient } from "./client.js";
import { renderCatNoncePngBase64 } from "./live-image-probe.js";
import { startGatewayServer } from "./server.js";
@@ -377,6 +377,7 @@ async function runGatewayModelSuite(params: GatewayModelSuiteParams) {
const token = `test-${randomUUID()}`;
process.env.CLAWDBOT_GATEWAY_TOKEN = token;
const agentId = "dev";
const hostAgentDir = resolveClawdbotAgentDir();
const hostStore = ensureAuthProfileStore(hostAgentDir, {
@@ -400,9 +401,7 @@ async function runGatewayModelSuite(params: GatewayModelSuiteParams) {
process.env.CLAWDBOT_AGENT_DIR = tempAgentDir;
process.env.PI_CODING_AGENT_DIR = tempAgentDir;
const workspaceDir = resolveUserPath(
params.cfg.agents?.defaults?.workspace ?? path.join(os.homedir(), "clawd"),
);
const workspaceDir = resolveAgentWorkspaceDir(params.cfg, agentId);
await fs.mkdir(workspaceDir, { recursive: true });
const nonceA = randomUUID();
const nonceB = randomUUID();
@@ -452,7 +451,7 @@ async function runGatewayModelSuite(params: GatewayModelSuiteParams) {
`[${params.label}] anthropic keys loaded: ${anthropicKeys.length}`,
);
}
const sessionKey = `agent:dev:${params.label}`;
const sessionKey = `agent:${agentId}:${params.label}`;
const failures: Array<{ model: string; error: string }> = [];
let skippedCount = 0;
const total = params.candidates.length;
@@ -996,9 +995,8 @@ describeLive("gateway live (dev agent, profile keys)", () => {
return;
}
const workspaceDir = resolveUserPath(
cfg.agents?.defaults?.workspace ?? path.join(os.homedir(), "clawd"),
);
const agentId = "dev";
const workspaceDir = resolveAgentWorkspaceDir(cfg, agentId);
await fs.mkdir(workspaceDir, { recursive: true });
const nonceA = randomUUID();
const nonceB = randomUUID();
@@ -1021,7 +1019,7 @@ describeLive("gateway live (dev agent, profile keys)", () => {
});
try {
const sessionKey = "agent:dev:live-zai-fallback";
const sessionKey = `agent:${agentId}:live-zai-fallback`;
await client.request<Record<string, unknown>>("sessions.patch", {
key: sessionKey,