openclaw - 💡(How to fix) Fix Custom anthropic-messages providers missing Claude thinking profiles (adaptive/max) [1 comments, 2 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#84349Fetched 2026-05-20 03:41:15
View on GitHub
Comments
1
Participants
2
Timeline
8
Reactions
1
Timeline (top)
labeled ×7commented ×1

Root Cause

The root cause is that resolveThinkingProfile() in thinking-*.js only gets the Claude-specific profile when the bundled anthropic plugin registers resolveThinkingProfile as a provider hook. Custom providers with api: "anthropic-messages" get the correct transport format but never hit this hook — they fall through to buildBaseThinkingProfile() which only includes off/minimal/low/medium/high.

Code Example

// After pluginProfile check fails:
const _claudeProfile = resolveClaudeThinkingProfile(context.modelId);
if (_claudeProfile && _claudeProfile.levels && _claudeProfile.levels.length > 0) {
    return normalizeThinkingProfile(_claudeProfile);
}

---

if (isClaudeAdaptiveThinkingDefaultModelId(modelId)) return {
    levels: [...BASE_CLAUDE_THINKING_LEVELS, { id: "adaptive" }, { id: "max" }],
    defaultLevel: "adaptive"
};
RAW_BUFFERClick to expand / collapse

Custom anthropic-messages providers don't get Claude thinking profiles

Problem

Custom providers configured with api: "anthropic-messages" (e.g. proxied through LiteLLM, Bifrost, or any Anthropic-compatible gateway) don't receive the Claude thinking profile from resolveClaudeThinkingProfile. This means:

  • /think adaptive is rejected with "Use one of: off, minimal, low, medium, high"
  • /think max is rejected on Sonnet 4.6 and Opus 4.6
  • The thinkingDefault: "adaptive" agent config silently downgrades to medium

The root cause is that resolveThinkingProfile() in thinking-*.js only gets the Claude-specific profile when the bundled anthropic plugin registers resolveThinkingProfile as a provider hook. Custom providers with api: "anthropic-messages" get the correct transport format but never hit this hook — they fall through to buildBaseThinkingProfile() which only includes off/minimal/low/medium/high.

Who this affects

Anyone routing Claude through a proxy or custom endpoint:

  • Bifrost (baseUrl: "http://proxy:4000/anthropic")
  • LiteLLM
  • AWS Bedrock via custom provider (not the bundled bedrock plugin)
  • Any anthropic-messages API-compatible gateway

Suggested fix

In resolveThinkingProfile(), after the plugin hook returns nothing, check if the model ID matches a known Claude model and call resolveClaudeThinkingProfile() as a fallback:

// After pluginProfile check fails:
const _claudeProfile = resolveClaudeThinkingProfile(context.modelId);
if (_claudeProfile && _claudeProfile.levels && _claudeProfile.levels.length > 0) {
    return normalizeThinkingProfile(_claudeProfile);
}

resolveClaudeThinkingProfile already exists in provider-model-shared and correctly handles all Claude model families — it just isn't called for custom providers.

Second issue: max effort missing for Sonnet 4.6 / Opus 4.6

resolveClaudeThinkingProfile returns [...BASE_CLAUDE_THINKING_LEVELS, { id: "adaptive" }] for the CLAUDE_ADAPTIVE_THINKING_DEFAULT_MODEL_PREFIXES family (Sonnet 4.6, Opus 4.6), but Anthropic's docs explicitly state these models support max effort:

The effort parameter supports effort levels: low, medium, and high. For Opus 4.7, Opus 4.6, and Sonnet 4.6, the parameter also supports max effort level. Use this parameter with or without enabling thinking.

Source: Azure AI Foundry / Anthropic docs and Anthropic API docs

The fix is to add { id: "max" } to the levels array for the adaptive-default model family:

if (isClaudeAdaptiveThinkingDefaultModelId(modelId)) return {
    levels: [...BASE_CLAUDE_THINKING_LEVELS, { id: "adaptive" }, { id: "max" }],
    defaultLevel: "adaptive"
};

Environment

  • OpenClaw 2026.5.18
  • Custom provider with api: "anthropic-messages", baseUrl pointing at Bifrost proxy
  • Models: claude-sonnet-4-6, claude-opus-4-6 via proxy

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

openclaw - 💡(How to fix) Fix Custom anthropic-messages providers missing Claude thinking profiles (adaptive/max) [1 comments, 2 participants]