chore(langchain): improve typing of agent decorators
by cbornet
·
Feb 06, 2026 at 19:31 UTC
·
scan-f13c611e8f057a10
Get this automatically on every PR
Install the Axiomo GitHub App to get Signals as check runs and PR comments on every pull request.
Risk level: Low (15%)
Improve typing of agent decorators in langchain.
Changes show adjustments to handle async typing correctly using new type aliases.
Diff removes protocol usage and introduces type aliases, aligning with open/close principle.
Diff shows deleted lines with unnecessary generics.
The changes use cast for complex unions where type narrowing was previously an issue.
Trusted contributor with 398 merged PRs. maintains 129 public repositories. has 177 followers.
Review 1 high-priority file(s)
libs/langchain_v1/langchain/agents/middleware/types.py
+173
173 lines changed; Source code
24
minutes to review
medium
effort level
none
staleness risk
Standard review process
Good evidence, acceptable risk, ready for merge
Why is security_scan_clean missing? Consider adding this check.
Why is coverage_maintained missing? Consider adding this check.