Skip to content

test(rust): model the blocking OCR hook as a guardrail so its raise propagates - #42775

Merged
yujonglee-berri merged 1 commit into
mainfrom
litellm_fix_ocr_blocking_hook_guardrail
Sep 23, 2026
Merged

yujonglee-berri merged 1 commit into
mainfrom
litellm_fix_ocr_blocking_hook_guardrail

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

TLDR

Problem this solves:

How it solves it:

  • The test's Block callback now subclasses CustomGuardrail
  • Its raise propagates again and reaches the failure callbacks as asserted

User Flow

Test-only change, no proxy behavior changes

Relevant issues

Follow-up to #42535. Unblocks the rust-wheel job on #42769 and every other PR

Affected release

Linear ticket

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have added meaningful tests
  • The handful of test files covering my change pass locally, e.g. uv run pytest tests/test_litellm/<your_test_file>.py -v. Leave the suites (make test-unit-*, make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or more
  • My PR passes all required CI/CD checks (e.g., lint, schema.d.ts sync check, etc.)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have received a Greptile Confidence Score of at least 4/5 before requesting a maintainer review (Greptile reviews automatically once the PR is opened; only comment @greptileai to re-request a review after pushing changes)

Screenshots / Proof of Fix

Test-only change. Before: rust-wheel on main run https://github.com/BerriAI/litellm/actions/runs/35881390552 fails with DID NOT RAISE Blocked. After: tests/test_litellm_rust/ocr/test_callbacks.py passes locally, 29 passed

Type

✅ Test

Caveats (if any)

Low

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

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

…ropagates

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

Copy link
Copy Markdown
Contributor Author

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 Sep 23, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge because the test fixture now matches the production distinction between blocking guardrails and non-blocking loggers

Summary

This test-only change updates the blocking OCR callback fixture to use the callback type whose exceptions intentionally abort completed requests

  • Imports CustomGuardrail for the OCR callback test
  • Models the raising callback as a guardrail so its exception reaches the failure callbacks
  • Leaves production behavior unchanged

Reviews (1) · Last reviewed commit: "test(rust): model the blocking OCR hook ..."

@codecov

codecov Bot commented Sep 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@yujonglee-berri
yujonglee-berri enabled auto-merge (squash) September 23, 2026 19:17
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