feat: support state updates from `wrap_model_call` with command(s)
by sydney-runkle
·
Feb 06, 2026 at 19:27 UTC
·
scan-2b341c69bede409e
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: High (65%)
Support state updates from wrap_model_call with Command for middleware.
libs/langchain_v1/langchain/agents/middleware/types.py adds ExtendedModelResponse dataclass.
libs/langchain_v1/tests/unit_tests/agents/middleware/core/test_wrap_model_call_state_update.py has tests for composition.
PR description notes backwards compatibility and the diff does not alter existing middleware.
Details are mentioned in the PR, but evidence in diff is limited.
Trusted contributor with 167 merged PRs. has 518 followers. unfamiliar with 2 files.
Focus on 1 critical file(s)
libs/langchain_v1/tests/unit_tests/agents/middleware/core/test_wrap_model_call_state_update.py
+917
917 lines changed; New file; Source code
libs/langchain_v1/langchain/agents/factory.py
+354
354 lines changed; Source code
libs/langchain_v1/tests/unit_tests/agents/middleware/core/test_composition.py
+71
71 lines changed; Source code
libs/langchain_v1/langchain/agents/middleware/types.py
+42
Source code
libs/langchain_v1/langchain/agents/middleware/__init__.py
+4
Source code
libs/langchain/tests/unit_tests/chat_models/test_base.py
+1
Source code
libs/langchain_v1/tests/unit_tests/chat_models/test_chat_models.py
+1
Source code
libs/langchain_v1/pyproject.toml
+1
Configuration
165
minutes to review
extensive
effort level
none
staleness risk
Schedule dedicated review time; consider pair review
Good evidence, acceptable risk, ready for merge
Consider breaking into smaller PRs
Why is coverage_maintained missing? Consider adding this check.
libs/langchain_v1/tests/unit_tests/agents/middleware/core/test_wrap_model_call_state_update.py
Critical file: 917 lines changed; New file; Source code