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

推荐订阅源

The GitHub Blog
The GitHub Blog
I
InfoQ
U
Unit 42
WordPress大学
WordPress大学
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Apple Machine Learning Research
Apple Machine Learning Research
J
Java Code Geeks
月光博客
月光博客
D
Docker
Stack Overflow Blog
Stack Overflow Blog
D
DataBreaches.Net
阮一峰的网络日志
阮一峰的网络日志
Blog — PlanetScale
Blog — PlanetScale
V
Visual Studio Blog
博客园 - 聂微东
A
About on SuperTechFans
腾讯CDC
Jina AI
Jina AI
Microsoft Azure Blog
Microsoft Azure Blog
GbyAI
GbyAI
博客园 - 【当耐特】
罗磊的独立博客
博客园 - 三生石上(FineUI控件)
M
MIT News - Artificial intelligence

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: treat aws sdk auth profiles as config metadata · ope...
steipete · 2026-05-07 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -160,8 +160,8 @@ Docs: https://docs.openclaw.ai

160160

- CLI backends: keep versioned OAuth identity matches reusable when auth profile ids rotate, so Claude CLI sessions do not reset and lose continuity during same-account OAuth refresh/profile alias changes. Fixes #78541.

161161

- Model providers: normalize APNG sniffed PNG uploads, preserve Gemini 3 tool-call thought-signature replay with documented fallback signatures, accept legacy `__env__:VAR` custom-provider keys, and repair snake_case tool-call transcript sanitization. Fixes #51881, #48915, #77566, and #42858.

162162

- Telegram/models: parse provider ids containing dots in `/models` callback buttons so `hf.co` model lists render as inline keyboard buttons. Fixes #38745.

163-

- Auth profiles/Bedrock: accept persisted `type: "aws-sdk"` auth profiles so EC2/IMDS and shared AWS credential-chain Bedrock setups are not dropped as `invalid_type`. Fixes #69708.

164163

- Amazon Bedrock: refresh shared AWS profile/config file credentials before Bedrock model, discovery, and embedding requests so long-running Gateway processes pick up renewed profile credentials without restart. Fixes #77551.

164+

- Amazon Bedrock: treat named `aws-sdk` auth profiles as config routing metadata instead of stored credentials, and let `doctor --fix` move legacy markers out of `auth-profiles.json`. Fixes #69708.

165165

- Anthropic: reject uppercase provider-prefixed forward-compat model ids locally instead of sending malformed dynamic ids upstream. Fixes #73715.

166166

- OpenAI/embeddings: pass configured output dimensionality through single and batched embedding requests so memory embedding indexes can request smaller vectors. Fixes #55126.

167167

- CLI/infer: normalize HEIC/HEIF image files to JPEG before model-run requests, avoiding providers that reject Apple image container formats. Fixes #50081.

Original file line numberDiff line numberDiff line change

@@ -62,6 +62,18 @@ Explicit copy flows, such as `openclaw agents add`, use this portability policy:

6262

Non-portable profiles remain available through read-through inheritance unless

6363

the target agent signs in separately and creates its own local profile.

6464
65+

## Config-only auth routes

66+
67+

`auth.profiles` entries with `mode: "aws-sdk"` are routing metadata, not stored

68+

credentials. They are valid when the target provider uses

69+

`models.providers.<id>.auth: "aws-sdk"` or the built-in Amazon Bedrock default

70+

AWS SDK route. These profile ids may appear in `auth.order` and session

71+

overrides even when no matching entry exists in `auth-profiles.json`.

72+
73+

Do not write `type: "aws-sdk"` into `auth-profiles.json`. If a legacy install

74+

has such a marker, `openclaw doctor --fix` moves it to `auth.profiles` and

75+

removes the marker from the credential store.

76+
6577

## Explicit auth order filtering

6678
6779

- When `auth.order.<provider>` or the auth-store order override is set for a

Original file line numberDiff line numberDiff line change

@@ -110,6 +110,8 @@ openclaw models auth paste-token --provider openrouter

110110
111111

OpenClaw expects the canonical `version` + `profiles` shape at runtime. If an older install still has a flat file such as `{ "openrouter": { "apiKey": "..." } }`, run `openclaw doctor --fix` to rewrite it as an `openrouter:default` API-key profile; doctor keeps a `.legacy-flat.*.bak` copy beside the original. Endpoint details such as `baseUrl`, `api`, model ids, headers, and timeouts belong under `models.providers.<id>` in `openclaw.json` or `models.json`, not in `auth-profiles.json`.

112112
113+

External auth routes such as Bedrock `auth: "aws-sdk"` are also not credentials. If you want a named Bedrock route, put `auth.profiles.<id>.mode: "aws-sdk"` in `openclaw.json`; do not write `type: "aws-sdk"` into `auth-profiles.json`. `openclaw doctor --fix` moves legacy AWS SDK markers from the credential store into config metadata.

114+
113115

Auth profile refs are also supported for static credentials:

114116
115117

- `api_key` credentials can use `keyRef: { source, provider, id }`

Original file line numberDiff line numberDiff line change

@@ -17,7 +17,7 @@ export type AuthProfileHealthStatus = "ok" | "expiring" | "expired" | "missing"

1717

type AuthProfileHealth = {

1818

profileId: string;

1919

provider: string;

20-

type: "oauth" | "token" | "api_key" | "aws-sdk";

20+

type: "oauth" | "token" | "api_key";

2121

status: AuthProfileHealthStatus;

2222

reasonCode?: AuthCredentialReasonCode;

2323

expiresAt?: number;

@@ -127,17 +127,6 @@ function buildProfileHealth(params: {

127127

};

128128

}

129129
130-

if (healthCredential.type === "aws-sdk") {

131-

return {

132-

profileId,

133-

provider,

134-

type: "aws-sdk",

135-

status: "static",

136-

source,

137-

label,

138-

};

139-

}

140-
141130

if (healthCredential.type === "token") {

142131

const eligibility = evaluateStoredCredentialEligibility({

143132

credential: healthCredential,

Original file line numberDiff line numberDiff line change

@@ -996,25 +996,6 @@ describe("ensureAuthProfileStore", () => {

996996

}

997997

});

998998
999-

it("accepts aws-sdk auth profiles without static credential material (#69708)", () => {

1000-

withTempAgentDir("openclaw-auth-aws-sdk-", (agentDir) => {

1001-

writeAuthProfileStore(agentDir, {

1002-

"amazon-bedrock:default": {

1003-

type: "aws-sdk",

1004-

provider: "amazon-bedrock",

1005-

createdAt: "2026-03-15T10:00:00.000Z",

1006-

},

1007-

});

1008-
1009-

const profile = loadAuthProfile(agentDir, "amazon-bedrock:default");

1010-
1011-

expect(profile).toMatchObject({

1012-

type: "aws-sdk",

1013-

provider: "amazon-bedrock",

1014-

});

1015-

});

1016-

});

1017-
1018999

it.each([

10191000

{

10201001

name: "migrates SecretRef object in `key` to `keyRef` and clears `key`",

Original file line numberDiff line numberDiff line change

@@ -42,6 +42,67 @@ describe("resolveAuthProfileOrder", () => {

4242

const store = ANTHROPIC_STORE;

4343

const cfg = ANTHROPIC_CFG;

4444
45+

it("keeps config-only aws-sdk profiles for aws-sdk providers", () => {

46+

const order = resolveAuthProfileOrder({

47+

cfg: {

48+

models: {

49+

providers: {

50+

"amazon-bedrock": {

51+

auth: "aws-sdk",

52+

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

53+

api: "bedrock-converse-stream",

54+

models: [],

55+

},

56+

},

57+

},

58+

auth: {

59+

order: {

60+

"amazon-bedrock": ["amazon-bedrock:default"],

61+

},

62+

profiles: {

63+

"amazon-bedrock:default": {

64+

provider: "amazon-bedrock",

65+

mode: "aws-sdk",

66+

},

67+

},

68+

},

69+

},

70+

store: { version: 1, profiles: {} },

71+

provider: "amazon-bedrock",

72+

});

73+
74+

expect(order).toEqual(["amazon-bedrock:default"]);

75+

});

76+
77+

it("rejects config-only aws-sdk profiles for non aws-sdk providers", () => {

78+

const order = resolveAuthProfileOrder({

79+

cfg: {

80+

models: {

81+

providers: {

82+

anthropic: {

83+

auth: "api-key",

84+

baseUrl: "https://api.anthropic.com",

85+

api: "anthropic-messages",

86+

models: [],

87+

},

88+

},

89+

},

90+

auth: {

91+

profiles: {

92+

"anthropic:aws": {

93+

provider: "anthropic",

94+

mode: "aws-sdk",

95+

},

96+

},

97+

},

98+

},

99+

store: { version: 1, profiles: {} },

100+

provider: "anthropic",

101+

});

102+
103+

expect(order).toEqual([]);

104+

});

105+
45106

function resolveWithAnthropicOrderAndUsage(params: {

46107

orderSource: "store" | "config";

47108

usageStats: NonNullable<AuthProfileStore["usageStats"]>;

Original file line numberDiff line numberDiff line change

@@ -16,7 +16,11 @@ export {

1616

type ExternalCliAuthDiscovery,

1717

} from "./auth-profiles/external-cli-discovery.js";

1818

export { resolveApiKeyForProfile } from "./auth-profiles/oauth.js";

19-

export { resolveAuthProfileEligibility, resolveAuthProfileOrder } from "./auth-profiles/order.js";

19+

export {

20+

isConfiguredAwsSdkAuthProfileForProvider,

21+

resolveAuthProfileEligibility,

22+

resolveAuthProfileOrder,

23+

} from "./auth-profiles/order.js";

2024

export {

2125

resolveAuthStatePathForDisplay,

2226

resolveAuthStorePathForDisplay,

Original file line numberDiff line numberDiff line change

@@ -85,10 +85,6 @@ export function evaluateStoredCredentialEligibility(params: {

8585

return { eligible: true, reasonCode: "ok" };

8686

}

8787
88-

if (credential.type === "aws-sdk") {

89-

return { eligible: true, reasonCode: "ok" };

90-

}

91-
9288

if (credential.type === "token") {

9389

const hasToken = hasConfiguredSecretString(credential.token);

9490

const hasTokenRef = hasConfiguredSecretRef(credential.tokenRef);

Original file line numberDiff line numberDiff line change

@@ -80,7 +80,7 @@ function isProfileConfigCompatible(params: {

8080

cfg?: OpenClawConfig;

8181

profileId: string;

8282

provider: string;

83-

mode: "api_key" | "aws-sdk" | "token" | "oauth";

83+

mode: "api_key" | "token" | "oauth";

8484

allowOAuthTokenCompatibility?: boolean;

8585

}): boolean {

8686

const profileConfig = params.cfg?.auth?.profiles?.[params.profileId];

@@ -311,9 +311,6 @@ export async function resolveApiKeyForProfile(

311311

}

312312

return buildApiKeyProfileResult({ apiKey: key, provider: cred.provider, email: cred.email });

313313

}

314-

if (cred.type === "aws-sdk") {

315-

return null;

316-

}

317314

if (cred.type === "token") {

318315

const expiryState = resolveTokenExpiryState(cred.expires);

319316

if (expiryState === "expired" || expiryState === "invalid_expires") {

Original file line numberDiff line numberDiff line change

@@ -24,6 +24,45 @@ export type AuthProfileEligibility = {

2424

reasonCode: AuthProfileEligibilityReasonCode;

2525

};

2626
27+

function resolveProviderAuthMode(

28+

cfg: OpenClawConfig | undefined,

29+

provider: string,

30+

): string | undefined {

31+

const providers = cfg?.models?.providers;

32+

if (!providers) {

33+

return undefined;

34+

}

35+

const entry = findNormalizedProviderValue(providers, provider);

36+

const auth = entry?.auth;

37+

return typeof auth === "string" ? auth : undefined;

38+

}

39+
40+

function providerAllowsAwsSdkAuth(cfg: OpenClawConfig | undefined, provider: string): boolean {

41+

const authMode = resolveProviderAuthMode(cfg, provider);

42+

return (

43+

authMode === "aws-sdk" ||

44+

(authMode === undefined && normalizeProviderId(provider) === "amazon-bedrock")

45+

);

46+

}

47+
48+

export function isConfiguredAwsSdkAuthProfileForProvider(params: {

49+

cfg?: OpenClawConfig;

50+

provider: string;

51+

profileId: string;

52+

}): boolean {

53+

const profileConfig = params.cfg?.auth?.profiles?.[params.profileId];

54+

if (!profileConfig || profileConfig.mode !== "aws-sdk") {

55+

return false;

56+

}

57+

const providerAuthKey = resolveProviderIdForAuth(params.provider, { config: params.cfg });

58+

if (

59+

resolveProviderIdForAuth(profileConfig.provider, { config: params.cfg }) !== providerAuthKey

60+

) {

61+

return false;

62+

}

63+

return providerAllowsAwsSdkAuth(params.cfg, params.provider);

64+

}

65+
2766

export function resolveAuthProfileEligibility(params: {

2867

cfg?: OpenClawConfig;

2968

store: AuthProfileStore;

@@ -34,6 +73,15 @@ export function resolveAuthProfileEligibility(params: {

3473

const providerAuthKey = resolveProviderIdForAuth(params.provider, { config: params.cfg });

3574

const cred = params.store.profiles[params.profileId];

3675

if (!cred) {

76+

if (

77+

isConfiguredAwsSdkAuthProfileForProvider({

78+

cfg: params.cfg,

79+

provider: params.provider,

80+

profileId: params.profileId,

81+

})

82+

) {

83+

return { eligible: true, reasonCode: "ok" };

84+

}

3785

return { eligible: false, reasonCode: "profile_missing" };

3886

}

3987

if (resolveProviderIdForAuth(cred.provider, { config: params.cfg }) !== providerAuthKey) {