Skip to content

fix(langchain): Ensure no duplicate SentryLangchainCallback #4485

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: szokeasaurusrex/refactor-langchain-args
Choose a base branch
from

Conversation

szokeasaurusrex
Copy link
Member

Ensure that SentryLangchainCallback does not get added twice by also checking the inheritable_callbacks

Fixes #4443

@szokeasaurusrex szokeasaurusrex changed the title Szokeasaurusrex/fix-duplicate-langchain-callbacks fix(langchain): Ensure no duplicate SentryLangchainCallback Jun 17, 2025
Copy link

codecov bot commented Jun 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.68%. Comparing base (901b579) to head (ccdd82f).

❌ Unsupported file format

Upload processing failed due to unsupported file format. Please review the parser error message:

Error parsing JUnit XML in /home/runner/work/sentry-python/sentry-python/.junitxml at 1:6222

Caused by:
    RuntimeError: Error parsing XML
    
    Caused by:
        0: ill-formed document: close tag `</testsuite>` does not match any open tag
        1: close tag `</testsuite>` does not match any open tag

For more help, visit our troubleshooting guide.

Additional details and impacted files
@@                             Coverage Diff                             @@
##           szokeasaurusrex/refactor-langchain-args    #4485      +/-   ##
===========================================================================
+ Coverage                                    80.63%   80.68%   +0.04%     
===========================================================================
  Files                                          142      142              
  Lines                                        16037    16021      -16     
  Branches                                      2741     2741              
===========================================================================
- Hits                                         12932    12926       -6     
+ Misses                                        2239     2230       -9     
+ Partials                                       866      865       -1     
Files with missing lines Coverage Δ
sentry_sdk/integrations/langchain.py 71.55% <100.00%> (+1.11%) ⬆️

... and 6 files with indirect coverage changes

@szokeasaurusrex szokeasaurusrex force-pushed the szokeasaurusrex/refactor-langchain-args branch from 8adbbe7 to 901b579 Compare June 17, 2025 10:29
Ensure that `SentryLangchainCallback` does not get added twice by also checking the `inheritable_callbacks`

Fixes #4443
@szokeasaurusrex szokeasaurusrex force-pushed the szokeasaurusrex/fix-duplicate-langchain-callbacks branch from a42d29f to ccdd82f Compare June 17, 2025 10:29
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