You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR fixes blocking behavior when computing RunnableLambda.deps by avoiding inspect.getsource in nonlocal discovery. Dependencies are now determined from bytecode analysis, which removes file I/O from the deps path and improves performance in async contexts.
GAUTAM V DATLA (gautamvarmadatla)
changed the title
Fix #29530: remove blocking inspect.getsource from deps discovery
fix(core): avoid inspect.getsource in RunnableLambda.deps
Feb 15, 2026
No successful run was found on master (0081dea) during the generation of this report, so 7019269 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
core`langchain-core` package issues & PRsexternalfixFor PRs that implement a fix
1 participant
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes blocking behavior when computing
RunnableLambda.depsby avoidinginspect.getsourcein nonlocal discovery. Dependencies are now determined from bytecode analysis, which removes file I/O from the deps path and improves performance in async contexts.Fixes #29530
Verification
uv run python -m pytest tests/unit_tests/runnables -qand ruffRunnableLambda.depsdoes not callinspect.getsource.Breaking changes
None.
Benchmarks
I ran some benchmarks locally on both a baseline checkout and this branch.
Results
Baseline
This PR
TLDR;
getsource?goes from yes → no in all cases.Benchmark code
cc : Christophe Bornet (@cbornet) , Eugene Yurtsev (@eyurtsev)