@openclaw/amazon-bedrock-provider 2026.6.6-beta.1 → 2026.6.6-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/discovery.js +5 -0
- package/dist/register.sync.runtime.js +6 -5
- package/dist/stream.runtime.js +29 -16
- package/dist/thinking-policy.js +17 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +4 -4
package/dist/discovery.js
CHANGED
|
@@ -99,6 +99,9 @@ function resolveKnownContextWindow(modelId) {
|
|
|
99
99
|
if (withoutVersionSuffix !== candidate && KNOWN_CONTEXT_WINDOWS[withoutVersionSuffix] !== void 0) return KNOWN_CONTEXT_WINDOWS[withoutVersionSuffix];
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
+
function isKnownClaudeMythosPreviewModelId(modelId) {
|
|
103
|
+
return [modelId, modelId.replace(/^(?:us|eu|ap|apac|au|jp|global)\./, "")].some((candidate) => /(?:^|[/.:])anthropic\.claude-mythos-preview(?:$|[-.:/])/i.test(candidate));
|
|
104
|
+
}
|
|
102
105
|
function resolveKnownThinkingLevelMap(modelId) {
|
|
103
106
|
return resolveBedrockNativeThinkingLevelMap(modelId);
|
|
104
107
|
}
|
|
@@ -189,6 +192,7 @@ function shouldIncludeSummary(summary, filter) {
|
|
|
189
192
|
if (!summary.modelId?.trim()) return false;
|
|
190
193
|
if (!matchesProviderFilter(summary, filter)) return false;
|
|
191
194
|
if (summary.responseStreamingSupported !== true) return false;
|
|
195
|
+
if (isKnownClaudeMythosPreviewModelId(summary.modelId)) return false;
|
|
192
196
|
if (!includesTextModalities(summary.outputModalities)) return false;
|
|
193
197
|
if (!isActive(summary)) return false;
|
|
194
198
|
return true;
|
|
@@ -273,6 +277,7 @@ function resolveInferenceProfiles(profiles, defaults, providerFilter, foundation
|
|
|
273
277
|
})) continue;
|
|
274
278
|
}
|
|
275
279
|
const baseModelId = resolveBaseModelId(profile);
|
|
280
|
+
if (isKnownClaudeMythosPreviewModelId(baseModelId ?? profile.inferenceProfileId)) continue;
|
|
276
281
|
const baseModel = baseModelId ? foundationModels.get(normalizeLowercaseStringOrEmpty(baseModelId)) : void 0;
|
|
277
282
|
const knownThinkingLevelMap = resolveKnownThinkingLevelMap(baseModelId ?? profile.inferenceProfileId);
|
|
278
283
|
const canonicalClaudeId = resolveClaudeModelIdentity({ id: baseModelId });
|
|
@@ -2,7 +2,7 @@ import { refreshAwsSharedConfigCacheForBedrock } from "./aws-credential-refresh.
|
|
|
2
2
|
import { supportsBedrockPromptCaching } from "./bedrock-options.js";
|
|
3
3
|
import { mergeImplicitBedrockProvider, resolveBedrockConfigApiKey } from "./discovery-shared.js";
|
|
4
4
|
import { bedrockMemoryEmbeddingProviderAdapter } from "./memory-embedding-adapter.js";
|
|
5
|
-
import { isOpus47OrNewerBedrockModelRef, resolveBedrockClaudeThinkingProfile, resolveBedrockNativeThinkingLevelMap, supportsBedrockNativeMaxEffort } from "./thinking-policy.js";
|
|
5
|
+
import { isLatestAdaptiveBedrockModelRef, isOpus47OrNewerBedrockModelRef, resolveBedrockClaudeThinkingProfile, resolveBedrockNativeThinkingLevelMap, supportsBedrockNativeMaxEffort } from "./thinking-policy.js";
|
|
6
6
|
import { streamBedrock, streamSimpleBedrock } from "./stream.runtime.js";
|
|
7
7
|
import { registerApiProvider, streamSimple } from "openclaw/plugin-sdk/llm";
|
|
8
8
|
import { resolvePluginConfigObject } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
@@ -323,8 +323,9 @@ function registerAmazonBedrockPlugin(api) {
|
|
|
323
323
|
else wrapped = createBedrockServiceTierWrapper(wrapped, serviceTier);
|
|
324
324
|
const region = resolveBedrockRegion(config) ?? extractRegionFromBaseUrl(model?.baseUrl) ?? currentPluginConfig?.discovery?.region;
|
|
325
325
|
const mayNeedCacheInjection = isBedrockAppInferenceProfile(modelId) && !sharedRuntimeWouldInjectCachePoints(modelId);
|
|
326
|
-
const shouldOmitTemperature = opus47OrNewer || fable5;
|
|
326
|
+
const shouldOmitTemperature = opus47OrNewer || fable5 || isLatestAdaptiveBedrockModelRef(modelId, model?.params);
|
|
327
327
|
const shouldPatchMaxThinking = supportsNativeMax && thinkingLevel === "max";
|
|
328
|
+
const shouldPatchPayload = shouldOmitTemperature || shouldPatchMaxThinking;
|
|
328
329
|
const heuristicMatch = needsCachePointInjection(modelId);
|
|
329
330
|
if (!region && !mayNeedCacheInjection && !shouldOmitTemperature && !shouldPatchMaxThinking) return createAwsCredentialRefreshStreamWrapper(wrapped);
|
|
330
331
|
const underlying = wrapped ?? streamFn;
|
|
@@ -334,11 +335,11 @@ function registerAmazonBedrockPlugin(api) {
|
|
|
334
335
|
const originalOnPayload = merged.onPayload;
|
|
335
336
|
if (!mayNeedCacheInjection) return underlying(streamModel, context, withAwsCredentialRefreshOnPayload({
|
|
336
337
|
...merged,
|
|
337
|
-
...
|
|
338
|
+
...shouldPatchPayload ? { onPayload: (payload, payloadModel) => {
|
|
338
339
|
if (payload && typeof payload === "object") {
|
|
339
340
|
const payloadRecord = payload;
|
|
340
|
-
patchMaxThinkingEffort(payloadRecord);
|
|
341
|
-
omitUnsupportedClaudePayloadTemperature(payloadRecord);
|
|
341
|
+
if (shouldPatchMaxThinking) patchMaxThinkingEffort(payloadRecord);
|
|
342
|
+
if (shouldOmitTemperature) omitUnsupportedClaudePayloadTemperature(payloadRecord);
|
|
342
343
|
}
|
|
343
344
|
return originalOnPayload?.(payload, payloadModel);
|
|
344
345
|
} } : {}
|
package/dist/stream.runtime.js
CHANGED
|
@@ -185,25 +185,29 @@ function formatBedrockError(error) {
|
|
|
185
185
|
return message;
|
|
186
186
|
}
|
|
187
187
|
/** Stream a Bedrock Converse request from the generic OpenClaw stream options. */
|
|
188
|
-
const streamSimpleBedrock = (model, context, options) =>
|
|
188
|
+
const streamSimpleBedrock = (model, context, options) => streamBedrock(model, context, resolveSimpleBedrockOptions(model, options));
|
|
189
|
+
function resolveSimpleBedrockOptions(model, options) {
|
|
189
190
|
const base = buildBaseOptions(model, options, void 0);
|
|
190
|
-
if (usesClaudeFable5BedrockContract(model)) return
|
|
191
|
+
if (usesClaudeFable5BedrockContract(model)) return {
|
|
191
192
|
...base,
|
|
192
193
|
reasoning: options?.reasoning ?? "high",
|
|
193
194
|
thinkingBudgets: options?.thinkingBudgets
|
|
194
|
-
}
|
|
195
|
-
if (!options?.reasoning)
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
195
|
+
};
|
|
196
|
+
if (!options?.reasoning) {
|
|
197
|
+
const reasoning = isAnthropicClaudeModel(model) && requiresMandatoryAdaptiveThinking(model) ? "high" : void 0;
|
|
198
|
+
return {
|
|
199
|
+
...base,
|
|
200
|
+
reasoning
|
|
201
|
+
};
|
|
202
|
+
}
|
|
199
203
|
if (isAnthropicClaudeModel(model)) {
|
|
200
|
-
if (supportsAdaptiveThinking(model)) return
|
|
204
|
+
if (supportsAdaptiveThinking(model)) return {
|
|
201
205
|
...base,
|
|
202
206
|
reasoning: options.reasoning,
|
|
203
207
|
thinkingBudgets: options.thinkingBudgets
|
|
204
|
-
}
|
|
208
|
+
};
|
|
205
209
|
const adjusted = adjustMaxTokensForThinking(base.maxTokens, model.maxTokens, options.reasoning, options.thinkingBudgets);
|
|
206
|
-
return
|
|
210
|
+
return {
|
|
207
211
|
...base,
|
|
208
212
|
maxTokens: adjusted.maxTokens,
|
|
209
213
|
reasoning: options.reasoning,
|
|
@@ -211,14 +215,14 @@ const streamSimpleBedrock = (model, context, options) => {
|
|
|
211
215
|
...options.thinkingBudgets,
|
|
212
216
|
[clampReasoning(options.reasoning)]: adjusted.thinkingBudget
|
|
213
217
|
}
|
|
214
|
-
}
|
|
218
|
+
};
|
|
215
219
|
}
|
|
216
|
-
return
|
|
220
|
+
return {
|
|
217
221
|
...base,
|
|
218
222
|
reasoning: options.reasoning,
|
|
219
223
|
thinkingBudgets: options.thinkingBudgets
|
|
220
|
-
}
|
|
221
|
-
}
|
|
224
|
+
};
|
|
225
|
+
}
|
|
222
226
|
function handleContentBlockStart(event, blocks, output, stream) {
|
|
223
227
|
const index = event.contentBlockIndex;
|
|
224
228
|
const start = event.start;
|
|
@@ -358,13 +362,20 @@ function handleContentBlockStop(event, blocks, output, stream) {
|
|
|
358
362
|
function resolveClaudeProfileNameModelId(modelName) {
|
|
359
363
|
const normalized = modelName?.trim().toLowerCase().replace(/[\s_.:]+/g, "-") ?? "";
|
|
360
364
|
if (!normalized.includes("claude")) return;
|
|
361
|
-
const family = /(?:fable-5|opus-4-(?:6|7|8)|sonnet-4-6)(?:$|-)/.exec(normalized)?.[0];
|
|
365
|
+
const family = /(?:fable-5|mythos-preview|opus-4-(?:6|7|8)|sonnet-4-6)(?:$|-)/.exec(normalized)?.[0];
|
|
362
366
|
return family ? `claude-${family.replace(/-$/, "")}` : void 0;
|
|
363
367
|
}
|
|
368
|
+
function isClaudeMythosPreviewModelId(modelId) {
|
|
369
|
+
return /(?:^|-)claude-mythos-preview(?=$|[^a-z0-9])/.test(modelId?.trim().toLowerCase().replace(/[\s_.:]+/g, "-") ?? "");
|
|
370
|
+
}
|
|
364
371
|
/** Check canonical metadata and profile names for adaptive Claude support. */
|
|
365
372
|
function supportsAdaptiveThinking(model) {
|
|
366
373
|
const profileModelId = resolveClaudeProfileNameModelId(model.name);
|
|
367
|
-
return supportsClaudeAdaptiveThinking(model) || supportsClaudeAdaptiveThinking({ id: profileModelId });
|
|
374
|
+
return supportsClaudeAdaptiveThinking(model) || supportsClaudeAdaptiveThinking({ id: profileModelId }) || isClaudeMythosPreviewModelId(resolveClaudeModelIdentity(model)) || isClaudeMythosPreviewModelId(profileModelId);
|
|
375
|
+
}
|
|
376
|
+
function requiresMandatoryAdaptiveThinking(model) {
|
|
377
|
+
const profileModelId = resolveClaudeProfileNameModelId(model.name);
|
|
378
|
+
return isClaudeMythosPreviewModelId(resolveClaudeModelIdentity(model)) || isClaudeMythosPreviewModelId(profileModelId);
|
|
368
379
|
}
|
|
369
380
|
function supportsNativeXhighEffort(model) {
|
|
370
381
|
const profileModelId = resolveClaudeProfileNameModelId(model.name);
|
|
@@ -654,10 +665,12 @@ function createImageBlock(mimeType, data) {
|
|
|
654
665
|
}
|
|
655
666
|
/** Test-only hooks for Bedrock runtime conversion and endpoint policy. */
|
|
656
667
|
const testing = {
|
|
668
|
+
buildAdditionalModelRequestFields,
|
|
657
669
|
convertMessages,
|
|
658
670
|
getConfiguredBedrockRegion,
|
|
659
671
|
hasConfiguredBedrockProfile,
|
|
660
672
|
mapThinkingLevelToEffort,
|
|
673
|
+
resolveSimpleBedrockOptions,
|
|
661
674
|
shouldUseExplicitBedrockEndpoint
|
|
662
675
|
};
|
|
663
676
|
//#endregion
|
package/dist/thinking-policy.js
CHANGED
|
@@ -21,6 +21,18 @@ function isOpus47BedrockModelRef(modelRef) {
|
|
|
21
21
|
function isOpus47OrNewerBedrockModelRef(modelRef) {
|
|
22
22
|
return isOpus47BedrockModelRef(modelRef) || isOpus48BedrockModelRef(modelRef);
|
|
23
23
|
}
|
|
24
|
+
function isMythosPreviewBedrockModelRef(modelRef) {
|
|
25
|
+
return /(?:^|[/.:])(?:(?:us|eu|ap|apac|au|jp|global)\.)?(?:anthropic\.)?claude-mythos-preview(?:$|[-.:/])/i.test(modelRef);
|
|
26
|
+
}
|
|
27
|
+
/** Return whether a Bedrock Claude ref needs latest adaptive-thinking request shaping. */
|
|
28
|
+
function isLatestAdaptiveBedrockModelRef(modelId, params) {
|
|
29
|
+
const modelRef = {
|
|
30
|
+
id: modelId,
|
|
31
|
+
params
|
|
32
|
+
};
|
|
33
|
+
const canonicalModelId = resolveClaudeModelIdentity(modelRef);
|
|
34
|
+
return resolveClaudeFable5ModelIdentity(modelRef) !== void 0 || [modelId, canonicalModelId].some((candidate) => isOpus47OrNewerBedrockModelRef(candidate) || isMythosPreviewBedrockModelRef(candidate));
|
|
35
|
+
}
|
|
24
36
|
/** Return whether a Bedrock Claude ref supports max effort. */
|
|
25
37
|
function supportsBedrockNativeMaxEffort(modelId, params) {
|
|
26
38
|
if (resolveClaudeFable5ModelIdentity({
|
|
@@ -96,6 +108,10 @@ function resolveBedrockClaudeThinkingProfile(modelId, params) {
|
|
|
96
108
|
],
|
|
97
109
|
defaultLevel: "adaptive"
|
|
98
110
|
};
|
|
111
|
+
if (modelRefs.some(isMythosPreviewBedrockModelRef)) return {
|
|
112
|
+
levels: [...BASE_CLAUDE_THINKING_LEVELS, { id: "adaptive" }],
|
|
113
|
+
defaultLevel: "adaptive"
|
|
114
|
+
};
|
|
99
115
|
if (modelRefs.some((modelRef) => /claude-sonnet-4(?:\.|-)6(?:$|[-.])/i.test(modelRef))) return {
|
|
100
116
|
levels: [...BASE_CLAUDE_THINKING_LEVELS, { id: "adaptive" }],
|
|
101
117
|
defaultLevel: "adaptive"
|
|
@@ -103,4 +119,4 @@ function resolveBedrockClaudeThinkingProfile(modelId, params) {
|
|
|
103
119
|
return { levels: BASE_CLAUDE_THINKING_LEVELS };
|
|
104
120
|
}
|
|
105
121
|
//#endregion
|
|
106
|
-
export { isOpus47BedrockModelRef, isOpus47OrNewerBedrockModelRef, resolveBedrockClaudeThinkingProfile, resolveBedrockNativeThinkingLevelMap, supportsBedrockNativeMaxEffort };
|
|
122
|
+
export { isLatestAdaptiveBedrockModelRef, isOpus47BedrockModelRef, isOpus47OrNewerBedrockModelRef, resolveBedrockClaudeThinkingProfile, resolveBedrockNativeThinkingLevelMap, supportsBedrockNativeMaxEffort };
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/amazon-bedrock-provider",
|
|
3
|
-
"version": "2026.6.6-beta.
|
|
3
|
+
"version": "2026.6.6-beta.2",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@openclaw/amazon-bedrock-provider",
|
|
9
|
-
"version": "2026.6.6-beta.
|
|
9
|
+
"version": "2026.6.6-beta.2",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@aws-sdk/client-bedrock": "3.1056.0",
|
|
12
12
|
"@aws-sdk/client-bedrock-runtime": "3.1056.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/amazon-bedrock-provider",
|
|
3
|
-
"version": "2026.6.6-beta.
|
|
3
|
+
"version": "2026.6.6-beta.2",
|
|
4
4
|
"description": "OpenClaw Amazon Bedrock provider plugin with model discovery, embeddings, and guardrail support.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
"minHostVersion": ">=2026.5.12-beta.1"
|
|
26
26
|
},
|
|
27
27
|
"compat": {
|
|
28
|
-
"pluginApi": ">=2026.6.6-beta.
|
|
28
|
+
"pluginApi": ">=2026.6.6-beta.2"
|
|
29
29
|
},
|
|
30
30
|
"build": {
|
|
31
|
-
"openclawVersion": "2026.6.6-beta.
|
|
31
|
+
"openclawVersion": "2026.6.6-beta.2",
|
|
32
32
|
"bundledDist": false
|
|
33
33
|
},
|
|
34
34
|
"release": {
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"README.md"
|
|
47
47
|
],
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"openclaw": ">=2026.6.6-beta.
|
|
49
|
+
"openclaw": ">=2026.6.6-beta.2"
|
|
50
50
|
},
|
|
51
51
|
"peerDependenciesMeta": {
|
|
52
52
|
"openclaw": {
|