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

推荐订阅源

G
Google Developers Blog
阮一峰的网络日志
阮一峰的网络日志
A
About on SuperTechFans
大猫的无限游戏
大猫的无限游戏
Engineering at Meta
Engineering at Meta
V
Visual Studio Blog
Martin Fowler
Martin Fowler
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 叶小钗
I
InfoQ
B
Blog RSS Feed
aimingoo的专栏
aimingoo的专栏
Y
Y Combinator Blog
Blog — PlanetScale
Blog — PlanetScale
IT之家
IT之家
P
Proofpoint News Feed
WordPress大学
WordPress大学
小众软件
小众软件
B
Blog
MongoDB | Blog
MongoDB | Blog
人人都是产品经理
人人都是产品经理
量子位
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
build: update Pi model dependencies · openclaw/openclaw@f...
steipete · 2026-04-24 · via Recent Commits to openclaw:main

@@ -5,7 +5,9 @@ import type { OpenClawConfig } from "../../src/config/config.js";

55

import { buildPluginApi } from "../../src/plugins/api-builder.js";

66

import type { PluginRuntime } from "../../src/plugins/runtime/types.js";

77

import { registerSingleProviderPlugin } from "../../test/helpers/plugins/plugin-registration.js";

8+

import { resetBedrockDiscoveryCacheForTest } from "./discovery.js";

89

import amazonBedrockPlugin from "./index.js";

10+

import { resetBedrockAppProfileCacheEligibilityForTest } from "./register.sync.runtime.js";

9111012

type BedrockClientResult =

1113

| {

@@ -15,14 +17,44 @@ type BedrockClientResult =

1517

}

1618

| Error;

171918-

const inferenceProfileResults: BedrockClientResult[] = [];

20+

const foundationModelResults: BedrockClientResult[] = [];

21+

const inferenceProfileListResults: BedrockClientResult[] = [];

22+

const inferenceProfileGetResults: BedrockClientResult[] = [];

1923

const bedrockClientConfigs: Array<Record<string, unknown>> = [];

20-

const sendGetInferenceProfile = vi.fn(async () => {

21-

const next = inferenceProfileResults.shift();

24+

const sendBedrockCommand = vi.fn(async (command: unknown) => {

25+

const commandName = command?.constructor?.name;

26+

const queue =

27+

commandName === "ListFoundationModelsCommand"

28+

? foundationModelResults

29+

: commandName === "ListInferenceProfilesCommand"

30+

? inferenceProfileListResults

31+

: inferenceProfileGetResults;

32+

const next = queue.shift();

2233

if (next instanceof Error) {

2334

throw next;

2435

}

25-

return next ?? { models: [] };

36+

if (next) {

37+

return next;

38+

}

39+

if (commandName === "ListFoundationModelsCommand") {

40+

return {

41+

modelSummaries: [

42+

{

43+

modelId: NON_ANTHROPIC_MODEL,

44+

modelName: "Nova Micro",

45+

providerName: "Amazon",

46+

inputModalities: ["TEXT"],

47+

outputModalities: ["TEXT"],

48+

responseStreamingSupported: true,

49+

modelLifecycle: { status: "ACTIVE" },

50+

},

51+

],

52+

};

53+

}

54+

if (commandName === "ListInferenceProfilesCommand") {

55+

return { inferenceProfileSummaries: [] };

56+

}

57+

return { models: [] };

2658

});

27592860

vi.mock("@aws-sdk/client-bedrock", () => {

@@ -43,7 +75,7 @@ vi.mock("@aws-sdk/client-bedrock", () => {

4375

bedrockClientConfigs.push(config);

4476

}

457746-

send = sendGetInferenceProfile;

78+

send = sendBedrockCommand;

4779

}

48804981

return {

@@ -156,17 +188,6 @@ function callWrappedStream(

156188

return result;

157189

}

158190159-

async function runCatalog(

160-

provider: RegisteredProviderPlugin,

161-

config: OpenClawConfig,

162-

env: NodeJS.ProcessEnv = {} as NodeJS.ProcessEnv,

163-

) {

164-

return provider.catalog?.run({

165-

config,

166-

env,

167-

} as never);

168-

}

169-170191

function runtimePluginConfig(config?: Record<string, unknown>): OpenClawConfig {

171192

return {

172193

plugins: {

@@ -183,9 +204,13 @@ function runtimePluginConfig(config?: Record<string, unknown>): OpenClawConfig {

183204184205

describe("amazon-bedrock provider plugin", () => {

185206

beforeEach(() => {

186-

inferenceProfileResults.length = 0;

207+

foundationModelResults.length = 0;

208+

inferenceProfileListResults.length = 0;

209+

inferenceProfileGetResults.length = 0;

187210

bedrockClientConfigs.length = 0;

188-

sendGetInferenceProfile.mockClear();

211+

sendBedrockCommand.mockClear();

212+

resetBedrockDiscoveryCacheForTest();

213+

resetBedrockAppProfileCacheEligibilityForTest();

189214

});

190215191216

it("marks Claude 4.6 Bedrock models as adaptive by default", async () => {

@@ -439,51 +464,6 @@ describe("amazon-bedrock provider plugin", () => {

439464

});

440465

});

441466442-

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

443-

it("uses live plugin config to re-enable discovery after startup disable", async () => {

444-

inferenceProfileResults.push(

445-

{

446-

modelSummaries: [

447-

{

448-

modelId: NON_ANTHROPIC_MODEL,

449-

modelName: "Nova Micro",

450-

providerName: "Amazon",

451-

inputModalities: ["TEXT"],

452-

outputModalities: ["TEXT"],

453-

responseStreamingSupported: true,

454-

modelLifecycle: { status: "ACTIVE" },

455-

},

456-

],

457-

},

458-

{

459-

inferenceProfileSummaries: [],

460-

},

461-

);

462-

const provider = await registerWithConfig({

463-

discovery: {

464-

enabled: false,

465-

},

466-

});

467-468-

const catalog = await runCatalog(

469-

provider,

470-

runtimePluginConfig({

471-

discovery: {

472-

enabled: true,

473-

region: "us-east-1",

474-

},

475-

}),

476-

);

477-478-

expect(catalog).toMatchObject({

479-

provider: {

480-

baseUrl: "https://bedrock-runtime.us-east-1.amazonaws.com",

481-

api: "bedrock-converse-stream",

482-

},

483-

});

484-

});

485-

});

486-487467

describe("application inference profile cache point injection", () => {

488468

/**

489469

* Invoke wrapStreamFn with a payload containing system/messages, then

@@ -721,7 +701,7 @@ describe("amazon-bedrock provider plugin", () => {

721701

it("injects cache points for opaque application inference profile ARNs after profile lookup", async () => {

722702

const modelId =

723703

"arn:aws:bedrock:us-east-1:123456789012:application-inference-profile/z27qyso459da";

724-

inferenceProfileResults.push({

704+

inferenceProfileGetResults.push({

725705

models: [

726706

{

727707

modelArn:

@@ -745,14 +725,14 @@ describe("amazon-bedrock provider plugin", () => {

745725746726

const system = payload.system as Array<Record<string, unknown>>;

747727

expect(system[1]).toEqual({ cachePoint: { type: "default" } });

748-

expect(sendGetInferenceProfile).toHaveBeenCalledTimes(1);

728+

expect(sendBedrockCommand).toHaveBeenCalledTimes(1);

749729

expect(bedrockClientConfigs).toEqual([{ region: "us-east-1" }]);

750730

});

751731752732

it("does not inject cache points when any resolved profile target is not cacheable", async () => {

753733

const modelId =

754734

"arn:aws:bedrock:us-east-1:123456789012:application-inference-profile/z27qyso459db";

755-

inferenceProfileResults.push({

735+

inferenceProfileGetResults.push({

756736

models: [

757737

{

758738

modelArn:

@@ -785,7 +765,7 @@ describe("amazon-bedrock provider plugin", () => {

785765

it("retries opaque profile lookup after a transient failure instead of caching the fallback", async () => {

786766

const modelId =

787767

"arn:aws:bedrock:us-east-1:123456789012:application-inference-profile/z27qyso459dc";

788-

inferenceProfileResults.push(new Error("throttled"), {

768+

inferenceProfileGetResults.push(new Error("throttled"), {

789769

models: [

790770

{

791771

modelArn:

@@ -823,7 +803,7 @@ describe("amazon-bedrock provider plugin", () => {

823803

{ text: "You are helpful." },

824804

{ cachePoint: { type: "default" } },

825805

]);

826-

expect(sendGetInferenceProfile).toHaveBeenCalledTimes(2);

806+

expect(sendBedrockCommand).toHaveBeenCalledTimes(2);

827807

});

828808

});

829809

});