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

推荐订阅源

U
Unit 42
T
The Blog of Author Tim Ferriss
H
Help Net Security
博客园 - 叶小钗
云风的 BLOG
云风的 BLOG
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
D
DataBreaches.Net
博客园 - 聂微东
A
About on SuperTechFans
大猫的无限游戏
大猫的无限游戏
P
Proofpoint News Feed
Martin Fowler
Martin Fowler
博客园 - 【当耐特】
S
SegmentFault 最新的问题
Blog — PlanetScale
Blog — PlanetScale
酷 壳 – CoolShell
酷 壳 – CoolShell
G
Google Developers Blog
I
InfoQ
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
GbyAI
GbyAI
B
Blog
Engineering at Meta
Engineering at Meta
V
V2EX
Hugging Face - Blog
Hugging Face - 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: tighten bedrock discovery assertions · openclaw/ope...
steipete · 2026-05-11 · via Recent Commits to openclaw:main

@@ -30,6 +30,16 @@ function mockSingleActiveSummary(overrides: Partial<typeof baseActiveAnthropicSu

3030

.mockResolvedValueOnce({ inferenceProfileSummaries: [] });

3131

}

323233+

function expectModelFields(model: unknown, expected: Record<string, unknown>): void {

34+

expect(model).toBeDefined();

35+

expect(typeof model).toBe("object");

36+

expect(model).not.toBeNull();

37+

const actual = model as Record<string, unknown>;

38+

for (const [key, value] of Object.entries(expected)) {

39+

expect(actual[key]).toEqual(value);

40+

}

41+

}

42+3343

describe("bedrock discovery", () => {

3444

beforeEach(() => {

3545

sendMock.mockClear();

@@ -86,7 +96,7 @@ describe("bedrock discovery", () => {

86968797

const models = await discoverBedrockModels({ region: "us-east-1", clientFactory });

8898

expect(models).toHaveLength(1);

89-

expect(models[0]).toMatchObject({

99+

expectModelFields(models[0], {

90100

id: "anthropic.claude-3-7-sonnet-20250219-v1:0",

91101

name: "Claude 3.7 Sonnet",

92102

reasoning: false,

@@ -119,7 +129,7 @@ describe("bedrock discovery", () => {

119129

config: { defaultContextWindow: 64000, defaultMaxTokens: 8192 },

120130

clientFactory,

121131

});

122-

expect(models[0]).toMatchObject({ contextWindow: 64000, maxTokens: 8192 });

132+

expectModelFields(models[0], { contextWindow: 64000, maxTokens: 8192 });

123133

});

124134125135

it("keeps the conservative fallback for unknown inference profiles", async () => {

@@ -147,7 +157,7 @@ describe("bedrock discovery", () => {

147157

const models = await discoverBedrockModels({ region: "ap-northeast-1", clientFactory });

148158149159

expect(models).toHaveLength(1);

150-

expect(models[0]).toMatchObject({

160+

expectModelFields(models[0], {

151161

id: "jp.example.unknown-text-v1:0",

152162

contextWindow: 32000,

153163

maxTokens: 4096,

@@ -179,7 +189,7 @@ describe("bedrock discovery", () => {

179189180190

const models = await discoverBedrockModels({ region: "ap-northeast-1", clientFactory });

181191182-

expect(models[0]).toMatchObject({

192+

expectModelFields(models[0], {

183193

id: "jp.anthropic.claude-sonnet-4-6-v1:0",

184194

contextWindow: 1_000_000,

185195

});

@@ -317,17 +327,17 @@ describe("bedrock discovery", () => {

317327

const globalProfile = models.find((m) => m.id === "global.anthropic.claude-sonnet-4-6");

318328319329

// Foundation model has image input.

320-

expect(foundationModel).toMatchObject({ input: ["text", "image"] });

330+

expectModelFields(foundationModel, { input: ["text", "image"] });

321331322332

// Inference profiles inherit image input from the foundation model.

323-

expect(usProfile).toMatchObject({

333+

expectModelFields(usProfile, {

324334

name: "US Anthropic Claude Sonnet 4.6",

325335

input: ["text", "image"],

326336

contextWindow: 1000000,

327337

maxTokens: 4096,

328338

});

329-

expect(euProfile).toMatchObject({ input: ["text", "image"] });

330-

expect(globalProfile).toMatchObject({ input: ["text", "image"] });

339+

expectModelFields(euProfile, { input: ["text", "image"] });

340+

expectModelFields(globalProfile, { input: ["text", "image"] });

331341332342

// Inactive profile should not be present.

333343

expect(models.find((m) => m.id === "ap.anthropic.claude-sonnet-4-6")).toBeUndefined();

@@ -424,7 +434,7 @@ describe("bedrock discovery", () => {

424434

const models = await discoverBedrockModels({ region: "us-east-1", clientFactory });

425435

const profile = models.find((model) => model.id === "us.my-prod-profile");

426436427-

expect(profile).toMatchObject({

437+

expectModelFields(profile, {

428438

id: "us.my-prod-profile",

429439

input: ["text", "image"],

430440

contextWindow: 1000000,

@@ -456,7 +466,7 @@ describe("bedrock discovery", () => {

456466457467

const models = await discoverBedrockModels({ region: "us-east-1", clientFactory });

458468459-

expect(models[0]).toMatchObject({

469+

expectModelFields(models[0], {

460470

id: "us.my-prod-profile",

461471

contextWindow: 1_000_000,

462472

maxTokens: 4096,

@@ -582,14 +592,14 @@ describe("bedrock discovery", () => {

582592

expect(models).toHaveLength(3);

583593584594

const auProfile = models.find((m) => m.id === "au.anthropic.claude-sonnet-4-6");

585-

expect(auProfile).toMatchObject({

595+

expectModelFields(auProfile, {

586596

id: "au.anthropic.claude-sonnet-4-6",

587597

name: "AU Anthropic Claude Sonnet 4.6",

588598

input: ["text", "image"],

589599

});

590600591601

const apacProfile = models.find((m) => m.id === "apac.anthropic.claude-sonnet-4-6");

592-

expect(apacProfile).toMatchObject({

602+

expectModelFields(apacProfile, {

593603

id: "apac.anthropic.claude-sonnet-4-6",

594604

name: "APAC Anthropic Claude Sonnet 4.6",

595605

input: ["text", "image"],