@openclaw/amazon-bedrock-mantle-provider 2026.7.2-beta.7 → 2026.8.1-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 +20 -4
- package/package.json +4 -4
package/dist/discovery.js
CHANGED
|
@@ -75,6 +75,10 @@ function resolveMantleBearerToken(env = process.env) {
|
|
|
75
75
|
}
|
|
76
76
|
/** Token cache for IAM-derived bearer tokens, keyed by region. */
|
|
77
77
|
const iamTokenCache = /* @__PURE__ */ new Map();
|
|
78
|
+
/** Last emitted IAM token failure per region, retained until token generation succeeds. */
|
|
79
|
+
const iamTokenFailureDetailByRegion = /* @__PURE__ */ new Map();
|
|
80
|
+
/** Success epoch per region; failures spanning a recovery cannot restore stale diagnostics. */
|
|
81
|
+
const iamTokenSuccessEpochByRegion = /* @__PURE__ */ new Map();
|
|
78
82
|
const IAM_TOKEN_TTL_MS = 72e5;
|
|
79
83
|
function resolveMantleRegion(env) {
|
|
80
84
|
return normalizeOptionalString(env.AWS_REGION) ?? normalizeOptionalString(env.AWS_DEFAULT_REGION) ?? "us-east-1";
|
|
@@ -94,6 +98,7 @@ async function generateBearerTokenFromIam(params) {
|
|
|
94
98
|
const now = params.now?.() ?? Date.now();
|
|
95
99
|
const cached = getCachedIamTokenEntry(params.region, now);
|
|
96
100
|
if (cached) return cached.token;
|
|
101
|
+
const successEpoch = iamTokenSuccessEpochByRegion.get(params.region) ?? 0;
|
|
97
102
|
try {
|
|
98
103
|
const token = await (params.tokenProviderFactory ?? await loadMantleBearerTokenProviderFactory())({
|
|
99
104
|
region: params.region,
|
|
@@ -104,12 +109,21 @@ async function generateBearerTokenFromIam(params) {
|
|
|
104
109
|
token,
|
|
105
110
|
expiresAt
|
|
106
111
|
});
|
|
112
|
+
iamTokenSuccessEpochByRegion.set(params.region, (iamTokenSuccessEpochByRegion.get(params.region) ?? 0) + 1);
|
|
113
|
+
iamTokenFailureDetailByRegion.delete(params.region);
|
|
107
114
|
return token;
|
|
108
115
|
} catch (error) {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
116
|
+
if (successEpoch !== (iamTokenSuccessEpochByRegion.get(params.region) ?? 0)) return;
|
|
117
|
+
if (log.isEnabled("debug")) {
|
|
118
|
+
const errorMessage = formatErrorMessage(error);
|
|
119
|
+
if (iamTokenFailureDetailByRegion.get(params.region) !== errorMessage) {
|
|
120
|
+
iamTokenFailureDetailByRegion.set(params.region, errorMessage);
|
|
121
|
+
log.debug("Mantle IAM token generation unavailable", {
|
|
122
|
+
region: params.region,
|
|
123
|
+
error: errorMessage
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
}
|
|
113
127
|
return;
|
|
114
128
|
}
|
|
115
129
|
}
|
|
@@ -148,6 +162,8 @@ async function resolveMantleRuntimeBearerToken(params) {
|
|
|
148
162
|
/** Clear the IAM token cache for tests. */
|
|
149
163
|
function resetIamTokenCacheForTest() {
|
|
150
164
|
iamTokenCache.clear();
|
|
165
|
+
iamTokenFailureDetailByRegion.clear();
|
|
166
|
+
iamTokenSuccessEpochByRegion.clear();
|
|
151
167
|
}
|
|
152
168
|
/** Model ID substrings that indicate reasoning/thinking support. */
|
|
153
169
|
const REASONING_PATTERNS = [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/amazon-bedrock-mantle-provider",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.8.1-beta.2",
|
|
4
4
|
"description": "OpenClaw Amazon Bedrock Mantle provider plugin for OpenAI-compatible model routing.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
"minHostVersion": ">=2026.5.12-beta.1"
|
|
22
22
|
},
|
|
23
23
|
"compat": {
|
|
24
|
-
"pluginApi": ">=2026.
|
|
24
|
+
"pluginApi": ">=2026.8.1-beta.2"
|
|
25
25
|
},
|
|
26
26
|
"build": {
|
|
27
|
-
"openclawVersion": "2026.
|
|
27
|
+
"openclawVersion": "2026.8.1-beta.2",
|
|
28
28
|
"bundledDist": false
|
|
29
29
|
},
|
|
30
30
|
"release": {
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"README.md"
|
|
42
42
|
],
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"openclaw": ">=2026.
|
|
44
|
+
"openclaw": ">=2026.8.1-beta.2"
|
|
45
45
|
},
|
|
46
46
|
"peerDependenciesMeta": {
|
|
47
47
|
"openclaw": {
|