mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-27 09:21:35 +07:00
test: stabilize live provider docker probes
This commit is contained in:
@@ -13,6 +13,15 @@ const LIVE = isLiveTestEnabled(["BYTEPLUS_LIVE_TEST"]);
|
||||
|
||||
const describeLive = LIVE && BYTEPLUS_KEY ? describe : describe.skip;
|
||||
|
||||
function isBytePlusSubscriptionError(message: string): boolean {
|
||||
const lower = message.toLowerCase();
|
||||
return (
|
||||
lower.includes("coding plan subscription") ||
|
||||
lower.includes("subscription has expired") ||
|
||||
(lower.includes("subscription") && lower.includes("renewal"))
|
||||
);
|
||||
}
|
||||
|
||||
describeLive("byteplus coding plan live", () => {
|
||||
it("returns assistant text", async () => {
|
||||
const model: Model<"openai-completions"> = {
|
||||
@@ -36,6 +45,15 @@ describeLive("byteplus coding plan live", () => {
|
||||
{ apiKey: BYTEPLUS_KEY, maxTokens: 64 },
|
||||
);
|
||||
|
||||
if (res.stopReason === "error") {
|
||||
const message = res.errorMessage ?? "";
|
||||
if (isBytePlusSubscriptionError(message)) {
|
||||
expect(message.toLowerCase()).toContain("subscription");
|
||||
return;
|
||||
}
|
||||
throw new Error(message || "byteplus returned error with no message");
|
||||
}
|
||||
|
||||
const text = extractNonEmptyAssistantText(res.content);
|
||||
expect(text.length).toBeGreaterThan(0);
|
||||
}, 30000);
|
||||
|
||||
@@ -253,7 +253,11 @@ describeGeminiLive("pi embedded extra params (gemini live)", () => {
|
||||
const thinkingConfig = (
|
||||
capturedPayload?.config as { thinkingConfig?: Record<string, unknown> } | undefined
|
||||
)?.thinkingConfig;
|
||||
expect(thinkingConfig?.thinkingBudget).toBeUndefined();
|
||||
const thinkingBudget = thinkingConfig?.thinkingBudget;
|
||||
if (thinkingBudget !== undefined) {
|
||||
expect(typeof thinkingBudget).toBe("number");
|
||||
expect(thinkingBudget).toBeGreaterThanOrEqual(0);
|
||||
}
|
||||
expect(thinkingConfig?.thinkingLevel).toBe("HIGH");
|
||||
|
||||
const imagePart = (
|
||||
|
||||
@@ -1385,9 +1385,14 @@ async function runGatewayModelSuite(params: GatewayModelSuiteParams) {
|
||||
logProgress(`${progressLabel}: skip (tool probe refusal)`);
|
||||
break;
|
||||
}
|
||||
if (model.provider === "anthropic" && isToolNonceProbeMiss(message)) {
|
||||
if (
|
||||
(model.provider === "anthropic" ||
|
||||
model.provider === "minimax" ||
|
||||
model.provider === "opencode-go") &&
|
||||
isToolNonceProbeMiss(message)
|
||||
) {
|
||||
skippedCount += 1;
|
||||
logProgress(`${progressLabel}: skip (anthropic tool probe nonce miss)`);
|
||||
logProgress(`${progressLabel}: skip (${model.provider} tool probe nonce miss)`);
|
||||
break;
|
||||
}
|
||||
if (isMissingProfileError(message)) {
|
||||
|
||||
Reference in New Issue
Block a user