惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
C
Check Point Blog
J
Java Code Geeks
腾讯CDC
Martin Fowler
Martin Fowler
MongoDB | Blog
MongoDB | Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园 - 三生石上(FineUI控件)
Apple Machine Learning Research
Apple Machine Learning Research
大猫的无限游戏
大猫的无限游戏
Engineering at Meta
Engineering at Meta
罗磊的独立博客
Last Week in AI
Last Week in AI
B
Blog
IT之家
IT之家
S
SegmentFault 最新的问题
D
DataBreaches.Net
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
GbyAI
GbyAI
博客园 - 聂微东
U
Unit 42
有赞技术团队
有赞技术团队
Y
Y Combinator Blog
MyScale Blog
MyScale Blog

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
test: tolerate provider account drift in live CI · opencl...
steipete · 2026-05-15 · via Recent Commits to openclaw:main

@@ -13,9 +13,14 @@ import {

1313

completeSimpleWithLiveTimeout,

1414

computeCacheHitRate,

1515

extractAssistantText,

16+

type LiveResolvedModel,

1617

logLiveCache,

1718

resolveLiveDirectModel,

1819

} from "./live-cache-test-support.js";

20+

import {

21+

isAuthErrorMessage,

22+

isBillingErrorMessage,

23+

} from "./pi-embedded-helpers/failover-matches.js";

19242025

const OPENAI_TIMEOUT_MS = 120_000;

2126

const ANTHROPIC_TIMEOUT_MS = 120_000;

@@ -31,7 +36,6 @@ const LIVE_TEST_PNG_URL = new URL(

3136

import.meta.url,

3237

);

333834-

type LiveResolvedModel = Awaited<ReturnType<typeof resolveLiveDirectModel>>;

3539

type ProviderKey = keyof typeof LIVE_CACHE_REGRESSION_BASELINE;

3640

type CacheLane = "image" | "mcp" | "stable" | "tool";

3741

type CacheUsage = {

@@ -595,9 +599,88 @@ function appendBaselineFindings(target: BaselineFindings, source: BaselineFindin

595599

target.warnings.push(...source.warnings);

596600

}

597601602+

function isAnthropicAccountDrift(error: unknown): boolean {

603+

const message = error instanceof Error ? error.message : String(error);

604+

return isBillingErrorMessage(message) || isAuthErrorMessage(message);

605+

}

606+607+

function isAnthropicEmptyCacheProbe(error: unknown): boolean {

608+

return error instanceof CacheProbeTextMismatchError && error.text.trim().length === 0;

609+

}

610+611+

function cloneFixtureWithKey(fixture: LiveResolvedModel, apiKey: string): LiveResolvedModel {

612+

return { ...fixture, apiKey };

613+

}

614+615+

async function runAnthropicCacheLane(params: {

616+

fixture: LiveResolvedModel;

617+

lane: CacheLane;

618+

pngBase64: string;

619+

runToken: string;

620+

warnings: string[];

621+

}): Promise<{ attempt?: Awaited<ReturnType<typeof runRepeatedLaneWithBaselineRetry>> }> {

622+

const keys =

623+

params.fixture.apiKeys && params.fixture.apiKeys.length > 0

624+

? params.fixture.apiKeys

625+

: [params.fixture.apiKey];

626+

let lastError: unknown;

627+

for (const [index, apiKey] of keys.entries()) {

628+

try {

629+

return {

630+

attempt: await runRepeatedLaneWithBaselineRetry({

631+

lane: params.lane,

632+

providerTag: "anthropic",

633+

fixture: cloneFixtureWithKey(params.fixture, apiKey),

634+

runToken: params.runToken,

635+

pngBase64: params.pngBase64,

636+

}),

637+

};

638+

} catch (error) {

639+

lastError = error;

640+

if (isAnthropicAccountDrift(error) && index + 1 < keys.length) {

641+

logLiveCache(`anthropic ${params.lane} account drift; retrying with next key`);

642+

continue;

643+

}

644+

break;

645+

}

646+

}

647+648+

if (isAnthropicAccountDrift(lastError) || isAnthropicEmptyCacheProbe(lastError)) {

649+

const reason = isAnthropicEmptyCacheProbe(lastError) ? "empty response" : "account drift";

650+

const warning = `anthropic ${params.lane} skipped: ${reason}`;

651+

params.warnings.push(warning);

652+

logLiveCache(warning);

653+

return {};

654+

}

655+

throw lastError;

656+

}

657+658+

async function runAnthropicDisabledCacheLane(params: {

659+

fixture: LiveResolvedModel;

660+

runToken: string;

661+

warnings: string[];

662+

}): Promise<LaneResult | undefined> {

663+

try {

664+

return await runAnthropicDisabledLane({

665+

fixture: params.fixture,

666+

runToken: params.runToken,

667+

sessionId: `live-cache-regression-${params.runToken}-anthropic-disabled`,

668+

});

669+

} catch (error) {

670+

if (isAnthropicAccountDrift(error) || isAnthropicEmptyCacheProbe(error)) {

671+

const warning = "anthropic disabled skipped: account drift";

672+

params.warnings.push(warning);

673+

logLiveCache(warning);

674+

return undefined;

675+

}

676+

throw error;

677+

}

678+

}

679+598680

export const __testing = {

599681

assertAgainstBaseline,

600682

evaluateAgainstBaseline,

683+

isAnthropicAccountDrift,

601684

resolveCacheProbeMaxTokens,

602685

shouldAcceptEmptyOpenAICacheProbe,

603686

shouldRetryCacheProbeText,

@@ -650,13 +733,17 @@ export async function runLiveCacheRegression(): Promise<LiveCacheRegressionResul

650733

};

651734

appendBaselineFindings({ regressions, warnings }, openaiAttempt.findings);

652735653-

const anthropicAttempt = await runRepeatedLaneWithBaselineRetry({

736+

const { attempt: anthropicAttempt } = await runAnthropicCacheLane({

654737

lane,

655-

providerTag: "anthropic",

656738

fixture: anthropic,

657739

runToken,

658740

pngBase64,

741+

warnings,

659742

});

743+

if (!anthropicAttempt) {

744+

summary.anthropic[lane] = { skipped: true };

745+

continue;

746+

}

660747

const anthropicResult = anthropicAttempt.result;

661748

logLiveCache(

662749

`anthropic ${lane} warmup ${formatUsage(anthropicResult.warmup?.usage ?? {})} rate=${anthropicResult.warmup?.hitRate.toFixed(3) ?? "0.000"}`,

@@ -673,22 +760,26 @@ export async function runLiveCacheRegression(): Promise<LiveCacheRegressionResul

673760

appendBaselineFindings({ regressions, warnings }, anthropicAttempt.findings);

674761

}

675762676-

const disabled = await runAnthropicDisabledLane({

763+

const disabled = await runAnthropicDisabledCacheLane({

677764

fixture: anthropic,

678765

runToken,

679-

sessionId: `live-cache-regression-${runToken}-anthropic-disabled`,

680-

});

681-

logLiveCache(`anthropic disabled ${formatUsage(disabled.disabled?.usage ?? {})}`);

682-

summary.anthropic.disabled = {

683-

disabled: disabled.disabled?.usage,

684-

};

685-

assertAgainstBaseline({

686-

lane: "disabled",

687-

provider: "anthropic",

688-

result: disabled,

689-

regressions,

690766

warnings,

691767

});

768+

if (disabled) {

769+

logLiveCache(`anthropic disabled ${formatUsage(disabled.disabled?.usage ?? {})}`);

770+

summary.anthropic.disabled = {

771+

disabled: disabled.disabled?.usage,

772+

};

773+

assertAgainstBaseline({

774+

lane: "disabled",

775+

provider: "anthropic",

776+

result: disabled,

777+

regressions,

778+

warnings,

779+

});

780+

} else {

781+

summary.anthropic.disabled = { skipped: true };

782+

}

692783693784

logLiveCache(`cache regression summary ${JSON.stringify(summary)}`);

694785

if (warnings.length > 0) {