






















@@ -290,6 +290,61 @@ async function expectBedrockAuthSource(params: {
290290});
291291}
292292293+it("resolves persisted aws-sdk auth profiles without static keys (#69708)", async () => {
294+const agentDir = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-bedrock-auth-profile-"));
295+try {
296+await fs.writeFile(
297+path.join(agentDir, "auth-profiles.json"),
298+`${JSON.stringify(
299+ {
300+ version: 1,
301+ profiles: {
302+ "amazon-bedrock:default": {
303+ type: "aws-sdk",
304+ provider: "amazon-bedrock",
305+ createdAt: "2026-03-15T10:00:00.000Z",
306+ },
307+ },
308+ },
309+ null,
310+ 2,
311+ )}\n`,
312+"utf8",
313+);
314+clearRuntimeAuthProfileStoreSnapshots();
315+const store = ensureAuthProfileStore(agentDir);
316+317+const resolved = await resolveApiKeyForProvider({
318+provider: "amazon-bedrock",
319+profileId: "amazon-bedrock:default",
320+cfg: BEDROCK_PROVIDER_CFG as never,
321+ store,
322+ agentDir,
323+});
324+325+expect(resolved).toMatchObject({
326+mode: "aws-sdk",
327+profileId: "amazon-bedrock:default",
328+source: "profile:amazon-bedrock:default",
329+});
330+expect(resolved.apiKey).toBeUndefined();
331+await expect(
332+hasAvailableAuthForProvider({
333+provider: "amazon-bedrock",
334+cfg: BEDROCK_PROVIDER_CFG as never,
335+ store,
336+ agentDir,
337+}),
338+).resolves.toBe(true);
339+expect(resolveModelAuthMode("amazon-bedrock", BEDROCK_PROVIDER_CFG as never, store)).toBe(
340+"aws-sdk",
341+);
342+} finally {
343+await fs.rm(agentDir, { recursive: true, force: true });
344+clearRuntimeAuthProfileStoreSnapshots();
345+}
346+});
347+293348function buildDemoLocalStore(keys: string[]) {
294349return {
295350version: 1 as const,
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。