Skip to content

test(integration): expect signed empty thinking blocks to survive /v1/messages replay after #41362 - #46686

Merged
mateo-berri merged 1 commit into
mainfrom
litellm_circleci_heal_signed_empty_thinking
Oct 15, 2026
Merged

mateo-berri merged 1 commit into
mainfrom
litellm_circleci_heal_signed_empty_thinking

Conversation

@mateo-berri

@mateo-berri mateo-berri commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

TLDR

Problem this solves:

How it solves it:

User Flow

Before: CircleCI on main fails integration-providers on a test that still pins pre-#41362 behavior

  1. A scheduled integration workflow runs on main, for example [job 2260319]([REDACTED SECRET]/gh/BerriAI/litellm/2260319) at 2026-10-15 08:09 UTC
  2. test_thinking_history_keeps_only_blocks_anthropic_can_verify[empty-thinking-stripped-redacted-thinking-kept] fails because the proxy now forwards the signed empty thinking block

After: the same test asserts the behavior #41362 intended, and the unsigned strip stays covered

  1. The same workflow runs on this branch, pipeline 91263
  2. [signed-empty-thinking-and-redacted-thinking-kept] and [unsigned-empty-thinking-stripped-redacted-thinking-kept] both pass in [integration-providers job 2260527]([REDACTED SECRET]/gh/BerriAI/litellm/2260527), with the rest of that job's reds matching main. Failed jobs rerun in workflow fb9b7026 to clear an apk fetch error and one replica flake

Details

Failing test id on main: tests/integration/messages_endpoint/providers/anthropic/reasoning/test_anthropic_reasoning_request_translation_wire.py::test_thinking_history_keeps_only_blocks_anthropic_can_verify[empty-thinking-stripped-redacted-thinking-kept]

It passed through [job 2260273]([REDACTED SECRET]/gh/BerriAI/litellm/2260273) at 1a9fa70 and has failed since [job 2260286]([REDACTED SECRET]/gh/BerriAI/litellm/2260286) at 4496fe0. The only anthropic change in that range is 897bfea (#41362), which makes strip_empty_content_blocks_from_anthropic_messages drop a thinking block only when it is empty and unsigned. The test param sends {"type": "thinking", "thinking": "", "signature": "EqQB..."}, which is signed, so the expectation pinned the old behavior. Production code is unchanged

Mutation checks: making the sanitizer drop every empty thinking block fails the signed case, and making it never drop empty thinking blocks fails the unsigned case

Deferred, each red on main and left for its own fix or next run:

integration-providers stays red on this branch until those land, so the claim here is the one test id above passing on the PR pipeline

Pre-Submission checklist

  • I have added meaningful tests
  • The handful of test files covering my change pass locally
  • My PR passes all required CI/CD checks
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • Every automated review on my PR's latest commit has finished, and I have addressed or replied to each of its findings before requesting a maintainer review

Type

✅ Test

Final Attestation

  • The tests check the right things, including the edge cases, and regressions in the respective real-world customer use-cases are not possible after this PR

  • 29dbe71 passes /live-pr-risk

Link to Devin session: https://app.devin.ai/sessions/5b80f19bc3ca4f5793821b6353f3fef4
Open in Devin Desktop: https://app.devin.ai/desktop/session/5b80f19bc3ca4f5793821b6353f3fef4?variant=devin
Requested by: @mateo-berri


Note

Low Risk
Test-only change to integration expectations; no runtime or security impact.

Overview
Updates integration wire expectations for test_thinking_history_keeps_only_blocks_anthropic_can_verify so they match behavior from #41362: signed empty thinking blocks are forwarded on /v1/messages replay, while unsigned empty thinking blocks are still stripped.

The former empty-thinking-stripped-redacted-thinking-kept case is split into signed-empty-thinking-and-redacted-thinking-kept (expects the signed empty block plus redacted_thinking to survive) and unsigned-empty-thinking-stripped-redacted-thinking-kept (expects only redacted_thinking and tool_use upstream). No production code changes—this fixes a stale test that was failing integration-providers on main.

Reviewed by Cursor Bugbot for commit 29dbe71. Bugbot is set up for automated code reviews on this repo. Configure here.

…/messages replay after #41362

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@greptile-apps

greptile-apps Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Automatic reviews are disabled for this repository.

@mateo-berri

Copy link
Copy Markdown
Contributor Author

bugbot run

@mateo-berri

Copy link
Copy Markdown
Contributor Author

@litereview code-review

@cursor cursor Bot left a comment

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.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 29dbe71. Configure here.

@litereview

litereview Bot commented Oct 15, 2026

Copy link
Copy Markdown

✅ code-review

5/5 · Ready for human review

Scope: full · Full PR review.

Completed · Some checks not run.

No correctness findings.

Checks and execution details
  • Passed · Real testing evidence (required): Not applicable: no LLM translation changes in the scoped paths. The PR only edits tests/integration/messages_endpoint/providers/anthropic/reasoning/test_anthropic_reasoning_request_translation_wire.py. It changes nothing under litellm/llms/** or litellm/litellm_core_utils/prompt_templates/**.

  • Passed · Sanitizer behavior matches new expectations (optional): After uv sync --frozen, I called strip_empty_content_blocks_from_anthropic_messages directly (litellm/llms/anthropic/common_utils.py:1699).

  • {"type":"thinking","thinking":"","signature":"EqQ"} was kept along with redacted_thinking and tool_use.

  • {"type":"thinking","thinking":""} was dropped, and the other two blocks were kept.

This matches the signed-empty-thinking-and-redacted-thinking-kept and unsigned-empty-thinking-stripped-redacted-thinking-kept params.

  • Not run · Gateway integration test run (optional): I did not run it locally. It needs the CircleCI-owned Postgres, Redis, proxy and upstream harness (tests/integration/run.py providers). The PR cites CircleCI pipeline 91263 as showing both params passing.

View review · Reviewed 29dbe71c0b8d

@codecov

codecov Bot commented Oct 15, 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

Copy link
Copy Markdown
Contributor Author

@litellm-stampbot

@mateo-berri
mateo-berri enabled auto-merge (squash) October 15, 2026 16:06
@litellm-stampbot

Copy link
Copy Markdown

litellm-stampbot: risk low

Approved at 29dbe71.

Rules (stampbot/risk_rules.yml):

  • low: no rule flagged it

Judge (gpt-6-luna): low, probability of high 0.00 (high at or above 0.90)

  • risk: low (probability of high 0.00)

Pushes do not re-run this check. Comment @litellm-stampbot again to re-check the new head.

@litellm-stampbot litellm-stampbot Bot added the risk:low Small, isolated, low-risk change label Oct 15, 2026

@kerry-berri kerry-berri left a comment

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.

Low risk by rule and by judgement at 29dbe71

@mateo-berri
mateo-berri merged commit 8fb6fee into main Oct 15, 2026
112 of 117 checks passed
@mateo-berri
mateo-berri deleted the litellm_circleci_heal_signed_empty_thinking branch October 15, 2026 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:low Small, isolated, low-risk change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants