Skip to content

remove test

f12b7d3
Select commit
Loading
Failed to load commit list.
Merged

feat(litellm): Add async callbacks #5969

remove test
f12b7d3
Select commit
Loading
Failed to load commit list.
@sentry/warden / warden: find-bugs completed Apr 13, 2026 in 6m 19s

2 issues

find-bugs: Found 2 issues (2 medium)

Medium

Missing async failure callback may cause async failures to not be captured - `sentry_sdk/integrations/litellm.py:241-252`

The PR adds _async_input_callback and _async_success_callback for async litellm operations but does not add a corresponding _async_failure_callback. If litellm invokes async callbacks for failure scenarios when using acompletion() or aembedding(), exceptions may not be properly captured and spans may not be closed. The existing tests test_async_exception_handling pass, suggesting the sync callback may still be called, but this creates an inconsistency in the callback registration pattern.

test_async_exception_handling patches wrong client endpoint (embeddings instead of completions) - `tests/integrations/litellm/test_litellm.py:869-872`

The async test patches client.embeddings._client._client but calls litellm.acompletion(), which uses the completions endpoint. The sync version test_exception_handling correctly patches client.completions._client._client. This copy-paste error means the mock may not intercept the request properly, potentially causing the test to pass incorrectly or behave inconsistently.


Duration: 6m 16s · Tokens: 3.2M in / 25.8k out · Cost: $5.54 (+merge: $0.00)

Annotations

Check warning on line 252 in sentry_sdk/integrations/litellm.py

See this annotation in the file changed.

@sentry-warden sentry-warden / warden: find-bugs

Missing async failure callback may cause async failures to not be captured

The PR adds `_async_input_callback` and `_async_success_callback` for async litellm operations but does not add a corresponding `_async_failure_callback`. If litellm invokes async callbacks for failure scenarios when using `acompletion()` or `aembedding()`, exceptions may not be properly captured and spans may not be closed. The existing tests `test_async_exception_handling` pass, suggesting the sync callback may still be called, but this creates an inconsistency in the callback registration pattern.

Check warning on line 872 in tests/integrations/litellm/test_litellm.py

See this annotation in the file changed.

@sentry-warden sentry-warden / warden: find-bugs

test_async_exception_handling patches wrong client endpoint (embeddings instead of completions)

The async test patches `client.embeddings._client._client` but calls `litellm.acompletion()`, which uses the completions endpoint. The sync version `test_exception_handling` correctly patches `client.completions._client._client`. This copy-paste error means the mock may not intercept the request properly, potentially causing the test to pass incorrectly or behave inconsistently.