openclaw - ✅(Solved) Fix amazon-bedrock: `xhigh` thinking level missing for Claude Opus 4.7 (and adaptive for sonnet-4.6) [3 pull requests, 3 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#74701Fetched 2026-04-30 06:21:06
View on GitHub
Comments
3
Participants
3
Timeline
12
Reactions
2
Timeline (top)
commented ×3cross-referenced ×3mentioned ×2subscribed ×2

The amazon-bedrock provider extension hard-codes resolveThinkingProfile and never advertises xhigh, even for Claude Opus 4.7 (where the downstream stream runtime already maps xhigh → xhigh). As a result, /think autocomplete on channels where the session is bound to a Bedrock Opus 4.7 model (e.g. amazon-bedrock/us.anthropic.claude-opus-4-7) is missing xhigh, while the same agent using openai/gpt-5.5 on another surface shows xhigh correctly.

The native anthropic extension does the right thing — it uses isClaudeOpus47ModelId(modelId) and includes xhigh (and adaptive) in the profile. Only the Bedrock path is out of sync.

Root Cause

dist/extensions/amazon-bedrock/register.sync.runtime.js around line 247:

resolveThinkingProfile: ({ modelId }) => ({
  levels: [
    { id: "off" },
    { id: "minimal" },
    { id: "low" },
    { id: "medium" },
    { id: "high" },
    ...claude46ModelRe.test(modelId.trim()) ? [{ id: "adaptive" }] : []
  ],
  defaultLevel: claude46ModelRe.test(modelId.trim()) ? "adaptive" : void 0
})

No branch for Claude Opus 4.7 (us.anthropic.claude-opus-4-7 / us.anthropic.claude-opus-4.7), so the plugin omits xhigh. Also missing adaptive for sonnet-4-6/sonnet-4.6 (native Anthropic extension uses a broader supportsAdaptiveThinking matcher).

Upstream dispatcher in dist/thinking-DhTFkZJF.js (~line 308) early-returns once a plugin yields a non-empty profile, so the provider-level supportsXHighThinking hook never fires to append xhigh afterward:

const pluginProfile = resolveProviderThinkingProfile({...});
if (pluginProfile) {
  const normalized = normalizeThinkingProfile(pluginProfile);
  if (normalized.levels.length > 0) return normalized; // ← returns before xhigh append
}

Meanwhile downstream mapping is already wired for Bedrock+Opus 4.7 xhigh (dist/provider-stream-BtN3gEYv.js):

case "xhigh":
  if (isClaudeOpus47Model(modelId)) return "xhigh";
  return isClaudeOpus46Model(modelId) ? "max" : "high";

So the backend supports xhigh on Bedrock Opus 4.7 — only the profile exposure is missing.

Fix Action

Workaround

Switch the affected session to openai/gpt-5.5 or direct anthropic/claude-opus-4-7 (non-Bedrock) — both expose xhigh via their own plugins.

PR fix notes

PR #74712: fix(amazon-bedrock): expose xhigh thinking level for Claude Opus 4.7 inference profiles (#74701)

Description (problem / solution / changelog)

Root cause

resolveThinkingProfile in the Amazon Bedrock plugin never included xhigh for Claude Opus 4.7 inference profiles (us.anthropic.claude-opus-4-7, eu.anthropic.claude-opus-4.7, etc.). The downstream stream runtime already maps xhigh→xhigh for these models, so the backend supports it — only the profile exposure was missing.

Fix

Add xhigh to the levels array using the existing isOpus47BedrockModelRef guard (already in the file), alongside the existing claude46ModelRe adaptive branch. Two-line delta, no new regex.

// Before:
...(claude46ModelRe.test(modelId.trim()) ? [{ id: "adaptive" as const }] : []),

// After:
...(isOpus47BedrockModelRef(modelId.trim()) ? [{ id: "xhigh" as const }] : []),
...(claude46ModelRe.test(modelId.trim()) ? [{ id: "adaptive" as const }] : []),

The isOpus47BedrockModelRef regex already handles the region-prefixed Bedrock model ID format (us.anthropic.*, eu.anthropic.*, etc.) that resolveClaudeThinkingProfile from provider-model-shared does not match.

Test

Added exposes xhigh thinking for Claude Opus 4.7 Bedrock inference profiles covering:

  • us.anthropic.claude-opus-4-7 → has xhigh ✓
  • eu.anthropic.claude-opus-4.7 → has xhigh ✓
  • anthropic.claude-opus-4-7-20260219 → has xhigh ✓
  • us.anthropic.claude-opus-4-6-v1 → no xhigh ✓

30/30 tests pass.

Fixes #74701.

Changed files

  • CHANGELOG.md (modified, +1/-0)
  • extensions/amazon-bedrock/index.test.ts (modified, +20/-0)
  • extensions/amazon-bedrock/register.sync.runtime.ts (modified, +1/-0)

PR #74740: fix(bedrock): expose xhigh + adaptive thinking for Claude Opus 4.7

Description (problem / solution / changelog)

Fixes #74701.

Problem

The amazon-bedrock provider's resolveThinkingProfile only exposed off / minimal / low / medium / high for Claude 4.7 models. Native Anthropic supports two extra levels for Opus 4.7 (xhigh, adaptive), so Bedrock users couldn't access them from the OpenClaw model picker.

Fix

Detect Opus 4.7 model ids and append xhigh + adaptive to the levels list. Bedrock model ids for 4.7 take a few shapes — all matched by the new regex:

  • us.anthropic.claude-opus-4-7
  • us.anthropic.claude-opus-4.7-v1:0
  • eu.anthropic.claude-opus-4-7
  • inference-profile ARNs ending in claude-opus-4-7

defaultLevel stays undefined for 4.7 to mirror native Anthropic behaviour. Existing 4.6 adaptive default is preserved.

Tests

Added a new it("includes xhigh and adaptive for Claude Opus 4.7 Bedrock models", ...) covering all 4 id shapes. All 59 tests in extensions/amazon-bedrock pass:

✓ extensions/amazon-bedrock/index.test.ts (30 tests)
✓ extensions/amazon-bedrock/discovery.test.ts (16 tests)
✓ extensions/amazon-bedrock/memory-embedding-adapter.test.ts (4 tests)
✓ extensions/amazon-bedrock/config-compat.test.ts (2 tests)
✓ extensions/amazon-bedrock/embedding-provider.test.ts (5 tests)
✓ extensions/amazon-bedrock/lazy-import.test.ts (2 tests)

Test Files  6 passed (6)
     Tests  59 passed (59)

Signed-off-by: Sanjay Santhanam <[email protected]>

Changed files

  • extensions/amazon-bedrock/index.test.ts (modified, +21/-0)
  • extensions/amazon-bedrock/register.sync.runtime.ts (modified, +18/-11)

PR #74747: fix(amazon-bedrock): expose xhigh thinking level for Claude Opus 4.7 inference profiles

Description (problem / solution / changelog)

Problem

The Amazon Bedrock provider's resolveThinkingProfile does not expose the xhigh thinking level for Claude Opus 4.7 inference profiles (us.anthropic.claude-opus-4-7, eu.anthropic.claude-opus-4.7, etc.), so /think xhigh autocomplete is absent on Bedrock despite being available on the native Anthropic provider.

Fixes #74701.

Root cause

resolveThinkingProfile in register.sync.runtime.ts only checked for Claude 4.6 adaptive thinking models — the Opus 4.7 case was missing.

The SDK's resolveClaudeThinkingProfile helper cannot be reused here because it matches bare model IDs (claude-opus-4-7), not the region-prefixed Bedrock inference profile IDs (us.anthropic.claude-opus-4-7). The existing isOpus47BedrockModelRef predicate already handles the region-prefix pattern correctly.

Solution

Add the xhigh level to the Bedrock resolveThinkingProfile levels array when isOpus47BedrockModelRef matches, reusing the existing predicate rather than introducing a new one.

 ...(claude46ModelRe.test(modelId.trim()) ? [{ id: "adaptive" as const }] : []),
+...(isOpus47BedrockModelRef(modelId.trim()) ? [{ id: "xhigh" as const }] : []),

Tests

Added a dedicated test case verifying that us.anthropic.claude-opus-4-7, eu.anthropic.claude-opus-4.7, and ap.anthropic.claude-opus-4.7-20251101 expose xhigh, and that claude-opus-4-6 does not. All 30/30 existing tests continue to pass.

Changed files

  • CHANGELOG.md (modified, +1/-0)
  • extensions/amazon-bedrock/index.test.ts (modified, +20/-0)
  • extensions/amazon-bedrock/register.sync.runtime.ts (modified, +1/-0)

Code Example

resolveThinkingProfile: ({ modelId }) => ({
  levels: [
    { id: "off" },
    { id: "minimal" },
    { id: "low" },
    { id: "medium" },
    { id: "high" },
    ...claude46ModelRe.test(modelId.trim()) ? [{ id: "adaptive" }] : []
  ],
  defaultLevel: claude46ModelRe.test(modelId.trim()) ? "adaptive" : void 0
})

---

const pluginProfile = resolveProviderThinkingProfile({...});
if (pluginProfile) {
  const normalized = normalizeThinkingProfile(pluginProfile);
  if (normalized.levels.length > 0) return normalized; // ← returns before xhigh append
}

---

case "xhigh":
  if (isClaudeOpus47Model(modelId)) return "xhigh";
  return isClaudeOpus46Model(modelId) ? "max" : "high";

---

import {
  isClaudeOpus47ModelId,
  resolveClaudeThinkingProfile,
} from "openclaw/plugin-sdk/provider-model-shared";

resolveThinkingProfile: ({ modelId }) => resolveClaudeThinkingProfile({ modelId })
// or manually:
resolveThinkingProfile: ({ modelId }) => {
  const id = modelId.trim();
  const base = [{ id: "off" }, { id: "minimal" }, { id: "low" }, { id: "medium" }, { id: "high" }];
  if (isClaudeOpus47ModelId(id)) base.push({ id: "xhigh" });
  if (claude46ModelRe.test(id)) base.push({ id: "adaptive" });
  return {
    levels: base,
    defaultLevel: claude46ModelRe.test(id) ? "adaptive" : undefined,
  };
}
RAW_BUFFERClick to expand / collapse

Summary

The amazon-bedrock provider extension hard-codes resolveThinkingProfile and never advertises xhigh, even for Claude Opus 4.7 (where the downstream stream runtime already maps xhigh → xhigh). As a result, /think autocomplete on channels where the session is bound to a Bedrock Opus 4.7 model (e.g. amazon-bedrock/us.anthropic.claude-opus-4-7) is missing xhigh, while the same agent using openai/gpt-5.5 on another surface shows xhigh correctly.

The native anthropic extension does the right thing — it uses isClaudeOpus47ModelId(modelId) and includes xhigh (and adaptive) in the profile. Only the Bedrock path is out of sync.

Repro

  • OpenClaw 2026.4.26 (commit be8c246), installed via npm global.
  • Agent main bound to amazon-bedrock/us.anthropic.claude-opus-4-7 on Discord; same agent on Telegram is bound to openai/gpt-5.5.
  • In Discord /think → autocomplete shows: off, minimal, low, medium, high (no xhigh, no adaptive).
  • In Telegram /think → autocomplete shows: off, minimal, low, medium, high, xhigh.

Root cause

dist/extensions/amazon-bedrock/register.sync.runtime.js around line 247:

resolveThinkingProfile: ({ modelId }) => ({
  levels: [
    { id: "off" },
    { id: "minimal" },
    { id: "low" },
    { id: "medium" },
    { id: "high" },
    ...claude46ModelRe.test(modelId.trim()) ? [{ id: "adaptive" }] : []
  ],
  defaultLevel: claude46ModelRe.test(modelId.trim()) ? "adaptive" : void 0
})

No branch for Claude Opus 4.7 (us.anthropic.claude-opus-4-7 / us.anthropic.claude-opus-4.7), so the plugin omits xhigh. Also missing adaptive for sonnet-4-6/sonnet-4.6 (native Anthropic extension uses a broader supportsAdaptiveThinking matcher).

Upstream dispatcher in dist/thinking-DhTFkZJF.js (~line 308) early-returns once a plugin yields a non-empty profile, so the provider-level supportsXHighThinking hook never fires to append xhigh afterward:

const pluginProfile = resolveProviderThinkingProfile({...});
if (pluginProfile) {
  const normalized = normalizeThinkingProfile(pluginProfile);
  if (normalized.levels.length > 0) return normalized; // ← returns before xhigh append
}

Meanwhile downstream mapping is already wired for Bedrock+Opus 4.7 xhigh (dist/provider-stream-BtN3gEYv.js):

case "xhigh":
  if (isClaudeOpus47Model(modelId)) return "xhigh";
  return isClaudeOpus46Model(modelId) ? "max" : "high";

So the backend supports xhigh on Bedrock Opus 4.7 — only the profile exposure is missing.

Expected

resolveThinkingProfile for amazon-bedrock should mirror the native anthropic extension's logic:

  • Claude Opus 4.7 (us.anthropic.claude-opus-4-7 / ...4.7) → include xhigh.
  • Claude Opus 4.6 / Sonnet 4.6 → include adaptive (already partially handled via claude46ModelRe).
  • Ideally reuse resolveClaudeThinkingProfile / isClaudeOpus47ModelId from openclaw/plugin-sdk/provider-model-shared for consistency.

Suggested patch sketch

import {
  isClaudeOpus47ModelId,
  resolveClaudeThinkingProfile,
} from "openclaw/plugin-sdk/provider-model-shared";

resolveThinkingProfile: ({ modelId }) => resolveClaudeThinkingProfile({ modelId })
// or manually:
resolveThinkingProfile: ({ modelId }) => {
  const id = modelId.trim();
  const base = [{ id: "off" }, { id: "minimal" }, { id: "low" }, { id: "medium" }, { id: "high" }];
  if (isClaudeOpus47ModelId(id)) base.push({ id: "xhigh" });
  if (claude46ModelRe.test(id)) base.push({ id: "adaptive" });
  return {
    levels: base,
    defaultLevel: claude46ModelRe.test(id) ? "adaptive" : undefined,
  };
}

Workaround

Switch the affected session to openai/gpt-5.5 or direct anthropic/claude-opus-4-7 (non-Bedrock) — both expose xhigh via their own plugins.

Environment

  • OpenClaw: 2026.4.26 (be8c246), npm global install
  • Node: v25.9.0
  • OS: macOS Darwin 25.2.0 arm64
  • Provider: amazon-bedrock, region us-east-1, app inference profile us.anthropic.claude-opus-4-7

extent analysis

TL;DR

Update the resolveThinkingProfile function in the amazon-bedrock provider extension to include xhigh for Claude Opus 4.7 models.

Guidance

  • Identify the resolveThinkingProfile function in dist/extensions/amazon-bedrock/register.sync.runtime.js and update it to include xhigh for Claude Opus 4.7 models.
  • Consider reusing resolveClaudeThinkingProfile / isClaudeOpus47ModelId from openclaw/plugin-sdk/provider-model-shared for consistency.
  • Verify that the updated function correctly includes xhigh in the thinking profile for Claude Opus 4.7 models.
  • Test the updated function with different model IDs to ensure it works as expected.

Example

import {
  isClaudeOpus47ModelId,
  resolveClaudeThinkingProfile,
} from "openclaw/plugin-sdk/provider-model-shared";

resolveThinkingProfile: ({ modelId }) => resolveClaudeThinkingProfile({ modelId })

Alternatively, the function can be updated manually:

resolveThinkingProfile: ({ modelId }) => {
  const id = modelId.trim();
  const base = [{ id: "off" }, { id: "minimal" }, { id: "low" }, { id: "medium" }, { id: "high" }];
  if (isClaudeOpus47ModelId(id)) base.push({ id: "xhigh" });
  if (claude46ModelRe.test(id)) base.push({ id: "adaptive" });
  return {
    levels: base,
    defaultLevel: claude46ModelRe.test(id) ? "adaptive" : undefined,
  };
}

Notes

The suggested patch sketch provides a possible solution, but it may require further modifications to work correctly in the specific environment.

Recommendation

Apply the suggested patch to update the `resolveThinking

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING