Skip to content

test(reasoning-effort-grid): cover Claude Opus 4.8 across provider routes#29327

Merged
mateo-berri merged 4 commits into
litellm_internal_stagingfrom
litellm_opus_4_8_effort_grid
May 30, 2026
Merged

test(reasoning-effort-grid): cover Claude Opus 4.8 across provider routes#29327
mateo-berri merged 4 commits into
litellm_internal_stagingfrom
litellm_opus_4_8_effort_grid

Conversation

@mateo-berri

@mateo-berri mateo-berri commented May 30, 2026

Copy link
Copy Markdown
Collaborator

Relevant issues

Claude Opus 4.8 shipped with cost-map entries (Anthropic, Bedrock converse and regional, Vertex, Azure AI) and a dedicated config regression test (tests/test_litellm/test_claude_opus_4_8_config.py), but the real-API reasoning effort grid that runs in the llm_translation_testing CircleCI job still topped out at Opus 4.7. This adds Opus 4.8 to that grid so the new flagship's reasoning_effort to wire-body translation is exercised the same way every prior generation is.

Linear ticket

Pre-Submission checklist

  • I have added meaningful tests
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have requested a Greptile review by commenting @greptileai and received a Confidence Score of at least 4/5 before requesting a maintainer review

Changes

Opus 4.8 was added as the newest flagship to the four routes that track the flagship Opus (anthropic_direct, azure_ai, vertex_ai, bedrock_converse), keeping the existing 4.7 and 4.6 entries. The Bedrock invoke routes were left untouched since they do not track the flagship (they carry no 4.7 entry either).

Opus 4.8 shares Opus 4.7's effort tier exactly: adaptive thinking with native xhigh and max support. The shared capability constant was renamed from _CAPS_OPUS_4_7 to _CAPS_XHIGH_MAX because it now spans two generations and a single model-version name was misleading. On Bedrock the new cell carries bedrock_effort_ceiling="xhigh", matching the model's bedrock_output_config_effort_ceiling in the cost map.

The grid cell-count assertion moved from 21x11 to 25x11 (231 to 275 cells) to reflect the four new model combinations.

Availability guards: the Anthropic direct cells run live. The Bedrock Opus 4.8 cell reuses the self-heal path introduced in the base PR #29344: it runs the call and skips only when Bedrock replies "is not available for this account" (the new model needs an AWS Sales entitlement request), and the moment access lands it asserts the wire body in full with no edit. The Azure and Vertex Opus 4.8 cells stay on an xfail fail_reason: the Microsoft Foundry resource returns DeploymentNotFound until someone creates the claude-opus-4-8 deployment, and Vertex availability on the CI project is not yet confirmed for this brand-new release. Each fail_reason documents the condition to remove it, and because xfail_strict is not set these guards never flip CI red.

Screenshots / Proof of Fix

The new Anthropic direct Opus 4.8 cells were run against the real Anthropic API (all eleven efforts, real spend):

$ uv run --no-sync python -m pytest \
    "tests/llm_translation/reasoning_effort_grid/test_reasoning_effort_grid.py::test_reasoning_effort_grid" \
    -k "anthropic_direct and opus-4-8" -p no:randomly -q
...........                                                              [100%]
11 passed in 25.70s

The Azure Opus 4.8 cells correctly xfail (rather than going red) while the deployment is missing, and the structural assertions pass:

$ uv run --no-sync python -m pytest \
    "tests/llm_translation/reasoning_effort_grid/test_reasoning_effort_grid.py" \
    -k "(azure_ai and opus-4-8) or test_grid_cell_count or test_grid_route_coverage" -p no:randomly -q -rX
..xxxxxxxxxxx                                                            [100%]
2 passed, 11 xfailed

Type

✅ Test

@codecov

codecov Bot commented May 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@mateo-berri mateo-berri marked this pull request as ready for review May 30, 2026 14:40
@greptile-apps

greptile-apps Bot commented May 30, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This test-only PR extends the reasoning_effort grid by adding claude-opus-4-8 to the four flagship-tracking routes (Anthropic direct, Azure AI, Vertex AI, Bedrock Converse), keeping Azure/Vertex/Bedrock cells under xfail guards until entitlements or deployments land. The shared capability constant is also renamed from _CAPS_OPUS_4_7 to _CAPS_XHIGH_MAX to reflect that it now covers two generations.

  • Four new ModelEntry objects added to ANTHROPIC_DIRECT_MODELS, AZURE_AI_MODELS, VERTEX_AI_MODELS, and BEDROCK_CONVERSE_MODELS; the Anthropic direct cells were validated against the real API (11 passes, confirmed in the PR description).
  • The grid cell-count assertion is updated from 21×11 (231) to 25×11 (275), correctly reflecting the four additional model entries across eleven effort tiers.

Confidence Score: 4/5

Safe to merge — changes are confined to test infrastructure with no production code affected.

The Bedrock Opus 4.8 entry sets bedrock_effort_ceiling="xhigh" while the structurally identical Opus 4.7 entry leaves that field unset. This has no clamping effect today, and both entries are xfail, so tests are unaffected. Still, the structural divergence between two entries described as capability-equivalent is worth resolving before either xfail guard is removed.

tests/llm_translation/reasoning_effort_grid/grid_spec.py — the Bedrock Opus 4.7 and 4.8 entries differ in bedrock_effort_ceiling despite identical stated capabilities.

Important Files Changed

Filename Overview
tests/llm_translation/reasoning_effort_grid/grid_spec.py Adds claude-opus-4-8 entries to four route tuples and renames _CAPS_OPUS_4_7 → _CAPS_XHIGH_MAX; Bedrock Opus 4.8 sets bedrock_effort_ceiling="xhigh" while the Bedrock Opus 4.7 entry (same capabilities) leaves the field unset — a minor inconsistency with no runtime impact since both are xfail.
tests/llm_translation/reasoning_effort_grid/test_reasoning_effort_grid.py Updates cell-count assertion from 21×11 (231) to 25×11 (275) to account for the four new model entries; no other logic changes.

Reviews (1): Last reviewed commit: "test(reasoning-effort-grid): add claude-..." | Re-trigger Greptile

Comment on lines 263 to +278
BEDROCK_CONVERSE_MODELS: Tuple[ModelEntry, ...] = (
ModelEntry(
alias="bedrock-claude-opus-4-8",
model="bedrock/converse/us.anthropic.claude-opus-4-8",
mode="adaptive",
extra_params=(("aws_region_name", "us-east-1"),),
required_env=_BEDROCK_REQ,
caps=_CAPS_XHIGH_MAX,
bedrock_effort_ceiling="xhigh",
fail_reason=(
"claude-opus-4-8 is not entitled on the Bedrock CI account "
"941277531214 (model access requires an AWS Sales request, not "
"self-serve); this cell fails on purpose so it stays loud in CI — "
"remove this fail_reason once access is granted"
),
),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Inconsistent bedrock_effort_ceiling between Opus 4.7 and 4.8

The new Bedrock Opus 4.8 entry sets bedrock_effort_ceiling="xhigh", but the Bedrock Opus 4.7 entry (lines 279–292) leaves the field unset — even though the PR description states they share the exact same Bedrock effort tier. Because _EFFORT_RANK["xhigh"] = 4 is the highest rank in the spec (all other adaptive efforts rank ≤ 3), setting the ceiling to "xhigh" has no clamping effect today; both entries produce identical CellExpectation values. The inconsistency is harmless at runtime (both are xfail), but a future maintainer removing the Opus 4.7 fail_reason would see the two entries differ structurally with no explanation. Consider either adding bedrock_effort_ceiling="xhigh" to the Opus 4.7 entry for symmetry, or adding an inline comment explaining why they differ.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@krrish-berri-2

Copy link
Copy Markdown
Contributor

@mateo-berri — could you add a screenshot or short video showing the new reasoning-effort-grid tests running green locally (or pasted output of the test run for Claude Opus 4.8 across providers)? Visual proof really speeds up review. Thanks!

@mateo-berri

mateo-berri commented May 30, 2026

Copy link
Copy Markdown
Collaborator Author

Here is the local run for the new Claude Opus 4.8 grid cells.

The Anthropic direct route is exercised against the real Anthropic API (all 11 effort tiers, real spend):

$ uv run --no-sync python -m pytest \
    "tests/llm_translation/reasoning_effort_grid/test_reasoning_effort_grid.py::test_reasoning_effort_grid" \
    -k "anthropic_direct and opus-4-8" -p no:randomly -v

tests/.../test_reasoning_effort_grid[anthropic_direct-claude-opus-4-8-__omit__]   PASSED [  9%]
tests/.../test_reasoning_effort_grid[anthropic_direct-claude-opus-4-8-__empty__]  PASSED [ 18%]
tests/.../test_reasoning_effort_grid[anthropic_direct-claude-opus-4-8-disabled]   PASSED [ 27%]
tests/.../test_reasoning_effort_grid[anthropic_direct-claude-opus-4-8-high]       PASSED [ 36%]
tests/.../test_reasoning_effort_grid[anthropic_direct-claude-opus-4-8-invalid]    PASSED [ 45%]
tests/.../test_reasoning_effort_grid[anthropic_direct-claude-opus-4-8-low]        PASSED [ 54%]
tests/.../test_reasoning_effort_grid[anthropic_direct-claude-opus-4-8-max]        PASSED [ 63%]
tests/.../test_reasoning_effort_grid[anthropic_direct-claude-opus-4-8-medium]     PASSED [ 72%]
tests/.../test_reasoning_effort_grid[anthropic_direct-claude-opus-4-8-minimal]    PASSED [ 81%]
tests/.../test_reasoning_effort_grid[anthropic_direct-claude-opus-4-8-none]       PASSED [ 90%]
tests/.../test_reasoning_effort_grid[anthropic_direct-claude-opus-4-8-xhigh]      PASSED [100%]

11 passed, 264 deselected in 25.60s

The Azure, Vertex, and Bedrock Opus 4.8 cells are guarded with xfail until the model is provisioned on those CI accounts (the Azure Foundry resource returns DeploymentNotFound for claude-opus-4-8 today, Bedrock needs an entitlement request, and Vertex availability is unconfirmed). Each guard has a comment telling maintainers to remove it once the deployment or entitlement lands. Here are the Azure cells xfailing cleanly alongside the structural grid assertions, so nothing goes red:

$ uv run --no-sync python -m pytest \
    "tests/llm_translation/reasoning_effort_grid/test_reasoning_effort_grid.py" \
    -k "(azure_ai and opus-4-8) or test_grid_cell_count or test_grid_route_coverage" \
    -p no:randomly -q -rX

2 passed, 264 deselected, 11 xfailed in 0.56s

The two passing tests there are test_grid_cell_count (now asserting 25x11 = 275 cells) and test_grid_route_coverage. CircleCI llm_translation_testing on this PR runs the full grid the same way.

…edaction

PR #28909 hardened log_db_metrics to emit a minimal, non-sensitive
event_metadata (only table_name when present, otherwise None) instead of
dumping function_name, function_kwargs, and function_args onto the span. The
test in test_log_db_redis_services was not updated and still asserted
"function_name" in event_metadata, which raised TypeError (argument of type
'NoneType' is not iterable) and turned the logging_testing CI job red on
litellm_internal_staging.

Update test_log_db_metrics_success to assert event_metadata is None when no
table_name is passed, and add test_log_db_metrics_event_metadata_is_safe as a
regression guard verifying that only the table name surfaces and that sensitive
kwargs (tokens, prisma client) are never dumped.
@mateo-berri mateo-berri force-pushed the litellm_opus_4_8_effort_grid branch from 90eb34d to 15747ad Compare May 30, 2026 19:21
@mateo-berri mateo-berri changed the base branch from litellm_internal_staging to claude/focused-allen-QifiT May 30, 2026 19:22
@mateo-berri mateo-berri changed the base branch from claude/focused-allen-QifiT to litellm_fix_staging_ci May 30, 2026 19:30
The bedrock-claude-opus-4-7 converse cells are unentitled on the Bedrock CI
account, so they were marked xfail. xfail keeps reporting them as expected
failures even after access is granted, so the wire translation never gets
verified again. Now the cell makes the call and skips only when Bedrock
replies "is not available for this account"; the moment the model is
entitled the same cells run their full assertions with no edit.

A focused unit test pins the tolerance predicate so any other failure still
surfaces loudly and the available path still runs the assertions.
@mateo-berri mateo-berri force-pushed the litellm_fix_staging_ci branch from 96dc86c to 1015f9e Compare May 30, 2026 19:52
Adds claude-opus-4-8 to the anthropic, azure, vertex and bedrock-converse
routes (275 cells total) so the reasoning-effort wire translation is
covered for the new model. The bedrock opus-4-8 and opus-4-7 cells reuse
the self-heal path: they run the call and skip only on Bedrock's "is not
available for this account" reply, then assert in full once the model is
entitled. The azure and vertex opus-4-8 cells stay xfail until a Foundry
deployment exists and Vertex availability is confirmed. The shared
xhigh+max capability set is renamed to _CAPS_XHIGH_MAX now that more than
one model uses it.
@mateo-berri mateo-berri force-pushed the litellm_opus_4_8_effort_grid branch from 15747ad to 5ce9259 Compare May 30, 2026 19:57
@mateo-berri mateo-berri changed the base branch from litellm_fix_staging_ci to litellm_internal_staging May 30, 2026 20:57
…itellm_opus_4_8_effort_grid

# Conflicts:
#	tests/llm_translation/reasoning_effort_grid/grid_spec.py
@mateo-berri mateo-berri enabled auto-merge (squash) May 30, 2026 21:03
@mateo-berri mateo-berri merged commit 152b117 into litellm_internal_staging May 30, 2026
117 of 119 checks passed
fzowl pushed a commit to fzowl/litellm that referenced this pull request Jun 24, 2026
…utes (BerriAI#29327)

* test(logging): align DB metrics event_metadata assertions with safe redaction

PR BerriAI#28909 hardened log_db_metrics to emit a minimal, non-sensitive
event_metadata (only table_name when present, otherwise None) instead of
dumping function_name, function_kwargs, and function_args onto the span. The
test in test_log_db_redis_services was not updated and still asserted
"function_name" in event_metadata, which raised TypeError (argument of type
'NoneType' is not iterable) and turned the logging_testing CI job red on
litellm_internal_staging.

Update test_log_db_metrics_success to assert event_metadata is None when no
table_name is passed, and add test_log_db_metrics_event_metadata_is_safe as a
regression guard verifying that only the table name surfaces and that sensitive
kwargs (tokens, prisma client) are never dumped.

* test(bedrock): self-heal opus-4-7 grid cells when unentitled on CI

The bedrock-claude-opus-4-7 converse cells are unentitled on the Bedrock CI
account, so they were marked xfail. xfail keeps reporting them as expected
failures even after access is granted, so the wire translation never gets
verified again. Now the cell makes the call and skips only when Bedrock
replies "is not available for this account"; the moment the model is
entitled the same cells run their full assertions with no edit.

A focused unit test pins the tolerance predicate so any other failure still
surfaces loudly and the available path still runs the assertions.

* test(reasoning-effort-grid): add claude-opus-4-8 across provider routes

Adds claude-opus-4-8 to the anthropic, azure, vertex and bedrock-converse
routes (275 cells total) so the reasoning-effort wire translation is
covered for the new model. The bedrock opus-4-8 and opus-4-7 cells reuse
the self-heal path: they run the call and skip only on Bedrock's "is not
available for this account" reply, then assert in full once the model is
entitled. The azure and vertex opus-4-8 cells stay xfail until a Foundry
deployment exists and Vertex availability is confirmed. The shared
xhigh+max capability set is renamed to _CAPS_XHIGH_MAX now that more than
one model uses it.
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.

3 participants