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

推荐订阅源

罗磊的独立博客
Google DeepMind News
Google DeepMind News
MyScale Blog
MyScale Blog
A
About on SuperTechFans
Martin Fowler
Martin Fowler
M
MIT News - Artificial intelligence
Recent Announcements
Recent Announcements
D
DataBreaches.Net
B
Blog
博客园 - 【当耐特】
爱范儿
爱范儿
有赞技术团队
有赞技术团队
P
Proofpoint News Feed
WordPress大学
WordPress大学
小众软件
小众软件
Apple Machine Learning Research
Apple Machine Learning Research
I
InfoQ
Engineering at Meta
Engineering at Meta
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Last Week in AI
Last Week in AI
Microsoft Azure Blog
Microsoft Azure Blog
雷峰网
雷峰网
量子位
G
Google Developers 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
fix(hooks): isolate slug-generator auth failures · opencl...
openperf · 2026-05-31 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -1,4 +1,5 @@

11

import { expect, vi } from "vitest";

2+

import type { ProviderRuntimeModel } from "../plugins/provider-runtime-model.types.js";

23

import type { AgentMessage } from "./runtime/index.js";

34

import type { SessionManager } from "./sessions/index.js";

45

import type { TranscriptPolicy } from "./transcript-policy.js";

@@ -12,6 +13,7 @@ export type SanitizeSessionHistoryFn = (params: {

1213

sessionManager: SessionManager;

1314

sessionId: string;

1415

modelId?: string;

16+

model?: ProviderRuntimeModel;

1517

policy?: TranscriptPolicy;

1618

preserveLatestAssistantThinking?: boolean;

1719

}) => Promise<AgentMessage[]>;

Original file line numberDiff line numberDiff line change

@@ -3524,7 +3524,7 @@ function shouldPreserveOpenRouterReasoningReplay(model: OpenAIModeModel): boolea

35243524

}

35253525
35263526

function shouldTrustReasoningContentReplayMetadata(model: OpenAIModeModel): boolean {

3527-

if (model.reasoning !== true || isGemma4ModelId(model.id)) {

3527+

if (!model.reasoning || isGemma4ModelId(model.id)) {

35283528

return false;

35293529

}

35303530

const provider = model.provider.trim().toLowerCase();

Original file line numberDiff line numberDiff line change

@@ -54,6 +54,16 @@ describe("generateSlugViaLLM", () => {

5454

expect(options.cleanupBundleMcpOnRunEnd).toBe(true);

5555

});

5656
57+

it("marks the run lane-local so internal-helper failures do not poison shared profile health (#71709)", async () => {

58+

await generateSlugViaLLM({

59+

sessionContent: "hello",

60+

cfg: {} as OpenClawConfig,

61+

});

62+
63+

expect(runEmbeddedAgentMock).toHaveBeenCalledOnce();

64+

expect(requireFirstRunOptions().authProfileFailurePolicy).toBe("local");

65+

});

66+
5767

it("honors configured agent timeoutSeconds for slow local providers", async () => {

5868

await generateSlugViaLLM({

5969

sessionContent: "hello",

Original file line numberDiff line numberDiff line change

@@ -73,6 +73,9 @@ Reply with ONLY the slug, nothing else. Examples: "vendor-pitch", "api-design",

7373

timeoutMs,

7474

runId: `slug-gen-${Date.now()}`,

7575

cleanupBundleMcpOnRunEnd: true,

76+

// Internal helper run: route failures lane-local so an upstream 400/billing

77+

// here cannot poison the shared profile (#71709).

78+

authProfileFailurePolicy: "local",

7679

});

7780
7881

// Extract text from payloads

Original file line numberDiff line numberDiff line change

@@ -19,17 +19,43 @@ function isRecord(value: unknown): value is Record<string, unknown> {

1919

return Boolean(value) && typeof value === "object" && !Array.isArray(value);

2020

}

2121
22+

function parseDeviceAuthEntry(role: string, value: unknown): DeviceAuthEntry | null {

23+

if (

24+

!isRecord(value) ||

25+

typeof value.token !== "string" ||

26+

!Array.isArray(value.scopes) ||

27+

!value.scopes.every((scope) => typeof scope === "string") ||

28+

typeof value.updatedAtMs !== "number" ||

29+

!Number.isFinite(value.updatedAtMs)

30+

) {

31+

return null;

32+

}

33+

return {

34+

token: value.token,

35+

role,

36+

scopes: value.scopes,

37+

updatedAtMs: value.updatedAtMs,

38+

};

39+

}

40+
2241

function parseDeviceAuthStore(value: unknown): DeviceAuthStore | null {

2342

if (!isRecord(value) || value.version !== 1 || typeof value.deviceId !== "string") {

2443

return null;

2544

}

2645

if (!isRecord(value.tokens)) {

2746

return null;

2847

}

48+

const tokens: Record<string, DeviceAuthEntry> = {};

49+

for (const [role, rawEntry] of Object.entries(value.tokens)) {

50+

const entry = parseDeviceAuthEntry(role, rawEntry);

51+

if (entry) {

52+

tokens[role] = entry;

53+

}

54+

}

2955

return {

3056

version: 1,

3157

deviceId: value.deviceId,

32-

tokens: value.tokens,

58+

tokens,

3359

};

3460

}

3561
Original file line numberDiff line numberDiff line change

@@ -168,6 +168,7 @@ describe("applyMediaUnderstanding – echo transcript", () => {

168168

`No API key resolved for provider "${provider}" (auth mode: ${auth?.mode}).`,

169169

);

170170

},

171+

isProviderAuthError: vi.fn(() => false),

171172

resolveAwsSdkEnvVarName: vi.fn(() => undefined),

172173

resolveEnvApiKey: vi.fn(() => null),

173174

resolveModelAuthMode: vi.fn(() => "api-key"),

Original file line numberDiff line numberDiff line change

@@ -279,6 +279,7 @@ describe("applyMediaUnderstanding", () => {

279279

`No API key resolved for provider "${provider}" (auth mode: ${auth?.mode}).`,

280280

);

281281

},

282+

isProviderAuthError: vi.fn(() => false),

282283

}));

283284

vi.doMock("../media/fetch.js", () => ({

284285

readRemoteMediaBuffer: readRemoteMediaBufferMock,

@@ -365,7 +366,6 @@ describe("applyMediaUnderstanding", () => {

365366

cfg: createGroqAudioConfig(),

366367

providers: createGroqProviders(),

367368

});

368-
369369

expect(result.appliedAudio).toBe(true);

370370

expectTranscriptApplied({

371371

ctx,

Original file line numberDiff line numberDiff line change

@@ -1,6 +1,17 @@

11

import { vi } from "vitest";

22
33

export function createAvailableModelAuthMockModule() {

4+

class ProviderAuthError extends Error {

5+

constructor(

6+

readonly code: "missing-api-key" | "missing-provider-auth",

7+

readonly provider: string,

8+

message: string,

9+

) {

10+

super(message);

11+

this.name = "ProviderAuthError";

12+

}

13+

}

14+
415

return {

516

hasAvailableAuthForProvider: vi.fn(() => true),

617

resolveApiKeyForProvider: vi.fn(async () => ({

@@ -9,6 +20,11 @@ export function createAvailableModelAuthMockModule() {

920

mode: "api-key",

1021

})),

1122

requireApiKey: vi.fn((auth: { apiKey?: string }) => auth.apiKey ?? "test-key"),

23+

ProviderAuthError,

24+

isProviderAuthError: vi.fn(

25+

(err: unknown, code?: "missing-api-key" | "missing-provider-auth") =>

26+

err instanceof ProviderAuthError && (!code || err.code === code),

27+

),

1228

};

1329

}

1430