Skip to content

[Bug]: claude-opus-4-7 fails with "thinking.type.enabled is not supported" #11137

Description

@centripetal-star

Description

claude-opus-4-7 returns a 400 error because Hermes sends thinking: {type: "enabled", budget_tokens: N} which is not supported by this model. Opus 4-7 requires thinking: {type: "adaptive"} with output_config: {effort: ...} instead.

Error

BadRequestError [HTTP 400]
"thinking.type.enabled" is not supported for this model. Use "thinking.type.adaptive" and "output_config.effort" to control thinking behavior.

Root Cause

The fix from #1126 / PR #1128 hardcoded version checks for "4-6" and "4.6" only in _supports_adaptive_thinking():

def _supports_adaptive_thinking(model):
    return any(v in model for v in ("4-6", "4.6"))

claude-opus-4-7 doesn't match, so it falls through to the old code path that sends thinking: {type: "enabled"}.

The _ANTHROPIC_OUTPUT_LIMITS dict also has no entry for claude-opus-4-7.

Suggested Fix

  1. Update _supports_adaptive_thinking() to also match "4-7" / "4.7" (or ideally use a >= comparison to future-proof).
  2. Add claude-opus-4-7 to _ANTHROPIC_OUTPUT_LIMITS.
  3. Note: opus 4-7 also removes support for temperature, top_p, and top_k parameters entirely (400 errors). These may need to be stripped as well.

Additional Opus 4-7 API Changes

  • thinking.type must be "adaptive" (both "enabled" and "disabled" return 400)
  • budget_tokens replaced by output_config.effort (low / medium / high / xhigh / max)
  • "xhigh" effort level is new and exclusive to opus 4-7
  • max_tokens now covers both thinking + response output
  • New tokenizer uses 1x-1.35x more tokens

Environment

  • Hermes Agent (latest from main)
  • Provider: Anthropic (direct API)
  • Model: claude-opus-4-7

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions