Skip to content

fix(tests): update test_max_effort_rejected_for_opus_45 regex to match current error message#21666

Merged
jquinter merged 1 commit intomainfrom
fix/test-max-effort-error-message
Feb 20, 2026
Merged

fix(tests): update test_max_effort_rejected_for_opus_45 regex to match current error message#21666
jquinter merged 1 commit intomainfrom
fix/test-max-effort-error-message

Conversation

@jquinter
Copy link
Contributor

Summary

  • test_max_effort_rejected_for_opus_45 was failing because the production error message was expanded when Sonnet 4.6 was added as a supported model for effort='max'
  • Old message: "effort='max' is only supported by Claude Opus 4.6"
  • New message: "effort='max' is only supported by Claude 4.6 models (Opus 4.6, Sonnet 4.6). Got model: ..."
  • Updated the test's match= regex to "effort='max' is only supported by Claude 4.6 models" which matches the current message

Not related to PR #21664 (which only touches pricing JSON files).

Test plan

  • test_max_effort_rejected_for_opus_45 passes locally after fix

🤖 Generated with Claude Code

…h new error message

The production error message was expanded when Sonnet 4.6 was also added as
a supported model for effort='max'. The test's match regex still referenced
the old "Claude Opus 4.6"-only message; update it to match the new
"Claude 4.6 models" wording.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Feb 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
litellm Building Building Preview, Comment Feb 20, 2026 2:08pm

Request Review

@jquinter jquinter merged commit 8f5561c into main Feb 20, 2026
18 of 26 checks passed
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 20, 2026

Greptile Summary

Test-only fix: updates the match regex in test_max_effort_rejected_for_opus_45 from "effort='max' is only supported by Claude Opus 4.6" to "effort='max' is only supported by Claude 4.6 models" to match the current error message in litellm/llms/anthropic/chat/transformation.py:1374, which was expanded when Sonnet 4.6 was added as a supported model for effort='max'.

  • Updated pytest.raises match string to align with the current ValueError message format
  • No functional or production code changes
  • Test remains a pure unit test with no network calls

Confidence Score: 5/5

  • This PR is safe to merge — it is a minimal, correct test fix with no production code changes.
  • The PR changes a single regex string in one test file to match the current error message in production code. The change is verified correct against the source at transformation.py:1374. No production code is modified, no new tests are introduced, and the existing test logic is unchanged.
  • No files require special attention.

Important Files Changed

Filename Overview
tests/test_litellm/llms/anthropic/chat/test_anthropic_chat_transformation.py Updated pytest.raises match regex in test_max_effort_rejected_for_opus_45 to align with the expanded error message in transformation.py:1374. The new regex correctly matches the current production error message.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["transform_request called with<br/>model=claude-opus-4-5, effort='max'"] --> B{"Is effort == 'max'?"}
    B -->|Yes| C{"_is_claude_4_6_model(model)?"}
    C -->|No| D["Raise ValueError:<br/>effort='max' is only supported by<br/>Claude 4.6 models (Opus 4.6, Sonnet 4.6)"]
    C -->|Yes| E["Set output_config in request data"]
    B -->|No| E
    D --> F["pytest.raises catches ValueError"]
    F --> G["match regex validates error message:<br/>'effort=max is only supported by Claude 4.6 models'"]
Loading

Last reviewed commit: 963e0ea

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant