The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
docs: update OpenWiki (#41326)
github-actions[bot]eb55b8f1ec4d
diff --git a/openwiki/.claims/agent-execution.json b/openwiki/.claims/agent-execution.jsonindex fff64734e3..b73ec61541 100644--- a/openwiki/.claims/agent-execution.json+++ b/openwiki/.claims/agent-execution.json@@ -1,6 +1,6 @@{"schemaVersion": 1,- "pageVersion": "sha256:c36ed3bfa6acfdaf33179bd7cf4a4811864ccff80181c5c88b46227be3eacc14",+ "pageVersion": "sha256:92e1659edb1431caa7488ed87852baf133c4e28a0c60dc030f37d14183bfcc34","claims": [{"id": "claim_601f8ad960a04f2195c35dab22235db1",@@ -251,6 +251,6 @@],"verification": {"by": "openwiki/0.5.0",- "at": "2026-09-28T08:35:20.640Z"+ "at": "2026-10-20T08:25:57.412Z"}}diff --git a/openwiki/.claims/agent-factory.json b/openwiki/.claims/agent-factory.jsonindex 79c53c54fd..80e1818188 100644--- a/openwiki/.claims/agent-factory.json+++ b/openwiki/.claims/agent-factory.json@@ -1,6 +1,6 @@{"schemaVersion": 1,- "pageVersion": "sha256:a04138ae1db4de18f11689760a882c8412eab3e79b77dcabedd87303f75ae572",+ "pageVersion": "sha256:05ec9cf83d64fd275b2a0e1adba90063fa3b558ef7819d365e213c5c671b0e3d","claims": [{"id": "claim_0d3a898647bd4d1d9c08eb386919394b",@@ -225,6 +225,6 @@],"verification": {"by": "openwiki/0.5.0",- "at": "2026-09-28T08:35:20.640Z"+ "at": "2026-10-20T08:25:57.412Z"}}diff --git a/openwiki/.claims/architecture.json b/openwiki/.claims/architecture.jsonindex 305577c3cd..1a4a87e52e 100644--- a/openwiki/.claims/architecture.json+++ b/openwiki/.claims/architecture.json@@ -1,6 +1,6 @@{"schemaVersion": 1,- "pageVersion": "sha256:a8a8280c4ddd71ccbbf3677a87a94d5c31685d96a5bb5cccd3c5dc0aee89dd80",+ "pageVersion": "sha256:33c8ba85a592f81d7a811f88b428dd70840db09b45def3921f13794e3c4add31","claims": [{"id": "claim_d872799ce6874d76b63667fe912b7616",@@ -149,6 +149,6 @@],"verification": {"by": "openwiki/0.5.0",- "at": "2026-10-19T08:31:23.057Z"+ "at": "2026-10-20T08:25:57.412Z"}}diff --git a/openwiki/.claims/callbacks.json b/openwiki/.claims/callbacks.jsonindex 284306d00a..fdb5b13963 100644--- a/openwiki/.claims/callbacks.json+++ b/openwiki/.claims/callbacks.json@@ -1,6 +1,6 @@{"schemaVersion": 1,- "pageVersion": "sha256:a78a1b44776018b2b89e5ce8c517e88fc5ec7f49e79d371e4ef23477fb4aed5f",+ "pageVersion": "sha256:319adc32e1b28ab8cf2f77a73f1d0e1f42b3f8f444674c03d3ec61e4a833fd63","claims": [{"id": "claim_1870ae33ffdb41fa87eaee4125620240",@@ -207,6 +207,6 @@],"verification": {"by": "openwiki/0.5.0",- "at": "2026-10-16T08:25:55.096Z"+ "at": "2026-10-20T08:25:57.412Z"}}diff --git a/openwiki/.claims/chat-models.json b/openwiki/.claims/chat-models.jsonindex ad604025f9..6cb8defd23 100644--- a/openwiki/.claims/chat-models.json+++ b/openwiki/.claims/chat-models.json@@ -1,6 +1,6 @@{"schemaVersion": 1,- "pageVersion": "sha256:d4e1d9ef9bf4df3d0af48fc7d5987181cc75cb01f01a63b305c09d741e0b7f7c",+ "pageVersion": "sha256:69ae6606835a7391ad452cf02839eb505c867719234e759cd642cacfeb3fd448","claims": [{"id": "claim_d2cdcf05dd4149bb9ea0a5fb0d1568d8",@@ -389,6 +389,6 @@],"verification": {"by": "openwiki/0.5.0",- "at": "2026-10-16T08:25:55.096Z"+ "at": "2026-10-20T08:25:57.412Z"}}diff --git a/openwiki/.claims/ci-workflows.json b/openwiki/.claims/ci-workflows.jsonindex b4b1a438f5..f4015716ae 100644--- a/openwiki/.claims/ci-workflows.json+++ b/openwiki/.claims/ci-workflows.json@@ -1,6 +1,6 @@{"schemaVersion": 1,- "pageVersion": "sha256:e12eb01b934b7a55a3e84d53fac3c48f28f9c03b5b2e7d14f47df7d98f8253fc",+ "pageVersion": "sha256:da5ba9e019af005b5bc6b68ae51a34dfb3d4f8ac1370d9207839f408f03f5df1","claims": [{"id": "claim_cb5fe3f72803497eac3f09ebf02d97cd",@@ -243,10 +243,70 @@"version": "repo-lines-v1:sha256:c471cb5fa38ddbdddb9877794899351fac37019114d3b43a7fd58dd3dbf401ea:eyJzZWxlY3RlZExpbmVDb3VudCI6NzYsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6ImNhY2ZmOWJkYTJhMDFlZTYzMjgxZmI3YzEzYzczODUxMzBjYjlmNDExYWM1ZTU4NDIwNmIxYTJmNWQxODM3YzMiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjM5ZTBkZWNmMzZiNTUwY2YyMjJiZTJiYzE3ZDUxYTg1MTYzZWM0Nzc2YjZiYTY2ZjU5OGM4MTBhOWIyYzI3ODkiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6IjY5Yzc1MTJkNGI5ZDVmN2I2YjUzOWUzZWM3MjliZGMyNjg2NzQwMWRhY2NiZjFlZjZlNzM5ZDYxOTVjMmViMzkiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjowLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6ImUzYjBjNDQyOThmYzFjMTQ5YWZiZjRjODk5NmZiOTI0MjdhZTQxZTQ2NDliOTM0Y2E0OTU5OTFiNzg1MmI4NTUifQ"}]+ },+ {+ "id": "claim_a54c9526bb7843848baf8164db31f684",+ "statement": "Pre-commit hooks (.pre-commit-config.yaml) enforce code quality standards locally for all developers, including branch protection, YAML/TOML validation, whitespace fixes, per-package format and lint targets (make format, make lint) for each library directory, and version consistency checks for core, langchain_v1, anthropic, chroma, and deepseek packages.",+ "evidence": [+ {+ "resource": "repo://.pre-commit-config.yaml#L1-L200",+ "version": "repo-lines-v1:sha256:d90a7db12e21999b427f58f7e8da653d632e6cb396c9bb0bde749a7da497ec7a:eyJzZWxlY3RlZExpbmVDb3VudCI6MjAwLCJmaXJzdFNlbGVjdGVkTGluZUhhc2giOiI1YTExMGRiNWE5MzU3Y2RhMWQ3ODIxNmNkYzBiZjhiMjU1ZTMzOGNiYzFmMzI3ZTBkZjA4Y2ZjNzczOTFkZGVmIiwibGFzdFNlbGVjdGVkTGluZUhhc2giOiI2ZTk0MGY2NjliNzFlZWVlZWY3NjVmMmMxMjJiYTc3ZjRlNzhkMTJlMDAzZWZlYzg3NzQ0M2U4MjEwZjc4MTc5IiwicHJlY2VkaW5nQ29udGV4dExpbmVDb3VudCI6MCwicHJlY2VkaW5nQ29udGV4dEhhc2giOiJlM2IwYzQ0Mjk4ZmMxYzE0OWFmYmY0Yzg5OTZmYjkyNDI3YWU0MWU0NjQ5YjkzNGNhNDk1OTkxYjc4NTJiODU1IiwiZm9sbG93aW5nQ29udGV4dExpbmVDb3VudCI6MywiZm9sbG93aW5nQ29udGV4dEhhc2giOiJjOGUzNDIyZmQwNDFiMzUxZDgwY2NjNWZiNjNmYjI1MjgxYzU2Y2E1YjI1MGE5NTM1YWU0Mjk5N2YxNDYxNDU2In0"+ }+ ]+ },+ {+ "id": "claim_e663da6820604e348bbac94410f82480",+ "statement": "The check_diffs.yml workflow intelligently selects which CI checks to run based on changed files: core changes trigger full matrix testing and downstream packages; partner changes trigger package-specific linting and integration tests; changes to non-package files like .github/ or docs skip package CI; ci-ignore label prevents all checks.",+ "evidence": [+ {+ "resource": "repo://.github/scripts/check_diff.py#L1-L150",+ "version": "repo-lines-v1:sha256:9db69dc22cacc0b8c60d8a73a4c6ae6eb535a5b2b2a8ab99bf1ddd4ba9718ed1:eyJzZWxlY3RlZExpbmVDb3VudCI6MTUwLCJmaXJzdFNlbGVjdGVkTGluZUhhc2giOiJkMTVkNmNjYTE5MzIyZTFlMGM4NzhkZjc3NTc4OGVkZDhkNzExZGZiMjgwZWZiNWFmZjJkNjJlNGQyYTAxOGEzIiwibGFzdFNlbGVjdGVkTGluZUhhc2giOiJjMGM4NjFlNTJkMzY5OTUyZTQ0Mzg1OGMwM2YwNjA4MmRlODQwNzYyNWZmMjllNDdiMGQzYTQ0MDU2NGU1MmZmIiwicHJlY2VkaW5nQ29udGV4dExpbmVDb3VudCI6MCwicHJlY2VkaW5nQ29udGV4dEhhc2giOiJlM2IwYzQ0Mjk4ZmMxYzE0OWFmYmY0Yzg5OTZmYjkyNDI3YWU0MWU0NjQ5YjkzNGNhNDk1OTkxYjc4NTJiODU1IiwiZm9sbG93aW5nQ29udGV4dExpbmVDb3VudCI6MywiZm9sbG93aW5nQ29udGV4dEhhc2giOiIxMTQ4ZTYyY2NiMGJmZjg5YTQ4ZjQ4MTRmMzM0MDcwZWM3OWVhZDUzOGNkYzZkODM3MGM3ZmJkMzEyNGJjYWI5In0"+ },+ {+ "resource": "repo://.github/workflows/check_diffs.yml#L40-L75",+ "version": "repo-lines-v1:sha256:294f09f7846c6320529d8fd1b500f2400bb4c92d8a10bf3f7e24db5634dbde93:eyJzZWxlY3RlZExpbmVDb3VudCI6MzYsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6ImU5ZDgwMTU0ZWQ0MmZjNWM3NzliMTMzMTU3OGI1OGI4OWM4MDFlYWNlNzRmMjRjZDQ4ZWI0YTIzNTc5NDBhOTUiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6ImY4ZmI3Mjc3ZmRkMjBkMmY4NDY2ZmM3M2I1ZTQyNzA0Nzg5YjA5OTkxNjYyODlkY2IxOTM1YzAwNDg1MTZlZGEiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6IjM5NGI2MDU1ODgxNTNmZGQ4NmQ2NWViNDUzNDJlMDRhYmUyODFkYjBjZDY4NGFmMGY4MTRlOGRhNTZkM2QwODkiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6IjM1OGZjYjUzYjUxOWNjNjk4NjFkYmY4NDE3NmE3NGM1MGE3NTFlYmZkY2ZiODM1ZmY3MzNlOGU0ODE0NjgzOGYifQ"+ }+ ]+ },+ {+ "id": "claim_8160e2acf11d41c59e27d465bb4c6805",+ "statement": "Common CI failure patterns include linting violations (Ruff, MyPy, markdown-lint) debugged via make lint_package/make lint_tests; unit test failures on current vs minimum dependencies reproduced with get_min_versions.py and pip install; Pydantic compatibility failures reproduced by pinning Pydantic versions; VCR cassette staleness requiring re-recording; integration test compilation errors from import failures; release failures from version mismatches or PyPI conflicts; and PR title lint failures from non-Conventional Commits format.",+ "evidence": [+ {+ "resource": "repo://.github/workflows/_lint.yml#L56-L81",+ "version": "repo-lines-v1:sha256:982121e07cd5f75c29a9930729c7a209856069184833c0734e87f74505e1325d:eyJzZWxlY3RlZExpbmVDb3VudCI6MjYsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6ImFiNTYyYjE2NWU4MjM1MjY0ZGZlNDc2YzNhMWY1NzM5OTBjOGE1NzAyNDY3YjhkNTc5OWFiMTFhNDNjMTI2N2QiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6ImUxMDM2ZTY3ZjMxNTRiM2Q5YWQwZmIwMTYzMGI2ODk0YTIwYmFmNmRkM2QwNmFkYWJjMjIyNGZkNjg4OGIwOWYiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6IjUyODlkNmNiN2NkNDYyMjM5NTFkODE2NGI4NTM2ZWI0ZTc0YzkyODBjMjc4OTRmNjJjZmE2YThjMTM0NGJlYTUiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjowLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6ImUzYjBjNDQyOThmYzFjMTQ5YWZiZjRjODk5NmZiOTI0MjdhZTQxZTQ2NDliOTM0Y2E0OTU5OTFiNzg1MmI4NTUifQ"+ },+ {+ "resource": "repo://.github/workflows/_release.yml#L190-L260",+ "version": "repo-lines-v1:sha256:d6caf2e4b55d4a552288a6c7ea2872351ba3903e51cbb735c13141653081ac5a:eyJzZWxlY3RlZExpbmVDb3VudCI6NzEsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6Ijk0YmM5NmU3NzNhNjYzNjgwZjhhNjM0OWE0ZWM4NWMyMWEwNzVmYzExMmVmMGQxOTg3YzQ5NWI5NTE1ZTBlYTMiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjliNGNkMTVkZGUyNTVjMTViOWJjYThlMzE0YzkwODg4YWExZWI4ZTQ2ZTRhNzcyMDVkNzVkMTVjNWRjYzUxMzMiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6Ijg2N2IzNmQxODRhOTEzYTU0MjBjYmUwYTdhZGRjMjBjOGMzMTQ3YjVlNzMxMTk3YmNjODMzYmRlNjJiZmQyYWMiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6IjcyNDgwOWU3NzY4YzUzNWVmMTQzZmJiYmZkMTUzY2ZkYmM0MjY0NzU5ZWYzM2Q5NjY5YWI0MDcwMmMyNjAxNTgifQ"+ },+ {+ "resource": "repo://.github/workflows/_test.yml#L50-L85",+ "version": "repo-lines-v1:sha256:3d852b9b3ae046bca854e1340849af7057c2683e9d521b68099b514d4384840a:eyJzZWxlY3RlZExpbmVDb3VudCI6MzYsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjZhYjUzNzEwMzMxMGIxMzY5NGJhMzUyMjMwZDMxNmM3MDQ2M2M5ZDJkNWU1ZGRiODE4NDRlMjUyYzA4NmY0YjgiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6ImNjMzMwYzU3MjBjZjQ4Mjg1MGQ0NWFkY2IyZmQ1MmVmNzdmY2VmOTkxNWY0MDE0ZWEwMjJhY2ZjMTU4MzEyMTciLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6ImFhNWM2Y2RhOGM4ODRmZDlmZjhmZjIxODU0NzdiNDhmYmU0ZmFiMjE4MzRmNDcxODAyZWQ4ZmZkZjQ1ZTQ1OTUiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjowLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6ImUzYjBjNDQyOThmYzFjMTQ5YWZiZjRjODk5NmZiOTI0MjdhZTQxZTQ2NDliOTM0Y2E0OTU5OTFiNzg1MmI4NTUifQ"+ }+ ]+ },+ {+ "id": "claim_e0da4f4035c047349c14c1799d478dce",+ "statement": "CI workflows can be partially simulated locally: linting via make lint_package/lint_tests; unit tests via make test with current and minimum dependency versions; release pre-checks via uv build and wheel installation; and pre-commit hooks via pre-commit run commands.",+ "evidence": [+ {+ "resource": "repo://.github/workflows/_lint.yml#L56-L81",+ "version": "repo-lines-v1:sha256:982121e07cd5f75c29a9930729c7a209856069184833c0734e87f74505e1325d:eyJzZWxlY3RlZExpbmVDb3VudCI6MjYsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6ImFiNTYyYjE2NWU4MjM1MjY0ZGZlNDc2YzNhMWY1NzM5OTBjOGE1NzAyNDY3YjhkNTc5OWFiMTFhNDNjMTI2N2QiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6ImUxMDM2ZTY3ZjMxNTRiM2Q5YWQwZmIwMTYzMGI2ODk0YTIwYmFmNmRkM2QwNmFkYWJjMjIyNGZkNjg4OGIwOWYiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6IjUyODlkNmNiN2NkNDYyMjM5NTFkODE2NGI4NTM2ZWI0ZTc0YzkyODBjMjc4OTRmNjJjZmE2YThjMTM0NGJlYTUiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjowLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6ImUzYjBjNDQyOThmYzFjMTQ5YWZiZjRjODk5NmZiOTI0MjdhZTQxZTQ2NDliOTM0Y2E0OTU5OTFiNzg1MmI4NTUifQ"+ },+ {+ "resource": "repo://.github/workflows/_release.yml#L410-L492",+ "version": "repo-lines-v1:sha256:e76fd01a0d46c19853bce24d1bdf7321cba6e02c571224f650d6fe9222ac4bfb:eyJzZWxlY3RlZExpbmVDb3VudCI6ODMsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6ImM5MzU3MmI1MzNmZGI0NWZkZmY2YjY4NWRkM2M1OTUwYTQ3NzY3MjAxNWFjMTkyMDMxZjFkNjY5ZTFiZTljOWYiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjAxYmE0NzE5YzgwYjZmZTkxMWIwOTFhN2MwNTEyNGI2NGVlZWNlOTY0ZTA5YzA1OGVmOGY5ODA1ZGFjYTU0NmIiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6IjQ4YjUzZmMwMjFlNDkxZWY4YWE5YTU1M2MxN2ZjZGE5MmY0NTZlNTIyZGZlMTU3ZDQwMzY4MmYxZjA2OGQ0ODkiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6IjkxYTllMjBmNWFiOTQxZDA0NGQ0NDNjYzJhMzkyNTcyMWZjNjA5MDNhMWY4ZWQxOTg5MDUwNjMyNDg1ZDc0MzUifQ"+ },+ {+ "resource": "repo://.pre-commit-config.yaml#L23-L170",+ "version": "repo-lines-v1:sha256:ff03a7d9d2684779b52ae774b382473b09885ff9361ab0b4fe1f13dadacc6a53:eyJzZWxlY3RlZExpbmVDb3VudCI6MTQ4LCJmaXJzdFNlbGVjdGVkTGluZUhhc2giOiJmYTY4MWNlZGM0YzJlMTVlOTQzMjI4NmE4NTMzMTVjNGZmMTgyNTllZTU0NGI2MDI0MDM4YTYzYzBiNzg2MmZkIiwibGFzdFNlbGVjdGVkTGluZUhhc2giOiI2ZTk0MGY2NjliNzFlZWVlZWY3NjVmMmMxMjJiYTc3ZjRlNzhkMTJlMDAzZWZlYzg3NzQ0M2U4MjEwZjc4MTc5IiwicHJlY2VkaW5nQ29udGV4dExpbmVDb3VudCI6MywicHJlY2VkaW5nQ29udGV4dEhhc2giOiJhMDhlNjlmZTk5ODQ0YjA5OGY2YTg2ZGIxZjc0YWQ2NGM3ZmIxMzY1ODY2NDA2MjRmZTRlZGJhYjM5NWYyZDIwIiwiZm9sbG93aW5nQ29udGV4dExpbmVDb3VudCI6MywiZm9sbG93aW5nQ29udGV4dEhhc2giOiIwOTRkN2IwZGVhNDdiZmVhNjYzZWJiMjI2ZDYyYmQxZmNjOTAxNjkxYmViYzE5ZDFkNGMzMmRiNmRhNDYzMGQwIn0"+ }+ ]}],"verification": {"by": "openwiki/0.5.0",- "at": "2026-10-16T08:25:55.096Z"+ "at": "2026-10-20T08:25:57.412Z"}}diff --git a/openwiki/.claims/composability.json b/openwiki/.claims/composability.jsonindex 000a0fee76..e99a7b44a4 100644--- a/openwiki/.claims/composability.json+++ b/openwiki/.claims/composability.json@@ -1,220 +1,150 @@{"schemaVersion": 1,- "pageVersion": "sha256:08b16574d155fea41f84c89a32fa0f8c6c34fcf5a6f640ab81d2d0dd5f796884",+ "pageVersion": "sha256:97475861bc89497ade34906008e15de726598966ea5262ccbb3ac874c4058013","claims": [{- "id": "claim_51e65b4f126f42d986b2766ee964d991",- "statement": "The | (pipe) operator chains Runnables in sequence, creating a RunnableSequence where each step's output becomes the next step's input, and it automatically flattens nested sequences.",+ "id": "claim_66e7360938c14fb8a42c8e282f9fcdcf",+ "statement": "Middleware composes into a stack where the first registered middleware becomes the outermost layer, wrapping all subsequent middleware and the model execution.","evidence": [{- "resource": "repo://libs/core/langchain_core/runnables/base.py#L3075-L3208",- "version": "repo-lines-v1:sha256:50b0edb81dc9d08ad730ef192dd88e1c76aae278c6050b8381610b0fab6083ef:eyJzZWxlY3RlZExpbmVDb3VudCI6MTM0LCJmaXJzdFNlbGVjdGVkTGluZUhhc2giOiJiZWUyODI4YWI5ODNjODVkZTdkOWUxOGNlZjVhYTQzZGY0MTJiYmRiY2FiMDc3ZjdmMDEzYjUzZWQ3ZTRlNzM3IiwibGFzdFNlbGVjdGVkTGluZUhhc2giOiI1OTA5YTUzYTYxOGQwMjhlMWQzMDAwYzBhN2FiY2VlY2JlNWZiMzdmNGU1MTFlZmU0NjY0M2ZhZDZlNjY4NzJmIiwicHJlY2VkaW5nQ29udGV4dExpbmVDb3VudCI6MywicHJlY2VkaW5nQ29udGV4dEhhc2giOiJjYmVjNzljZDAzZDA2YmE2ZmU3MDBlMDhiZDA0ZjFmMDA0ZDFkZTg0ODMzMzMwN2U2ZGE5YTJlZjcyZTZmODZmIiwiZm9sbG93aW5nQ29udGV4dExpbmVDb3VudCI6MywiZm9sbG93aW5nQ29udGV4dEhhc2giOiI1OWRjNDBjZWRhOTM4MzYwNzU2MzZkMTY5ZGIyZDVlMDYwMTg4MTNiZWI5MmRhYjlkNzEwOWI0MjE0M2NkYWRkIn0"- },- {- "resource": "repo://libs/core/langchain_core/runnables/base.py#L648-L673",- "version": "repo-lines-v1:sha256:b5be17ef178ed117d371c78e9412265ee7efa288aae872613ebcdd3a241b87cd:eyJzZWxlY3RlZExpbmVDb3VudCI6MjYsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjNiNjNkN2Y2Y2EzZTVjZWQ5MDg2M2YwMmJhYmQyZDkwOGNiY2ExOTViZTQwNTE0M2UyNmViODA3Y2E0MTRjMzYiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6ImIxOWY0MzJmNjZjNzA5MTFjMDcyMzg1YzMxMTA1NDkwM2U1ZWQxN2NmNGYxY2FjMjg1OTUzYjI5M2M1MWRjOTUiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6IjkyMzEyOTc4NTcyNzU3NzcxMWUxOTFiNmYyZTlkMzA5NjdjMmNhN2JiM2U2Yzg3NGY5YjY4NjU4ODI4MDcyY2MiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6ImJmZjllY2NjYWJjYjk2ZGM1YzRkZjIzYzEzMzEwZjI0NjhkZTU2MjBlMDFjYmUwNTUxMDBlNjVjYzlmYjQyZDQifQ"- }- ]- },- {- "id": "claim_1309275bbbb74672831f5010f0f69017",- "statement": "RunnableSequence preserves streaming properties: if all steps implement transform(), streaming passes through the entire pipeline; if any step blocks, streaming resumes after that step completes.",- "evidence": [- {- "resource": "repo://libs/core/langchain_core/runnables/base.py#L3094-L3110",- "version": "repo-lines-v1:sha256:2ef34a9d0b35166b35f7620c01895fde1aa0f19397e235d1fe9c91a230c0a599:eyJzZWxlY3RlZExpbmVDb3VudCI6MTcsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6ImE1MWJhN2ExNDdlMTk4ZmQ5YTJkNjM1NGIxMjM3ZjBlYWVhNGZhMDFiMmRjN2ZjMzdiYmY0NDVjMGYzZjZkMjUiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjAxYmE0NzE5YzgwYjZmZTkxMWIwOTFhN2MwNTEyNGI2NGVlZWNlOTY0ZTA5YzA1OGVmOGY5ODA1ZGFjYTU0NmIiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6IjM4MjhhYThlZTExY2U5MDA1NGE3YWUwMjgzYzZjNWNiMDBiNzI2YWNlYzAwMTczNmY0OTY4YzQ2NjgxMWNhY2IiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6ImI3NDQzNzAzNTIyZWMzMWY0YjBlZmZjNmQxZGUwN2E5YjQ1MzFjYjIzZDlhZDNhMGNiNTY1YWIzNGY0MWMyNDgifQ"- }- ]- },- {- "id": "claim_49e7047fbd9c48d694f4b01fdf3a563e",- "statement": "Dict literals within a sequence create a RunnableParallel that invokes multiple Runnables concurrently on the same input, returning a dict of their outputs.",- "evidence": [- {- "resource": "repo://libs/core/langchain_core/runnables/base.py#L3865-L3875",- "version": "repo-lines-v1:sha256:357dc57f5e818449d954a4b79fbfba43677fc3b9fac73253591a9dc732873f72:eyJzZWxlY3RlZExpbmVDb3VudCI6MTEsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6ImMzNjI1NjYzZmNjMjBkMWFjNDczMGVkMjExMDBjMWIyNjBiYTdjZjFjYjA4OGVmN2I3NTVhNjQ3ZGUyYWI1NmQiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjAxYmE0NzE5YzgwYjZmZTkxMWIwOTFhN2MwNTEyNGI2NGVlZWNlOTY0ZTA5YzA1OGVmOGY5ODA1ZGFjYTU0NmIiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6Ijc3MGYyZGMyNjUyOWYyOGRlNWVlOTA3OWRiMDk2OWQzZTgzZTI1NmExYjBmOWI2ZmNmZGFmMGVhOTUwMjA1ZmIiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6ImQzZTdlNmMwNGQwZTI4MDY3Njg5ZDI0NTM4NjQwYzY5MGIwYzZmNmJhNjBiMzJmNmZhNDE5ZWFjNDRhNDBiNDYifQ"- },- {- "resource": "repo://libs/core/langchain_core/runnables/base.py#L3899-L3918",- "version": "repo-lines-v1:sha256:7abaae83d4ea741da2276a115e6cbca83a74b6d37f46469b9e02b9f75b2f6ae2:eyJzZWxlY3RlZExpbmVDb3VudCI6MjAsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjY3ZTg0NjVjZjNmNmEyMjhhYjdjMDQ0YWQyNzU3OGM3MDVmMmFkYThhZTQ4OTJhZWE5MGJiMDc0MGY0YTkwNGMiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6ImE2ZWY2ZDQ3NjI3Yzk4YzFjYWFkYTM4MDMzZDQzZTEyYzE5YTA3OTNiN2E5OTNjNWUwYTdmZDdlNjRiMmNmNTQiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6IjU0NmI2MDcyZDg3NGY2YzQ2MDU4YzhmNDdhODllYTA1ZDczYzFjMDAzMzJiMzM0OTRmM2YxYmY5NGY2OGI5YTAiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6ImI5MzlmMzJlNTBjNDM5NzAwOTcwOTQ5MmUyYmJkNzgxMTJkM2YwYmYyNTYwOTYxYTRiZThkZTUxOWFlMTc2YWYifQ"+ "resource": "repo://libs/langchain_v1/langchain/agents/factory.py#L281-L370",+ "version": "repo-lines-v1:sha256:272c0933c5414b8cecc2e64643c365fa65e76088a91d385cdab443f37076f035:eyJzZWxlY3RlZExpbmVDb3VudCI6OTAsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6Ijk1Y2IwNmM0MzdmOTk3ODhiZDVjOGM4MDY5MjU0MTI5YmVlN2ExNGYzMzc2ZTFjZWY2MTczYWUyMGE3Y2YyZjIiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6ImViZjVlNjBjNjUyNDc1YjVjNzhmMzdlYmI2OTJjNWIxM2NhZDMwMjI4NmM3MDFlYzBhZTAxODVhMWZiMzVjZGMiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6IjI4YjE2YTdhZjFkZDFlYzI4OTY3MWRhMWU5MmExY2UzN2I4MTA0YWFlYjZlYjU3MzY1NmU4NWVhMzU0YTNhY2MiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6ImU5YTcwM2FiYzE5MWZjZWUxOWIwMzM5NTc3MjEzZWQ2OTMyMGRlOTFmZWMwNDdjZjAzYTY0NTUyYzNiYTY1NjQifQ"}]},{- "id": "claim_f2a2e30192e84a8d943ade69bb877243",- "statement": "RunnableParallel uses atee (async) or safetee (sync) to create independent input copies for each branch, with chunks yielded as they complete using asyncio.wait(return_when=FIRST_COMPLETED).",+ "id": "claim_0413d040eb03431b9d684b5cca4fabec",+ "statement": "Each middleware receives a handler callback (the next layer) and must invoke it to continue execution; handlers can be called multiple times for retry logic or skipped entirely to short-circuit execution.","evidence": [{- "resource": "repo://libs/core/langchain_core/runnables/base.py#L4325-L4367",- "version": "repo-lines-v1:sha256:af652106c5e10847a785649a20ab3669429460fabdde32919c3af4aa413ae7c0:eyJzZWxlY3RlZExpbmVDb3VudCI6NDMsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6ImQ3NDc2MzI4ODc3Y2ExZWJiNzM1NWZkOWMyMTAwYTUzYjQyOTM0ODJhZmU0ODA3OTQwYzAyNTkzMzA0YWY3ZjgiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjUxODYyZTJmZWI4YmJjYmM3Y2NhNmYxMGE4NTAzMDJhNTJjY2EyM2IwOTE0NjdiMzljMDcyOGY3OGE4OTU4MTMiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6ImY4ZTc0ZDM4NzUxZDM5MTM3NDYzNGFiNDY0ODJiMzE5Y2FjYTk0MzE1YzE5NmUwN2I3MDQwZjgyZWNiYmUzYmYiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6IjVkOTNjYjJjNGFmYjAwZTJmOTY1ZGVlNDkzMTkyYjY0YmY0YmI2ODc5MTRkYTFiYWJmYWU5YTNkYTk3MDBhNGMifQ"+ "resource": "repo://libs/langchain_v1/langchain/agents/middleware/types.py#L503-L550",+ "version": "repo-lines-v1:sha256:67fa691dce671b60b38599285f21ba33b5683e819697c583e028bb9addb23292:eyJzZWxlY3RlZExpbmVDb3VudCI6NDgsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjkyNzFhMGExMzM4YjZlODZjZGFiNjVjNjliODU0NzgxNzIxNWJkYjA0M2MxMDY3ZGM0MTU4MmUwMjE1ZWVmZTUiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjczZDNiOTg2ZjBlNzA4NzUxNGEwYmQ4YmRhOTdhNjY2OTBjYjUyZWFhMWIxNDNiYjY1MzEyZWM4MDQyOTA1NzEiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6IjRmMTYyMTFiOGZmOTg3NDZjYjdjYjVkNmQ0NWU0NTEzODJjZmYxNDU2NzA2YzZiZGMzMGFjMzhkNTY2YjA5ZWMiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6Ijc5ZmRlMWJmNTFmZTQ0NjRmZTc5YzM1YmE3MWU4MzU1YjQxMzQ1YjE0ZWFjMjM3NDkwMzk0YzU4MWQ5NGMzNWMifQ"}]},{- "id": "claim_04d245f8261246fb9ddf9c83869aa732",- "statement": "The batch() and abatch() methods process multiple inputs through a pipeline in parallel: batch uses thread pools via get_executor_for_config, and abatch uses asyncio.gather with max_concurrency control.",+ "id": "claim_932936b646f04614862ff8639d153ee1",+ "statement": "Agent execution invokes lifecycle hooks in order: before_agent (once at start), before_model (each iteration), wrap_model_call (interception), after_model (each iteration), wrap_tool_call (per tool), and after_agent (once at end).","evidence": [{- "resource": "repo://libs/core/langchain_core/runnables/base.py#L1066-L1100",- "version": "repo-lines-v1:sha256:eaba4671a1d31f10055b668320373a32167c2b22020509c1cbb26e1c96f88319:eyJzZWxlY3RlZExpbmVDb3VudCI6MzUsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6ImM2MDQyODVkYjcwOTYxMjMwMThmYTUyNjRmNzE0ZTU2ZTdhODM4OTdlYjg5ZGNjOGIzYWZmZjhiZjFmMzRhNzciLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjI2MjFkYjllY2I3NmRmODA5MjgyMDdmM2I2MjU4MTc1N2I5YzM0NGZjNWQ0ZDk4Y2ZmNzNjNWI4YmQyMjhhZmQiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6IjhmNmEzZDRmNGIwNzcyMDVhZmIyZmIxZDFhMzc2NmZkZTdlODNlYWI4NzMwZmMwYzI5NTg2NzVkMzNlN2E0YjUiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6Ijc3NmYwZmJlMGE4ODMwNGU0YWVmZjZiMjhlMTc3MTM1OWJmOTQyY2MxZTI2YTYwMTM2NTY2ZTE4MjliZDA1ZjAifQ"- },- {- "resource": "repo://libs/core/langchain_core/runnables/base.py#L931-L979",- "version": "repo-lines-v1:sha256:162e8b332e60ac819bd13d160c07a848461973a135ccbc10cf7ca5337413b062:eyJzZWxlY3RlZExpbmVDb3VudCI6NDksImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6ImQwNGJlZWJhNWU0ZDYzMWUxN2IwNTVhNjhhMGEzYTkyNzFjOTcxYjJkMzZkZDA3NDBmYjJmYjY4YzU1MGJhZWUiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjI2OGY4NmVmZjFlNGIwMmY4NDg2ZDU3N2M3ZjMxMTdkZTA2MjhiZTE5OWJjZDk0M2JkNmYxNGNkOTU4YWM1ZWUiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6IjI0NDc4YTFlMTI0YTY1MmEzNDI4YTE3YWRmM2Y3YjUwOTU5ODY3NmYxZDhkNGViNGIyYmJmNTYyOWViYjRlYzUiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6IjFjZDM1N2M4NDFjMTcyODdmM2U4MmQyODVhZTgyZDM0YzdiY2ZhM2EzNmIxYjI2MjYxODY2MWM1Nzc0ZTNkMTIifQ"- }- ]- },- {- "id": "claim_6e91508762e349d0baab198b14ca2dfd",- "statement": "stream() and astream() emit output chunks as produced; the default implementation calls invoke/ainvoke, but components implementing transform/atransform support true streaming without waiting for full completion.",- "evidence": [- {- "resource": "repo://libs/core/langchain_core/runnables/base.py#L1194-L1213",- "version": "repo-lines-v1:sha256:23cc3478740b415df53cc79cbb93700be85319defdec671ee846f03b1fd9f5ea:eyJzZWxlY3RlZExpbmVDb3VudCI6MjAsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjZkMDJmY2NjNWE1YWFkOWQyZmRmNzU2ZmM3ZmU2OTM0MGYxZDM3ODAxNzQwMTY2MzgzMjQwYzNlYTZjMWY0NGYiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6ImMyMjk1OTY3MTUzNGMyYmE1YjA3NjM2NTZiMTI5YmNkN2E5ZjIxODNjYmQwMGEwMzE0OWNmZDg5YWQyNGQ3MjUiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6ImRmYjIzYTg5OGMzMjkxNWQ3OWNiYzVkOTAxYWYyOGY0YzI3MjUxZDM3Y2RiZDA5OTlkMWZlMmMxZjkzZDFlZjMiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6IjlkMDdlMjcxYjA2OTBlYTNlMWViNGE2MDMzYzY0NmNmZDJjNmFkODcyYTNkNTBiYzliMWY5MGM4MjRhZTUxOWEifQ"- },- {- "resource": "repo://libs/core/langchain_core/runnables/base.py#L1215-L1234",- "version": "repo-lines-v1:sha256:7d041aac561a3c904849deadfc7b152866d4e3d36f4dc8256583a2f7e39044b3:eyJzZWxlY3RlZExpbmVDb3VudCI6MjAsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjM0ZThjNjMxZDczZmQwMDMyMWQ2ZTJjYjI3NTBlYTYzZWFiZWU4YjM2NzZiYzBhMTNmMzBmZDU0NjQ2NTAzY2IiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjZkMzYzZGU5MmRjZGQwMDk3YjMxMDQ3N2MyOGQ4MjJhNTgzOThjNmYyNWI3MDc4YWJkNjcwNDU3OThkN2JmNDIiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6IjBkNTZhMjE3OWVmZjU0ZWM2ODczN2Y5MDQ5ZDFlN2JkOGI4NjI4MmE3ZjhjMzFmZTI2ZTQyZDRlZjE0MjhmNzAiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6IjJkMDg1MDY4OTU0YmFiNzhlNTM3ZTYwMmM2YTE1OWNkOGQzMzMzNjcxY2M2ODc0YzhlYzA0N2ZiZjc4ZTAxOGUifQ"- },- {- "resource": "repo://libs/core/langchain_core/runnables/base.py#L3827-L3861",- "version": "repo-lines-v1:sha256:91507446afb094a9113b451f1950223dbc4ed2bc970240ef4f5fbc65d1f278f3:eyJzZWxlY3RlZExpbmVDb3VudCI6MzUsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjZkMDJmY2NjNWE1YWFkOWQyZmRmNzU2ZmM3ZmU2OTM0MGYxZDM3ODAxNzQwMTY2MzgzMjQwYzNlYTZjMWY0NGYiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjRkYTJlMjU2MjkzODVhOWNhN2QzNjNlN2M3ODFjMzc5YjA1ZTE1ZGVlY2E5ODlkMDEyZDFiMzgyOWZkMmVhYWMiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6IjhhZmU0YTdmZWIzYzVlN2ZiOGNjZjcwZmE3NzIzNDkxYWMzOTgwOWRmZjE4YWVmMmFiODE1YzExZjc2MzM0YTAiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6Ijc3MGYyZGMyNjUyOWYyOGRlNWVlOTA3OWRiMDk2OWQzZTgzZTI1NmExYjBmOWI2ZmNmZGFmMGVhOTUwMjA1ZmIifQ"+ "resource": "repo://libs/langchain_v1/langchain/agents/factory.py#L1600-L1750",+ "version": "repo-lines-v1:sha256:1492493e020b52af8328c858713b68af6af632c069529590b4ac91dc870efdd4:eyJzZWxlY3RlZExpbmVDb3VudCI6MTUxLCJmaXJzdFNlbGVjdGVkTGluZUhhc2giOiI1NTAzMmU5NjRkMDkzMjM1MWU1ZDE4NTI2OTI4MWIxNzFhM2EwOWIwOGIyODZlNjYxZWE0NzAzMjNjODJlYjRkIiwibGFzdFNlbGVjdGVkTGluZUhhc2giOiJkYjk0MjZmODEyZDI1ODZiNjU4Y2Y1Njk4OTVmMTU0NzQ5NDNjY2NhYjE2YmU4YzQzOTMwODc5MzMyZjIwYWVjIiwicHJlY2VkaW5nQ29udGV4dExpbmVDb3VudCI6MywicHJlY2VkaW5nQ29udGV4dEhhc2giOiJiZWYxMWRjMmI2Y2VmZWJlMjYyZWM2MTYwMjkwOWVhNjU5MWQxN2FkNmNlNzcwODBiOThlZTA5OTczMDM2ZTExIiwiZm9sbG93aW5nQ29udGV4dExpbmVDb3VudCI6MywiZm9sbG93aW5nQ29udGV4dEhhc2giOiI0NWFmMmE0Njg2NTM3Y2JiNDY5MTU0MDUyMTQ1NDNkNTRjNTJjMTUzY2U2OGIwMjg4ZDFhNWY3ZTkyN2Q4M2FhIn0"}]},{- "id": "claim_7b5e273603c549ca9f0aa7d95ad36c84",- "statement": "RunnableBranch evaluates a list of (condition, Runnable) pairs in order and executes the first matching branch; if no condition matches, the default branch runs.",+ "id": "claim_5b0a4344f2be4d208edfc705526375fc",+ "statement": "ModelRequest provides an override() method that creates a new request with specified attributes replaced (model, tools, system_message, etc.), enabling middleware to modify the request before passing it to the handler.","evidence": [{- "resource": "repo://libs/core/langchain_core/runnables/branch.py#L43-L97",- "version": "repo-lines-v1:sha256:ca305dce47126f042d2f6f2d0ee7f208bbb7ea3ba6c8bbec19cc4834cec68017:eyJzZWxlY3RlZExpbmVDb3VudCI6NTUsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6ImExYjE3NjU1OTc3OTQwMjNjMjVkY2E5MzMwZDYwNDk1NDcyOTI3MzBjZDYwZWZlYThiNWFkOWNlMzhmZjQ0OWIiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjZhNzM3ZTFmNDBlYzJkYzlhNjA0NGM0NWZiNjg1YTE4ZGFlYjlhODg0YzM2NzBlOThiOGYyZmY3MDcxYmQyMTUiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6ImU5YzA0NTAxNWEwM2FmNzYyOTYzNGUwNmU5YmUzZjg4YjI0MjZhYjVhMzdmZTkwYjI4MmJlOGY3ZjFjZjc3ZGYiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6ImQ2ZDQxNGE4OGE2ZTgwYTU3Y2U5YTNkZjBlZThhOGQzZDcwZDUyZjA3YjIyOGE3OWUyYjk3Y2E0Y2VmMjA0MDUifQ"+ "resource": "repo://libs/langchain_v1/langchain/agents/middleware/types.py#L203-L269",+ "version": "repo-lines-v1:sha256:3520f1a6407e8d83c81bea4d581ee001e23d77d2ee4924010e0be9f88a273643:eyJzZWxlY3RlZExpbmVDb3VudCI6NjcsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjVmODUyNWFiYmM5NzAyMDI3NmMxM2VjM2FhMWUxZGZlOTg4OWM0MDNiODEzMDY3N2JkMzNkMzE0ZDdmZmYyOWIiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjU3NmExNGNhZWI0NjcxMmQ3MGM2YmY5YTJjOGQ1Y2JlNjg3N2M5MmYxYzdiYWQ0ZDYyMDdlM2JmZTBjM2Q3YWIiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6IjVjOGIzYTI0ZGU3ZGQ4NmUzMWQ2MjY3NTRiYzVlNDZiMTdhNjBhMGRmYmFhMjBiMWY3YWQ0MzgyODIyZmFjYWQiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6IjZjMWYwMmZkN2VjMWQ0NjJjMGNiODE4Yjk0OGZmZTRmNzE1YjJjMmM0MzI2MzBjMjMyZGZlMzRkNDI3NDNmYTkifQ"}]},{- "id": "claim_d343eeb0e7aa4ee29ffd49b514f4e85c",- "statement": "RouterRunnable routes to one of several Runnables based on a string key in the input dict, selecting which branch executes based on the 'key' field.",+ "id": "claim_8f9011e2f3394acb9c8b16045e8e12e7",+ "statement": "When a model calls multiple tools, the graph returns a list of Send commands to the tools node, each with a single tool call, enabling parallel execution where all tools run concurrently and results are added to state.","evidence": [{- "resource": "repo://libs/core/langchain_core/runnables/router.py#L46-L117",- "version": "repo-lines-v1:sha256:c9756af590747da1fe8c53b6a9b264e86ce3e7126e99a5f38038b8edff1d2575:eyJzZWxlY3RlZExpbmVDb3VudCI6NzIsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjliMWQyMmIwZjU1Njc3N2Y2ZDlmNWIyZmY1MmIwOTIzZWVlYzVmNDhmNjFiNmUwZmRhYzgzMmQ3MDQwYzNiNjMiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjRjOTA5MDk4ZjU3NTNhMGI1NGVmMzFjOTU5NjM5Yzg1N2E4MDdkYTM4ZDZlNjgxNDg1MTYyZWU3YTNiMDQzNDUiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6Ijk1YjczN2QzODU0ZjgzOTNjZWIyYzcxNzIyMTI3NDI2NzQyNWY5ZWI0NjJkMTc3N2VmMjhjZDZhNjQzYWQ3ZjQiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6IjU3ZGNlNTdlMDdiMTM0MmRhY2YxNmNiZjNjMTllMzUxMzFmNWM0YTg3MGU2M2EyMGY3MGI2Y2ZkYjVkMjFhYzQifQ"+ "resource": "repo://libs/langchain_v1/langchain/agents/factory.py#L2020-L2042",+ "version": "repo-lines-v1:sha256:e20ba463ae13fc709d6937741d919beb3e059d944e1e7b4207abe39269dbad2a:eyJzZWxlY3RlZExpbmVDb3VudCI6MjMsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjAxYmE0NzE5YzgwYjZmZTkxMWIwOTFhN2MwNTEyNGI2NGVlZWNlOTY0ZTA5YzA1OGVmOGY5ODA1ZGFjYTU0NmIiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjM2MGIxYjRhOGUzZDA5NTFjMjljOGQ5ZWIxMDA1YmI4ZjJlNTRlMWQyMmJmNWJjNzkzYzdiNWVkODk0NzJkZmUiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6ImFjN2MxMzU1YjYwNDYwOWQ1MGY2ZDYyMTVjYzI2ZTZhYjE0MmFmMDVkNGM3ZjExOWZhZTMwNzJjOTE2ODU5ZmQiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6Ijg1YzliZTg2ODgxZmU3ODAyNTYwNGNjZDUxZjUzMTk5OTIwYTc1ODFkZjE4ZDBiMTJkM2JhZTFkYmJlM2ZmMzMifQ"}]},{- "id": "claim_0362cf9d984f4c15aaf06797272954a1",- "statement": "RunnableSequence.invoke() executes each step in order, passing output to the next input, and wraps each step as a child run in the callback system.",+ "id": "claim_1321e38d30b347869ed3955911285699",+ "statement": "SubagentTransformer detects subagent boundaries when a nested run's lc_agent_name (set by create_agent(name=...)) differs from its parent's name, and surfaces typed SubagentRunStream handles on run.subagents with cause metadata linking to the triggering tool call.","evidence": [{- "resource": "repo://libs/core/langchain_core/runnables/base.py#L3430-L3463",- "version": "repo-lines-v1:sha256:976984f151eb788f97f2d92fd5172e81c49b088670c5a2545910700f61586678:eyJzZWxlY3RlZExpbmVDb3VudCI6MzQsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjdlNGExMDE2MjNjYjY2YmFjYzAwNDk1N2NhMzI2M2E2YzY5NDU0NTk2OWZlMDZiZDI2MGIzMzAyYjNkYWRhMDMiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjQzZGFiMWFjOWUzODkyMDYzMDc1ODgwOWI5ZWQwZWE5NGJiYjFiMDQwZDI4MDNlMDg0MjdlODUwOTE0ZGRjODYiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6IjhhZmU0YTdmZWIzYzVlN2ZiOGNjZjcwZmE3NzIzNDkxYWMzOTgwOWRmZjE4YWVmMmFiODE1YzExZjc2MzM0YTAiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6IjU3ZGNlNTdlMDdiMTM0MmRhY2YxNmNiZjNjMTllMzUxMzFmNWM0YTg3MGU2M2EyMGY3MGI2Y2ZkYjVkMjFhYzQifQ"+ "resource": "repo://libs/langchain_v1/langchain/agents/_subagent_transformer.py#L120-L195",+ "version": "repo-lines-v1:sha256:c871566dc1a1a630ebd27fdd9d23437044f3360ad6bc0ccafcde71967cb6d6c4:eyJzZWxlY3RlZExpbmVDb3VudCI6NzYsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6ImJmYzhhZWMyZTU5MjZkYmExMTg0M2RmOTk2NjAzM2Q2MjgxN2UzNDAyYzMxYTcxYmY1YzQxNTBjYzg0MmFlZDQiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6ImJkNjllNTZhZDNhM2FmYTlhZjkxMTYxMmRhOWI1ZDVkMjM5NzJhZDIwNGE2YTg5MmYzNzNiZTc5YjE3NjZkZTgiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6IjRkNmFjODUxNTFhYzQyZmVlZDVjM2FkMjA2ZDdhMTBmN2IzM2ZkMTkzMzk1YTYwMDY1OTYxOWNjYTc3ZjY2NWIiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6ImU1YTM5YjBiYmFlYjc0YjE4NTZlYmMyMGQ2ZWQ3MmRlY2FjOGEyYzBjMTczOWE3YWM2NzdhYmEwZjI5NmNjMjIifQ"}]},{- "id": "claim_d5179fe7d3f34d84be92c748c6af6304",- "statement": "RunnableSequence.batch() calls batch on each step in order, feeding the batched outputs of one step as inputs to the next, enabling efficient parallel processing through the pipeline.",+ "id": "claim_bb46fb0505054b04bb880d5fea63a859",+ "statement": "SubagentTransformer recovers the originating tool call via the base's _pending_cause instance state and exposes it as a LifecycleCause dict with type 'toolCall' and tool_call_id on the subagent handle.","evidence": [{- "resource": "repo://libs/core/langchain_core/runnables/base.py#L3505-L3530",- "version": "repo-lines-v1:sha256:2129e2cca7d851d1ed09c0b6d1d4088e490e3a7833fe1ad08c20af6212066c4a:eyJzZWxlY3RlZExpbmVDb3VudCI6MjYsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjQ0ZGE5MzUwMDE5ZGMxZTY2NzQ1MjY0Mzg3MzE2MTk5NzIyNWU5Y2U2MDEwN2FmN2I2NGY4NDBkZGVjZmRhNGYiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6ImJhYWU4YTBjYTc2Zjk4ZjdiN2RjNzk4NDk1MWQ2M2U1N2RiM2M2NDU1NzljYTUxYmFkNmE1MzlkNjE0ZWRiYmUiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6IjViMDA1MjRmYTNkZjM0MjNmYmQwMTIzYzY5YjcyZjZlYjY2MmYxZTZmMmRiYmM0YjgxMzUxMTAzMDgxOTA3NTciLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6IjYzZTgzMDFlNDA0YjVmZGMwZWNmYjg1OTkyYTk0YjgwMWFkNzA5ZjZlM2U3MzBjZjdiNDkwYWQzZDcyNzJkY2EifQ"+ "resource": "repo://libs/langchain_v1/langchain/agents/_subagent_transformer.py#L158-L195",+ "version": "repo-lines-v1:sha256:b9b59cdefa763e2c972272f5992624a7d858dad02e6172d01ec8c0ec7b620056:eyJzZWxlY3RlZExpbmVDb3VudCI6MzgsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6ImY4M2Y5MjczYjRhODg2YzE3OTNkODgxMGNmMTI2OTE1OWRmYjU4NmExMGY3YjZhZmY1NTA2ZmNjOTIwMWQ1NTQiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6ImJkNjllNTZhZDNhM2FmYTlhZjkxMTYxMmRhOWI1ZDVkMjM5NzJhZDIwNGE2YTg5MmYzNzNiZTc5YjE3NjZkZTgiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6ImY3NDBjZWM3ZmQ2MzI4YTU5MzBkNDdjNmM5ZTJkMjJhZmZhMjQ4ZjUzNjk3MmVkMDBlNTBiMTFlMDgzNzI4ZDYiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6ImU1YTM5YjBiYmFlYjc0YjE4NTZlYmMyMGQ2ZWQ3MmRlY2FjOGEyYzBjMTczOWE3YWM2NzdhYmEwZjI5NmNjMjIifQ"}]},{- "id": "claim_6755e7507b7a49e99ecd66cc7bccd61b",- "statement": "Every Runnable method has an async counterpart: invoke/ainvoke, batch/abatch, stream/astream, transform/atransform, and batch_as_completed/abatch_as_completed.",+ "id": "claim_f98cd84cf6964a68ba62307f66b057c2",+ "statement": "LLMToolSelectorMiddleware uses a smaller LLM to select relevant tools from a large set before calling the main model, reducing token usage and improving focus through structured output selection.","evidence": [{- "resource": "repo://libs/core/langchain_core/runnables/base.py#L1001-L1064",- "version": "repo-lines-v1:sha256:a3f7d87ad9b0597d3d824f02452ca9c52994ad2156a1dfb9c36247784c2cf267:eyJzZWxlY3RlZExpbmVDb3VudCI6NjQsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjFmYzhkNjQzYWQwMGUyYjJlNmQ0ZTlmZWI3ODk2OTY0NTc5NzA5N2JlMTRiZGZjZWQzODU0YmQ0NTkzZWM0ODAiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjlhMWY3MjQ2NWY4ZTJmMjg4ZjhlY2E5Nzc0YzYyODc2NmUxOWQwZjcwNGQyYWQ1NGUxMDhiZTNhMWMxNzZkM2EiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6IjI1NzkzMGNmZDVhYjBjNzM4YzZkM2YxOTlkOTdlZGNiZTE4NGQzMmRiN2E1YTA2Yjk0ZWJkMjllNjI2YmRlNGQiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6ImM4NjE0OTQzZmYwMmFiZWVkMWM4YTk2ZmVmNjRkZTY3ZDllZjY3NzY1NjA3ZDg3M2MxMTk5YzA3YzZlMGMxYzIifQ"- },- {- "resource": "repo://libs/core/langchain_core/runnables/base.py#L886-L929",- "version": "repo-lines-v1:sha256:9aa7c2781e131a44b9092e54c3436f4309ea52538c7e74d52f5169bcefea15f3:eyJzZWxlY3RlZExpbmVDb3VudCI6NDQsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjdlNGExMDE2MjNjYjY2YmFjYzAwNDk1N2NhMzI2M2E2YzY5NDU0NTk2OWZlMDZiZDI2MGIzMzAyYjNkYWRhMDMiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjI3OThkYmMxMzk2MDZkNTA1MGI3ZDI1YWRiY2NlY2Q5YzQyOGM3ZWE2ZTQ2ZmVjZGYwYjI3ZmE1NjMyYWI3NTkiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6IjkzNmRjMjllOGE1ZTYxMTYyZTJkY2YxZTRiY2FiNDc4OTg0MzMxZmMzMWU0YmExNTY5MDVlZTMxNThlM2RmZTkiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6ImQwYTU5NTE2MjU1ZDg3ZWViNGM4NDhjNWY3ZDY4MjQyODZlY2MyMWUwYzAyMzRjOGI3ZWM3ZjE1YjY5YzRhZmYifQ"+ "resource": "repo://libs/langchain_v1/langchain/agents/middleware/tool_selection.py#L123-L150",+ "version": "repo-lines-v1:sha256:4024f7362e39f6a4f7f701fd5edad45358830e3df782b4e2ea60d80866bc6276:eyJzZWxlY3RlZExpbmVDb3VudCI6MjgsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjAzMGM2NGYzZjUyZWJiNDdkMWQxMDU1NTA5M2RiMTZiYTQ1M2RkNzM1N2M2ODVhZTJmOWY2MzBiYWY2NDJhMTkiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6ImE2YTcxNTI1NzJlZTg0ZjEwOTA2Yzc0YjlmMmE5MjQzNGRkYWIwZTNjNDI4MTNiMDRlNTk3ZWZjZWM5NTFiMjYiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6ImE4MzE2YzliZDYyNGMyZGZlNDY0YWM0OWRmMTc1NGJhMmUwYmZmNDExMWUxNjJiYTBlZTNmYTA2YmUxZjI5YjAiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6ImY1MzAyNWUyNGM4MWQzYTg1NmI3OTdhZDA1ZTgyNGQ5YzRmZTIyYjA0MjI2ODZjNDFmY2RlYzkyNmM5YzBmZmIifQ"}]},{- "id": "claim_9b1e02a8d6e0423c9fb2574f36b64c65",- "statement": "Composed chains infer input and output types from their components via input_schema and output_schema properties, enabling validation without explicit type annotations.",+ "id": "claim_88fb051e28664e61aa973b27d2052376",+ "statement": "ProviderToolSearchMiddleware marks tools as deferred via extras['defer_loading'] and injects the provider's server-side tool search tool (Anthropic, OpenAI), allowing the provider to retrieve full tool schemas on-demand when the model needs them.","evidence": [{- "resource": "repo://libs/core/langchain_core/runnables/base.py#L157-L159",- "version": "repo-lines-v1:sha256:f592ce53680fb6597b6d31b1f0b0d5cd9ae6ebc63d6db571ec39134a843881c9:eyJzZWxlY3RlZExpbmVDb3VudCI6MywiZmlyc3RTZWxlY3RlZExpbmVIYXNoIjoiNGZmMzI4NTNlNzkzN2FmN2FjODEwMWRlNDk3MTU1NGJlM2ZjNGVlNTI1OTBlZDUyZjNjOTBlYTlhMjEzMjIyMCIsImxhc3RTZWxlY3RlZExpbmVIYXNoIjoiNGY2MzQzMjRhZGIwZTQyNDdlMjcxZDZiOTU5ODJlNTA5N2Q4YjM1ZjQyN2JjZDljMWU0ZGNkYTU5NWY2MDc1MiIsInByZWNlZGluZ0NvbnRleHRMaW5lQ291bnQiOjMsInByZWNlZGluZ0NvbnRleHRIYXNoIjoiYjEzMDQxZTZhMzBjZWJlNTQxMDcyMTk2YmU3ZGIyOGUzOGJmNzc3NDk4YjZhMzNmOTBjYmM3Yjg2YWM4M2Q1MiIsImZvbGxvd2luZ0NvbnRleHRMaW5lQ291bnQiOjMsImZvbGxvd2luZ0NvbnRleHRIYXNoIjoiOGJmZmIyODQ1MTY4ZmU1MTczYjM1MTc3NmQwZGNmOTcxMzgyYjg3NzYxMWMxMzJkMzVmNTU2YmFhYzY2NWE1YyJ9"+ "resource": "repo://libs/langchain_v1/langchain/agents/middleware/provider_tool_search.py#L57-L150",+ "version": "repo-lines-v1:sha256:14c5625a8fb07f71552bb2967c11a12628d5fbb2e2d46203185403ee43cbda11:eyJzZWxlY3RlZExpbmVDb3VudCI6OTQsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjVlMmRhODQ0NWI2NjkyNjM2YTgyMDYxZjdlYzA0NDJkODNkNDRmMDFlZjFkZjk2NzA3MTVlYzQ2ZmI5ZWFmNWYiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjU1MDMyZTk2NGQwOTMyMzUxZTVkMTg1MjY5MjgxYjE3MWEzYTA5YjA4YjI4NmU2NjFlYTQ3MDMyM2M4MmViNGQiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6IjA5ZjkzMDgzYzE5NzEyMWI5ODI3MDBiYThhZmFiZDE3MjJjZjFkM2U3NDA0NTA5ZTgwZWZhMjcyNDdmNjJmMDciLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6IjI3OTYwMTU2YTY4MmJiZjQxMDgwMDZiZTgzOGRhNDY0NmE5NTgwZWU2NjQyMGJjZTU4ZmI5MDk1MTBkZGE3YmEifQ"}]},{- "id": "claim_49de73792d784622bba1b2f4f6b4ec88",- "statement": "RunnableSequence and RunnableParallel are automatically serializable and support LangChain's tracing and callback system for debugging and persistence.",+ "id": "claim_473a4136c0a04dffa01ba9f91891567c",+ "statement": "Tool call wrappers compose into a stack (first = outermost), with each wrapper receiving a request and execute callback; wrappers can intercept, reorder, retry, or short-circuit tool execution.","evidence": [{- "resource": "repo://libs/core/langchain_core/runnables/base.py#L3210-L3218",- "version": "repo-lines-v1:sha256:8af5f7a2d4e8fda2e9a8b47e2fd3e74540279cae2b8fa87cdb906273a826ae81:eyJzZWxlY3RlZExpbmVDb3VudCI6OSwiZmlyc3RTZWxlY3RlZExpbmVIYXNoIjoiODIwYjQ1M2Y1ZTBjOTJkNWY2YzI1MWE1ZWExOTYwZDcyZjNiZDA3OTU2YWU4NTdkYTIwZTMxYTg4YzU1OTY5ZiIsImxhc3RTZWxlY3RlZExpbmVIYXNoIjoiNmY0NmQ3NDk4YTFhNmJiNDkwMmUzOGQyNzBkMjRiYWY2NzM4NzAxOGY3MzVhZTI2ZTVlMjRiYTQ5MmUyYzM4NCIsInByZWNlZGluZ0NvbnRleHRMaW5lQ291bnQiOjMsInByZWNlZGluZ0NvbnRleHRIYXNoIjoiY2ZlMWI1ZGFjMDE3YjE1NzEyNjQ1NWRlN2MzY2EzODU2OTE3NmRiOGZlYjRlMGU4ZDM0ZGMzZmY5YmMzNzU3NSIsImZvbGxvd2luZ0NvbnRleHRMaW5lQ291bnQiOjMsImZvbGxvd2luZ0NvbnRleHRIYXNoIjoiY2YyMWM0ZjQyMzMwMDZlMjViYWE1NjEzZDgwNDgzMWJkNzJlZGViY2U4YWVjYmQ5OTU3ODkxYzBmN2YyZmI5OCJ9"- },- {- "resource": "repo://libs/core/langchain_core/runnables/base.py#L3976-L3990",- "version": "repo-lines-v1:sha256:dcb170b588e742a6b114ec378abf0fe9adc59525cecfedf62848d5e95203bb96:eyJzZWxlY3RlZExpbmVDb3VudCI6MTUsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjgyMGI0NTNmNWUwYzkyZDVmNmMyNTFhNWVhMTk2MGQ3MmYzYmQwNzk1NmFlODU3ZGEyMGUzMWE4OGM1NTk2OWYiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjZmNDZkNzQ5OGExYTZiYjQ5MDJlMzhkMjcwZDI0YmFmNjczODcwMThmNzM1YWUyNmU1ZTI0YmE0OTJlMmMzODQiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6IjAzMjBjM2ZhOTJjODlmZTA3YjYzZjI3Y2Y2MzY2ZmNiNjM3YTZmNGI5M2E3ODAxMTIwZTU0NGQ5MzVkNGMwZDQiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6ImUwMWJiYmQwMjVkMTZmMjE0MzM1NWI0NGQ3MzQ1OWQ3MWQxODM5OTJlOGI3NTE2NWMxOTAxZjMxMTg0ZWYxODEifQ"+ "resource": "repo://libs/langchain_v1/langchain/agents/factory.py#L710-L756",+ "version": "repo-lines-v1:sha256:56c852c89a9b24b60c74e45a6b56253651cc33d730c2657532c1f4edd848348f:eyJzZWxlY3RlZExpbmVDb3VudCI6NDcsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6ImU2ODdkYjg2YjJiMmZlNjQ1ODFlZGExMWIxNTExNDQzZTAxZjgxMjgzMzhiYWU4ODY5NDQ1ZGE4ZDM4OGVmZDMiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjAxYmE0NzE5YzgwYjZmZTkxMWIwOTFhN2MwNTEyNGI2NGVlZWNlOTY0ZTA5YzA1OGVmOGY5ODA1ZGFjYTU0NmIiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6IjRhOGY1MmIzN2FjYjEwZWVjNzc0NzlmMzJjZTBmMGM2OWIwZGEzODhhMWZkYTJlNjMxYjRiOTU5ZTYwM2I2NmQiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6IjNkNjNjNGQ0NGMzY2QyNzU2YjVmZThiYmRmZDNhNjQwMzU2NzNlZDhhZGY3NGFmMmIzZDYzN2Q5YmE5YzI1MzEifQ"}]},{- "id": "claim_274df276f4164f0986482705d658ad40",- "statement": "RunnableSequence creates a callback hierarchy where each step is marked as a child run using run_manager.get_child(f'seq:step:{i + 1}'), and configuration context including callbacks, tags, and metadata flows through each step via patch_config while preserving parent context.",+ "id": "claim_15bcfbcecfb94f5c8a1b65b337f12d95",+ "statement": "Middleware can declare a custom state_schema extending AgentState; create_agent merges all middleware schemas left-to-right (first middleware overrides later conflicts), respecting OmitFromSchema annotations for input/output filtering.","evidence": [{- "resource": "repo://libs/core/langchain_core/runnables/base.py#L3447-L3456",- "version": "repo-lines-v1:sha256:d0e7a92d9bb4a4987f765dbcc982dfbb7cbbaec050279f5f19bc2d7009abfef9:eyJzZWxlY3RlZExpbmVDb3VudCI6MTAsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjQ0YzBmNTAyZmExMzg1NDI4MThmMTkwMGZhNzcxZDRlN2JhZTU1YWRhZDAwZWQ1NzdkMTYzODM4M2JlYzU3MTAiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6ImU2MDljZGZiZmUyOGNjYzdkMDUwNzBhZTQzYjczZWRlNzRkMmQwNTdmYThlNTE1MmQ0MzI5NTRhYzc1YWY0ZDUiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6IjViYzliOWZhYzZiMzE1NGQwZjJmZWE1ZGYyNzliNTM0ZDUwM2NhNzA4MTdlZDI3MDEzZjhiOGQzNTdlMWM1YWQiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6IjdhZmFmY2EzOWQwNGE0NjRiOWJiZmI0NDFmOTliMzlkMzUyNjY2YzE0ZGQxYmZlMzU2N2I4MjlmNDc4ZmU3YjgifQ"- },- {- "resource": "repo://libs/core/langchain_core/runnables/base.py#L3486-L3496",- "version": "repo-lines-v1:sha256:4d9bf0584cfa7573fd2f441840f6971314a47a6f3acf08dc5af80c2de1f5354f:eyJzZWxlY3RlZExpbmVDb3VudCI6MTEsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjQ0YzBmNTAyZmExMzg1NDI4MThmMTkwMGZhNzcxZDRlN2JhZTU1YWRhZDAwZWQ1NzdkMTYzODM4M2JlYzU3MTAiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6ImE4MzliNjRjZGI1M2NiNDMyZGUyMjUyZTQyNDk3ZGE5M2JkZDA5MDY2ZTQ0YjA4ZDQyNDY4NzhlYzFlMzhlYzkiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6IjViYzliOWZhYzZiMzE1NGQwZjJmZWE1ZGYyNzliNTM0ZDUwM2NhNzA4MTdlZDI3MDEzZjhiOGQzNTdlMWM1YWQiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6Ijc1NjliNjdkOWJjNmQ0NzQ3ZjY0YzNkN2M4MzNiNTVhMmJkN2Y1NGI1ZmMzM2Q5NWQ1NWVkZmY4MTNjMTA2OTkifQ"+ "resource": "repo://libs/langchain_v1/langchain/agents/factory.py#L470-L524",+ "version": "repo-lines-v1:sha256:153d997320fe740d99c810085479142edca654cc31fb26d9e04ac0f4d056aeed:eyJzZWxlY3RlZExpbmVDb3VudCI6NTUsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6ImZjMzliNTU0NjBlOTk3Y2YxYzM0NTIzYjY2ZjgxYzhmODNmZjg2YzRiNDhlNWE4MmRjMTYwNjk5NzQzOTk2ZTEiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjAxYmE0NzE5YzgwYjZmZTkxMWIwOTFhN2MwNTEyNGI2NGVlZWNlOTY0ZTA5YzA1OGVmOGY5ODA1ZGFjYTU0NmIiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6ImVjNWI4NzFjNWZhNDJkMDViMWZjMDc5ZjY3MDg1OWM4YzFjMTZhOWU3NjRiNWI0OTYwYTM1MWE4NzBlNmIzYTgiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6ImU4M2M2YjE4NWUzZWZiOGMxYjYzYTYyMjI2OGJmNTYxZjViN2ZmOGIwYWQ5NDJkMTk5MDUxMmMyOTJlMmQ2MDEifQ"}]},{- "id": "claim_ebc1bd417f0b442198f6e66629796024",- "statement": "RunnableParallel applies the same input to each branch concurrently; in callback traces, each branch key becomes a separate child run via run_manager.get_child(f'map:key:{key}').",+ "id": "claim_16d25dcd257e4d29bae4111b5fd8df53",+ "statement": "The runtime parameter injected into middleware and delegating tools provides access to checkpointer, store, and user context (Runtime[ContextT]), enabling subagents to coordinate state via the LangGraph store.","evidence": [{- "resource": "repo://libs/core/langchain_core/runnables/base.py#L4164-L4174",- "version": "repo-lines-v1:sha256:5bf1f50f53bb8f8e1a3c05c41d993c9fed86dfeb782eccd07cb1bf59f43a56de:eyJzZWxlY3RlZExpbmVDb3VudCI6MTEsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjI4YTQ3YWY2YjM4YTliMzJhYmQyYmViYmZmNmU4NGEzMGE2Nzk4OWMxNjU3ODJlMmVhNGFlNzg5NWI0MmMzMjAiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjUxMDM0ODFjNTdkMGYwZGMwZjc2Y2QyY2M4YjM2MDRjNGU4Mjk2ZGE0MTIyYWRkMTllODE3NDVkYzdlMzMxYTYiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6ImJkZWI1ZDYxMTQ2MjAxYjFmOGQ5OTM3MzU1NzNjYjdhYmZlOWJjNzJkYTU0ZmFhMTJiMjk3ZDdkZjM4OTA3YjEiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6IjYxN2Q4MDFkMTc2ODY4Y2JlOGM4NWQ0YzY3M2U4YjJlOWU4NDk1ZmVmYWUzNGU2Njc1NjhmYjBiZDhjMmJhM2UifQ"- },- {- "resource": "repo://libs/core/langchain_core/runnables/base.py#L4219-L4226",- "version": "repo-lines-v1:sha256:ac18e058dcc4a58e25df6dac933d7af8d6c098c931c190f2f5ce29352e420617:eyJzZWxlY3RlZExpbmVDb3VudCI6OCwiZmlyc3RTZWxlY3RlZExpbmVIYXNoIjoiMjhhNDdhZjZiMzhhOWIzMmFiZDJiZWJiZmY2ZTg0YTMwYTY3OTg5YzE2NTc4MmUyZWE0YWU3ODk1YjQyYzMyMCIsImxhc3RTZWxlY3RlZExpbmVIYXNoIjoiNTEwMzQ4MWM1N2QwZjBkYzBmNzZjZDJjYzhiMzYwNGM0ZTgyOTZkYTQxMjJhZGQxOWU4MTc0NWRjN2UzMzFhNiIsInByZWNlZGluZ0NvbnRleHRMaW5lQ291bnQiOjMsInByZWNlZGluZ0NvbnRleHRIYXNoIjoiN2M4NDBlMTdjY2E5NjQyMjI1OTViYzYwNWQ3NjM3YWY0YTNmMTgxODQ3ODVlNmYwMDY1OWFhMzQ3ZTI4ZWRlMiIsImZvbGxvd2luZ0NvbnRleHRMaW5lQ291bnQiOjMsImZvbGxvd2luZ0NvbnRleHRIYXNoIjoiNjE3ZDgwMWQxNzY4NjhjYmU4Yzg1ZDRjNjczZThiMmU5ZTg0OTVmZWZhZTM0ZTY2NzU2OGZiMGJkOGMyYmEzZSJ9"+ "resource": "repo://libs/langchain_v1/langchain/agents/middleware/types.py#L104-L105",+ "version": "repo-lines-v1:sha256:875a3037232baccff6f7e9cd6900d1394ba58b13de4e41f8f88754e78725ec7d:eyJzZWxlY3RlZExpbmVDb3VudCI6MiwiZmlyc3RTZWxlY3RlZExpbmVIYXNoIjoiNTQ4ZGMwZTRkYTUyOTI5YzU4MzhmZGIzZjQxNDVlMGYxYmViNGM1Mjc4N2Y3NmEwOWI0YTcwMGE1YzQ4YTZmOSIsImxhc3RTZWxlY3RlZExpbmVIYXNoIjoiODg4YTliM2Y5NWE3MmJjZDBmODMwMmY1N2MzZGMxMTU2Nzk4YWRlYzdjMmRiMTRhY2I1MThhNjQ4YjZiNzUyOSIsInByZWNlZGluZ0NvbnRleHRMaW5lQ291bnQiOjMsInByZWNlZGluZ0NvbnRleHRIYXNoIjoiODA2OTM5ZGU2NDhlNmQ5Mjg1MDIwNDJkYzY2MTY1NWZjOTFhODc5ZjU5MmZlZDg4OWQ3ZWFkNTRjZDZjMmRhMyIsImZvbGxvd2luZ0NvbnRleHRMaW5lQ291bnQiOjMsImZvbGxvd2luZ0NvbnRleHRIYXNoIjoiZDMzMTA5NWQ1ZmQ5NDk3ZjQzZGQ2OTAxYTkzZjc0M2JiNjU1NTA2YTA1MGUxNWMyODE1YmYxYzlkNGYxMzI5OCJ9"}]},{- "id": "claim_a0da484e66e343cf987c435a2a26e448",- "statement": "RunnableWithFallbacks wraps a runnable and fallbacks, trying the primary runnable first and sequentially attempting each fallback in order if an exception matching exceptions_to_handle occurs; it supports exception_key to pass the exception to fallbacks via the input dict.",+ "id": "claim_5453dc8149164b7b8368d5c69fa6af1f",+ "statement": "wrap_model_call middleware can return ExtendedModelResponse with a Command to control graph flow, enabling middleware to redirect execution (e.g., skip tool execution, loop back to model, or exit early).","evidence": [{- "resource": "repo://libs/core/langchain_core/runnables/fallbacks.py#L164-L212",- "version": "repo-lines-v1:sha256:245aae631fd62cf5e3cd37d608514d8ad809bf3054f8da12fb08c429908e25f6:eyJzZWxlY3RlZExpbmVDb3VudCI6NDksImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjQ0ZGE5MzUwMDE5ZGMxZTY2NzQ1MjY0Mzg3MzE2MTk5NzIyNWU5Y2U2MDEwN2FmN2I2NGY4NDBkZGVjZmRhNGYiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjFlYjkyNWVhYjkwYzkwNjk5M2EwMzljNGQ2OGY4OGIzZTlhZDI2OGJmMDc1ODA2MDhhN2RiN2MxNTFjN2JiNWQiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6ImNiODAzNzNmZDEyMWZkMzY0MDc4YjdkY2M4ZjRmZThlNWMzYWZjZTI2NTQ5ZTExODUzZmU3NDk2MjE0NWIwNDciLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6IjU3ZGNlNTdlMDdiMTM0MmRhY2YxNmNiZjNjMTllMzUxMzFmNWM0YTg3MGU2M2EyMGY3MGI2Y2ZkYjVkMjFhYzQifQ"- },- {- "resource": "repo://libs/core/langchain_core/runnables/fallbacks.py#L37-L105",- "version": "repo-lines-v1:sha256:298e9e16ea96e447152343b16c28a94ff04c581b0e1ff6314fd9aff81412108f:eyJzZWxlY3RlZExpbmVDb3VudCI6NjksImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6ImZjZTk5NmEzNTY1YmNjYTgwNzA3NjA0NjMxZTY5NzhlNjM5ZmQxOTJiMTg3NGYxOWI1YmNjNDFhZmY1NDAwYmUiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6ImE2YTcxNTI1NzJlZTg0ZjEwOTA2Yzc0YjlmMmE5MjQzNGRkYWIwZTNjNDI4MTNiMDRlNTk3ZWZjZWM5NTFiMjYiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6ImJlYjkxZDk0MWU1MDQyNWVjN2E4ZTBhMjFkMmE1MmZjNWQ5OTM5MWY3OWJiN2NmOGU1N2MyNmVmNjkyNGU3NGYiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6ImUwMWJiYmQwMjVkMTZmMjE0MzM1NWI0NGQ3MzQ1OWQ3MWQxODM5OTJlOGI3NTE2NWMxOTAxZjMxMTg0ZWYxODEifQ"+ "resource": "repo://libs/langchain_v1/langchain/agents/factory.py#L222-L278",+ "version": "repo-lines-v1:sha256:6bb49e7a7e6403834213953a9111549f15c00024566792a43dc06e6452e013b7:eyJzZWxlY3RlZExpbmVDb3VudCI6NTcsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjM3YzgzN2QxZjhjOGZmMTQ2ZGFkODY5ZTlhZDhkMGNjYzY2YTA0Y2JhNjVkNzBhYTM5ZDUxMDAwNTQzMzFiNGYiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6ImYyNmQ2OGQ5YjUyMjFlYjU5NGVmOGJjN2JmZTNhYzVhNjM2ZjA2MjlmNmU1ZGNmNmE5NWEyMGZmMThhZDdmMzAiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6ImQ3MjIzMTA2ZmQ4NzQyYjcwZWEyMzNmOWRjMzU5ZjRiMDJiYmIwNjliNzI4M2VlZjc2MjQ5OTUxNmJkN2I5YzgiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6IjRiN2UyMTk1NWE5MGNjNjVhNmY1YmQxNTE2ODEyYThmYTQzYmNmZDhiZWJiMzMwNDJiMzg4NDZjMmUzNzYwNzQifQ"}]},{- "id": "claim_fc2ef09032cc48cbb7fb1ddcc920cbe0",- "statement": "The with_fallbacks method on any Runnable returns a RunnableWithFallbacks instance that tries the original runnable followed by each fallback in order, with control over which exceptions to handle and optional exception passing to fallbacks.",+ "id": "claim_fa44080900eb4caab753052c9b127f6f",+ "statement": "The jump_to field in AgentState is ephemeral (not persisted) and set by middleware to override default routing: 'tools' skips model, 'model' loops back, 'end' exits early.","evidence": [{- "resource": "repo://libs/core/langchain_core/runnables/base.py#L2188-L2264",- "version": "repo-lines-v1:sha256:98f8c09434deaeab4fa002aff9e2811f173ab68db004fa38ae7ed50afc6c8c63:eyJzZWxlY3RlZExpbmVDb3VudCI6NzcsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjE5ZjdjYjFlODMyZDUyOGZjNjFkOGU5YTg1NzYyNmVmYWRmNDI1NDlhY2YwMzU0YzVkYjMwYzU1M2E5MzQ5ZTYiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjU5MDlhNTNhNjE4ZDAyOGUxZDMwMDBjMGE3YWJjZWVjYmU1ZmIzN2Y0ZTUxMWVmZTQ2NjQzZmFkNmU2Njg3MmYiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6IjA3ODQ4NzIyMWE5ZGZiYTkxYzJmNjcyY2JkYmNiOGRhZjRlMDBhZjc2ZWM2NjFmNTI3M2NjOTZhMzMxYzNlNjIiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6ImM5NTkzNDRiYjIzMGEzZDZiM2M1ZWFhNWMwYzg3NzEyNTFhYzU2YzliZjJjOWVjNmViMmJiYTBiNTEzYjhiZmMifQ"+ "resource": "repo://libs/langchain_v1/langchain/agents/middleware/types.py#L349-L354",+ "version": "repo-lines-v1:sha256:c995df23d29c623277091b5c9a18504b94c75d83702467cccbe504b1ac99b777:eyJzZWxlY3RlZExpbmVDb3VudCI6NiwiZmlyc3RTZWxlY3RlZExpbmVIYXNoIjoiNGFjZWQyZjg0ZWIyYWYyZTEwM2QyMGNiMDBjY2ZmYzlmNzI3NmJlMWU3ZTc3ZDdlNzQ2M2U4ZjVjN2RhNjMxNSIsImxhc3RTZWxlY3RlZExpbmVIYXNoIjoiMGIzOTE4NzQ3OTQ1N2E1YjMzYjc0ZWU2Yjk2YjM4OWFmYWUwYTYyZmRjMDkzMjljZjhhZTgyMWQzNDc3MmE1ZiIsInByZWNlZGluZ0NvbnRleHRMaW5lQ291bnQiOjMsInByZWNlZGluZ0NvbnRleHRIYXNoIjoiZDU1MDllNzI0MjBmNWM3NGRkY2MyYmE2YmY5NzI2Y2Y4Mjc4MDYzOWIzMTdlNTIzMDY4ODNiN2YyNDkyNjJlMyIsImZvbGxvd2luZ0NvbnRleHRMaW5lQ291bnQiOjMsImZvbGxvd2luZ0NvbnRleHRIYXNoIjoiZWE2ZDczZWY1MTNjNDcwNmU4YzA5MDNhOWI4OTdmZmQxZDdlYTU1NjNhMDYzZWQ5NTJlNThjMDM3NmQ4NWZjNiJ9"}]}],"verification": {"by": "openwiki/0.5.0",- "at": "2026-09-28T08:35:20.640Z"+ "at": "2026-10-20T08:25:57.412Z"}}diff --git a/openwiki/.claims/dev-commands.json b/openwiki/.claims/dev-commands.jsonindex 2f9646b409..73625a8f45 100644--- a/openwiki/.claims/dev-commands.json+++ b/openwiki/.claims/dev-commands.json@@ -1,6 +1,6 @@{"schemaVersion": 1,- "pageVersion": "sha256:0ec51ab0fa47477f5eb49c0577be6cd4558b283f0a678cd572dc0f65f65db57a",+ "pageVersion": "sha256:1e077d6d230b10aa6ab972d1298a9c1184b176fb5533a82ad57fd71e41255e15","claims": [{"id": "claim_42b2b3c1ac6e4a938efa7b2651c79b81",@@ -173,10 +173,88 @@"version": "repo-lines-v1:sha256:c0433ebed594f01b0643c125280438a8183bd59aed0a94fdd5e84113fbccc255:eyJzZWxlY3RlZExpbmVDb3VudCI6MzUsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjMyYTMxYjRjNTM4MzU0MjU1YWM5ZDllODJmMzgyYzg4YzAzYTQ1ZjZiNTg4MGJjNjQ3NTNlZTUyMmVmN2MxNDciLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6ImIyZTNjZGE3ODE1MTM2MDE1MmI4YWM1ZWEwYTdkNmU1NWJkNzQxYjM1YWU1YWE3ZGVjMzU5M2ZmOTlmNzY4N2QiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6Ijc0ZWJhYzU1OWIxOGIxZWE4ZTkxZWUzMGM3YmE0ZWMxMGY4YTU5OGQ5NDNkYThmZDI1NDRkMzJlNGZlZWYwMDIiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6ImVjYTkyZmFmYjU5MjhjZDgyOTUzZGU5OTNkMjBjNTIxZGMxYjdmNjhmN2E1ZTE2ZWRiOGFlZmFiZGJhMGYwMGIifQ"}]+ },+ {+ "id": "claim_a07150e6a5244c0ab7fc6bec6f965d17",+ "statement": "Pre-commit hooks can be bypassed temporarily using git commit --no-verify to skip all hooks, or via SKIP environment variables to skip specific hook IDs. This is useful for emergency fixes but should be used cautiously.",+ "evidence": [+ {+ "resource": "repo://.pre-commit-config.yaml#L1-L20",+ "version": "repo-lines-v1:sha256:74ca9ea8cd3247d7276c9ac077bd41e3c614e8c1cf9432ebbee628f0037d4947:eyJzZWxlY3RlZExpbmVDb3VudCI6MjAsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjVhMTEwZGI1YTkzNTdjZGExZDc4MjE2Y2RjMGJmOGIyNTVlMzM4Y2JjMWYzMjdlMGRmMDhjZmM3NzM5MWRkZWYiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjAxYmE0NzE5YzgwYjZmZTkxMWIwOTFhN2MwNTEyNGI2NGVlZWNlOTY0ZTA5YzA1OGVmOGY5ODA1ZGFjYTU0NmIiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjowLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6ImUzYjBjNDQyOThmYzFjMTQ5YWZiZjRjODk5NmZiOTI0MjdhZTQxZTQ2NDliOTM0Y2E0OTU5OTFiNzg1MmI4NTUiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6IjMxOGIxYmQ3ZGY4Y2M5ZDkyNDQ2ZGI1OWYyNDBmNDYzMzk4YzVhZTZiNWNhZTRjNWZhYTNiMWZiOTAwMzQ2ZTcifQ"+ },+ {+ "resource": "repo://AGENTS.md#L104-L110",+ "version": "repo-lines-v1:sha256:89359126bdc4975f884912b94afd456271823916329c98c027a51fc973c20ac6:eyJzZWxlY3RlZExpbmVDb3VudCI6NywiZmlyc3RTZWxlY3RlZExpbmVIYXNoIjoiOTk1NjkyZGQ0ZDdlN2M2ZjViYTM4MDczZmI3MTFlYTEwMGFmNTkzYjI0MmNhNzU1ZmU1MTdjNmQ2MzIyYjNlYyIsImxhc3RTZWxlY3RlZExpbmVIYXNoIjoiMjU3NGU3ZDE3NjY3YjNkM2FjYTNlOWExNzkxMDdlYmFiYjQ3NzVkOGJkNGVhN2VmYWI2MWYzMjAzMDZkMzZjYiIsInByZWNlZGluZ0NvbnRleHRMaW5lQ291bnQiOjMsInByZWNlZGluZ0NvbnRleHRIYXNoIjoiZmM3N2EzYWRhZjM4YzQ0NjNiNjNmOWFjYTgwY2YwMDZiNjFhYzg1ZjAxMGY3MDJiMTI5ODFlMDhjMjJjZTBjMyIsImZvbGxvd2luZ0NvbnRleHRMaW5lQ291bnQiOjMsImZvbGxvd2luZ0NvbnRleHRIYXNoIjoiNjk3YmI3MDA2ZTliZjljODU4YzA0ZDRiMGE5ODMyMGJlZjE3ZGRiNDY0ZjllYjNlOThlYjJiNmI2OTRiYjQxOSJ9"+ }+ ]+ },+ {+ "id": "claim_ea8ab007e4fe49ff83e7c06adbbbe76b",+ "statement": "PR titles must follow Conventional Commits 1.0.0 format with required scope: type(scope): description. Types include feat, fix, chore, docs, refactor, perf, test. Scopes are required and include core, langchain, partner names, infra, or docs. Description starts lowercase unless first word is proper noun or code entity.",+ "evidence": [+ {+ "resource": "repo://AGENTS.md#L104-L121",+ "version": "repo-lines-v1:sha256:4fa7bb13d48776e098aeba194768d08690351f224233df3fc3718edaf9c7d91f:eyJzZWxlY3RlZExpbmVDb3VudCI6MTgsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6Ijk5NTY5MmRkNGQ3ZTdjNmY1YmEzODA3M2ZiNzExZWExMDBhZjU5M2IyNDJjYTc1NWZlNTE3YzZkNjMyMmIzZWMiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjAxYmE0NzE5YzgwYjZmZTkxMWIwOTFhN2MwNTEyNGI2NGVlZWNlOTY0ZTA5YzA1OGVmOGY5ODA1ZGFjYTU0NmIiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6ImZjNzdhM2FkYWYzOGM0NDYzYjYzZjlhY2E4MGNmMDA2YjYxYWM4NWYwMTBmNzAyYjEyOTgxZTA4YzIyY2UwYzMiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6ImFlYWEyMDdlOWEwZWY4ZWMyZjI0MjU2YmYyYmUzYTc4OGIzOWYxNjdlNjI4N2U5Mzc2MThhNjlhYmZhMThhNjUifQ"+ }+ ]+ },+ {+ "id": "claim_ea6e1f914acb4615bc55d8b9f39b2d76",+ "statement": "Makefiles accept environment variables to customize test execution: UV_FROZEN=true prevents lock changes, TEST_FILE specifies test path (default tests/unit_tests/), PYTEST_EXTRA adds extra pytest flags, LANGGRAPH_TEST_FAST=1 uses in-memory services (fast mode) or =0 for Docker services (full mode).",+ "evidence": [+ {+ "resource": "repo://libs/core/Makefile#L6-L11",+ "version": "repo-lines-v1:sha256:73679d7a19faa0fb0353c360aa9a7edc69a01c7796bfbb91a15d33f0587b8e24:eyJzZWxlY3RlZExpbmVDb3VudCI6NiwiZmlyc3RTZWxlY3RlZExpbmVIYXNoIjoiMDlmM2E3MjQxYTY2Yjc2MDBiMzYzNWJmZDc3MTgwZTg0NjZhNmQzNjFkNGM4ZjVlODhmYTMxYWU1ODIxNmQ3ZCIsImxhc3RTZWxlY3RlZExpbmVIYXNoIjoiZGJmN2M4YzA4ZDAxZGRlYzllOTUxYTcwNTU4Y2U2MmRlYzFlY2ZjNmU0OTZkMWM2MzYzMTQ5YjQyYTY5MWRmYSIsInByZWNlZGluZ0NvbnRleHRMaW5lQ291bnQiOjMsInByZWNlZGluZ0NvbnRleHRIYXNoIjoiMjQxMjY2NDYzYzFhN2RkODBhMjhjMTA0OWRiNjRiZjc3YmQxNjhmMTlhOWRhODliOTYzZDlkMDc2YTEyOWQyNCIsImZvbGxvd2luZ0NvbnRleHRMaW5lQ291bnQiOjMsImZvbGxvd2luZ0NvbnRleHRIYXNoIjoiYmRhY2ZkNWNkNWFhNzhjNGVhMDE0YmM0MTVjMDE3ZGVmMDQ1NjdlZmM5NzM4ZmMyNjFkNDM1M2U4NjE5YmRkZSJ9"+ },+ {+ "resource": "repo://libs/langchain_v1/Makefile#L40-L44",+ "version": "repo-lines-v1:sha256:ae657b84ebf74f18cd8f352372e385423674748f29988c98ec68800c9db77695:eyJzZWxlY3RlZExpbmVDb3VudCI6NSwiZmlyc3RTZWxlY3RlZExpbmVIYXNoIjoiZDAwN2I1MTE4ODQ1MWRiMzc5M2FlMjRlYTE3OTQ4NTgzNjcyZWM1NTE0MmFmYWI5NWYzMTQxM2RmMTFkNWI5ZiIsImxhc3RTZWxlY3RlZExpbmVIYXNoIjoiYjJlM2NkYTc4MTUxMzYwMTUyYjhhYzVlYTBhN2Q2ZTU1YmQ3NDFiMzVhZTVhYTdkZWMzNTkzZmY5OWY3Njg3ZCIsInByZWNlZGluZ0NvbnRleHRMaW5lQ291bnQiOjMsInByZWNlZGluZ0NvbnRleHRIYXNoIjoiODA2YjQ0OGUzY2QwN2QwNmQ1NTYzNmY0MDA1OTMwMDkxNTJlNzQ2ZTg4ZGYyYzFkYjMzZWUzZmI1ZDgyNmM4OSIsImZvbGxvd2luZ0NvbnRleHRMaW5lQ291bnQiOjMsImZvbGxvd2luZ0NvbnRleHRIYXNoIjoiZWNhOTJmYWZiNTkyOGNkODI5NTNkZTk5M2QyMGM1MjFkYzFiN2Y2OGY3YTVlMTZlZGI4YWVmYWJkYmEwZjAwYiJ9"+ }+ ]+ },+ {+ "id": "claim_aac1134248334f238d9eff8752b12b7a",+ "statement": "Key uv commands for development are: uv sync --all-groups (install all dependency groups), uv sync --group test (install test group only), uv run --group test pytest (run command in environment), uv lock (update lock file), uv run --with 'pkg>=1.0' (temporarily add dependency). uv manages virtual environments automatically without manual activation.",+ "evidence": [+ {+ "resource": "repo://AGENTS.md#L43-L92",+ "version": "repo-lines-v1:sha256:f890ddafce615af5d0802ee7b1845641aefb47e84ee3ceaa94540b3efdea68bb:eyJzZWxlY3RlZExpbmVDb3VudCI6NTAsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjAxYmE0NzE5YzgwYjZmZTkxMWIwOTFhN2MwNTEyNGI2NGVlZWNlOTY0ZTA5YzA1OGVmOGY5ODA1ZGFjYTU0NmIiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6ImUxODcyM2ViODY5MjVhYmMxYTFlMDU3NjVlZGJlNDgwOTc5ZmQ0NjBjMmJmNWUyOGUzZTRjOTBiNDkwZDIzNDMiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6IjQyNjM5NDU2ZjM1NzY3NDE2NTFhNjg0ZjBjOGQ0YzA0MzUzNDVkODE5OTI2YjkwNjYwMTkyMmZkMmQwMDc2OGEiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6ImM0NTEwNjhkNWY2ZjMyNGRlMTFmYTdmZTc0NzM4OGJmNWUzYjY2NWRjNDY3ODdhYjcwOTZlZjk1MjcxZGE1NWUifQ"+ }+ ]+ },+ {+ "id": "claim_81a6443ef80645c2b8b69516ce08e140",+ "statement": "Makefiles provide lint_diff and format_diff targets that operate on git diff output against master branch, enabling fast iteration by checking only changed files instead of entire codebase.",+ "evidence": [+ {+ "resource": "repo://libs/core/Makefile#L51-L55",+ "version": "repo-lines-v1:sha256:9f5a2e561e3275f46c3e9fa8ebe34939fe74f4eef608d61ae98f1d111a82f499:eyJzZWxlY3RlZExpbmVDb3VudCI6NSwiZmlyc3RTZWxlY3RlZExpbmVIYXNoIjoiYjBlODAzYzhjNzA1ODZjODIwYjFlYTkyMDBkYmMyMzJjY2Y1NzZhM2QwZDA0MzVkNDU3OTg4Y2IwMzBjMDgxNSIsImxhc3RTZWxlY3RlZExpbmVIYXNoIjoiYzJmZDZjYmEyOWNhYjZlZjI1MmExOWM5YWQwMThhNDM0MmU0MWVkNzk3Njc1ZDA1OTkzMGUyNzIxOGIwNTA0ZSIsInByZWNlZGluZ0NvbnRleHRMaW5lQ291bnQiOjMsInByZWNlZGluZ0NvbnRleHRIYXNoIjoiOGMyYWUzN2NkNTJjZTk1MDY4ZDQ1OTRmYTM3YzIyN2EzZmEzNDYwYjMyZGM0MmEwYmM0OTkxZGVmZmQwYjYwZSIsImZvbGxvd2luZ0NvbnRleHRMaW5lQ291bnQiOjMsImZvbGxvd2luZ0NvbnRleHRIYXNoIjoiNzRlNThkM2VjZjA5ZWFhODM4NGFjNWQ1ZmJjM2QyYzFiNTRjMjdkYWE4OTJlMGY4MzJiMTZlMTdhN2RlODYzYSJ9"+ }+ ]+ },+ {+ "id": "claim_f6155da0db5e46ae8d7144e735d35aa4",+ "statement": "Partner packages like anthropic support testing with multiple SDK versions using uv run --with 'sdk>=version' syntax, allowing compatibility testing across major version boundaries defined in partner Makefiles.",+ "evidence": [+ {+ "resource": "repo://libs/partners/anthropic/Makefile#L16-L24",+ "version": "repo-lines-v1:sha256:3f10aaecf4e2276489edb69ae64a3db24ef290b0c07ae96c0eb2e54e66ff39ea:eyJzZWxlY3RlZExpbmVDb3VudCI6OSwiZmlyc3RTZWxlY3RlZExpbmVIYXNoIjoiMDliMzBjZTkzZjhkMmVlNmQ2NDdlYjNhN2RhYjQ0NjRiNWQ5Yjc5ZGExOTI4ZGE2MDY4MDQ3M2QyY2Y0ZTY4MSIsImxhc3RTZWxlY3RlZExpbmVIYXNoIjoiMDIzNzFjN2Y1YWRlNmI0ZWRkOTIyYTI2NWFiMDRmZDkxZGZmZDMyNzA3OTNjZmQ3ZGQ5MzRhM2FkNmY5MDUyZCIsInByZWNlZGluZ0NvbnRleHRMaW5lQ291bnQiOjMsInByZWNlZGluZ0NvbnRleHRIYXNoIjoiNTczZDhmNTY3ZTk0ZGI1NWM1NjQxMjFmZTkzMzgyZjhhNzc2NzFiZGVhNmFkZmIyZDg3NTY3Y2U5ZTZkYmVkMiIsImZvbGxvd2luZ0NvbnRleHRMaW5lQ291bnQiOjMsImZvbGxvd2luZ0NvbnRleHRIYXNoIjoiZmNlNGVlYjJlZGM5OWFiNzIxYTJmNTJhOGZhODc5YjM0ODY1MzUzNWViZTA4ZTUxNDdmZmE2MzkwM2IxZjRkNSJ9"+ }+ ]+ },+ {+ "id": "claim_9e124714df034decb29e860484d2c3ee",+ "statement": "The TEST_FILE parameter accepts file paths, directory paths, or pytest node identifiers (file::Class::method), enabling fine-grained test execution control via make test TEST_FILE=<specification>.",+ "evidence": [+ {+ "resource": "repo://libs/core/Makefile#L6-L20",+ "version": "repo-lines-v1:sha256:49331aac0aaf2f1f6605ffda4dd077faa6c95b17a8c6b0acb4b1dba1c78fa0de:eyJzZWxlY3RlZExpbmVDb3VudCI6MTUsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjA5ZjNhNzI0MWE2NmI3NjAwYjM2MzViZmQ3NzE4MGU4NDY2YTZkMzYxZDRjOGY1ZTg4ZmEzMWFlNTgyMTZkN2QiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6ImE3ZmJkODA0MTFhY2VjZGQ5MThiODg5ODQxNzE4NzBmOTVlOGYxN2E2YjQwNGJlODA2NGJhNzZiYTY3NjQ5NzciLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6IjI0MTI2NjQ2M2MxYTdkZDgwYTI4YzEwNDlkYjY0YmY3N2JkMTY4ZjE5YTlkYTg5Yjk2M2Q5ZDA3NmExMjlkMjQiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6Ijc4Mzc0NWU1NWEyM2JiNDM2Y2E1MTBhYjE4MDRkMjgzMDI4YTUyZTc3OTIxOWJjZTcwMjg0ZDlmN2IxMDA3MTAifQ"+ }+ ]}],"verification": {"by": "openwiki/0.5.0",- "at": "2026-09-28T08:35:20.640Z"+ "at": "2026-10-20T08:25:57.412Z"}}diff --git a/openwiki/.claims/integration-tests.json b/openwiki/.claims/integration-tests.jsonindex d84c2f7114..4769c89e8f 100644--- a/openwiki/.claims/integration-tests.json+++ b/openwiki/.claims/integration-tests.json@@ -1,6 +1,6 @@{"schemaVersion": 1,- "pageVersion": "sha256:7a27a082b6fe0666d7a3e17b00aac82017d7095d7cc66a084355eb8c5f47b347",+ "pageVersion": "sha256:1be30d833c732d00acbcfab6fd7f39ef050985ef73799852adb7e8a2c9de0ad7","claims": [{"id": "claim_2b394255185b4645a1dcf0e8c628a197",@@ -193,10 +193,182 @@"version": "repo-lines-v1:sha256:e3d0704dff8fca8d0a61d64b2b6b1bd421654204ab5faef64b64dd5b52df2ddf:eyJzZWxlY3RlZExpbmVDb3VudCI6MjYsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjYxNzhlNTQ1YjAyMTRlNDM2NDIxYTRiMzBiZDQ0NThjNDgxZGY5OTY5NWRkNjRmZjhkNmM1MDkxMTZjMmE5NTIiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjAxY2I2ZmI5YmVjNzJmZjA3ZTY4MDU0N2M3NTAyMzZkYWZmNDMzOWVhZTY5ODBkM2IwOTQwMmRkYmE4YzcwOTMiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6ImQzZDE3MWRlNzU0MzFhMDIxYTBkOTRmYTc2ZmFiZjBkNzEzOWM4OThjMWEwYjQ0YjQzY2E2MDkwM2ZhMWI4NDUiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjowLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6ImUzYjBjNDQyOThmYzFjMTQ5YWZiZjRjODk5NmZiOTI0MjdhZTQxZTQ2NDliOTM0Y2E0OTU5OTFiNzg1MmI4NTUifQ"}]+ },+ {+ "id": "claim_7fb967225d9e4e33a19b95e5bf26276b",+ "statement": "LangChain integration tests use three pytest markers to classify test types: @pytest.mark.vcr marks cassette-backed tests that replay recorded interactions (run in PR checks with --record-mode=none); @pytest.mark.scheduled marks live-API-only tests that are skipped in regular CI but run in scheduled daily workflows with real credentials; unmarked tests are offline and don't require credentials.",+ "evidence": [+ {+ "resource": "repo://.github/workflows/integration_tests.yml#L1-L100",+ "version": "repo-lines-v1:sha256:ad34890d280cfbf4d14636f6d707f6de1cb2ed421e1f23459e77eab57a3cc5f0:eyJzZWxlY3RlZExpbmVDb3VudCI6MTAwLCJmaXJzdFNlbGVjdGVkTGluZUhhc2giOiI2Nzc2ZDc3MjE0ZWE5NGJiZDcyY2VkMDZjNDljZWJkOTUxY2M5MjI2NzNiZmE0NWEyY2UyZTQwNmM0MmJlMmMyIiwibGFzdFNlbGVjdGVkTGluZUhhc2giOiIzMjgwYjQ1ZWRlZGRhMTVmNTVjMWFjM2E3MzMzNjg2NjEwOWU0NWNiMjA3ZWU5YjU1OGU3ODhlM2ZiNWY0NWJmIiwicHJlY2VkaW5nQ29udGV4dExpbmVDb3VudCI6MCwicHJlY2VkaW5nQ29udGV4dEhhc2giOiJlM2IwYzQ0Mjk4ZmMxYzE0OWFmYmY0Yzg5OTZmYjkyNDI3YWU0MWU0NjQ5YjkzNGNhNDk1OTkxYjc4NTJiODU1IiwiZm9sbG93aW5nQ29udGV4dExpbmVDb3VudCI6MywiZm9sbG93aW5nQ29udGV4dEhhc2giOiIwNmNhNDM5YTA2YmZiMzE1MjgyOTc1YTI5YzkwMGEyYmU5YzFmY2FkMjg1YTExM2NlMzAyNjM1NmNjYTdhZWRjIn0"+ },+ {+ "resource": "repo://libs/partners/openai/tests/integration_tests/chat_models/test_base.py#L58-L78",+ "version": "repo-lines-v1:sha256:26638124d864750acfe43d1ed037e3ab197666170c26078a25a9055fce2c9342:eyJzZWxlY3RlZExpbmVDb3VudCI6MjEsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjBhYTVmMDdkNWFiZjU5NDNiM2ZiMzA1ZjI1MjAwY2IyNTBjOTQ2ZTUzYmNlODczOTAwNzFiMWU1MDllYWQxNmUiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjAxYmE0NzE5YzgwYjZmZTkxMWIwOTFhN2MwNTEyNGI2NGVlZWNlOTY0ZTA5YzA1OGVmOGY5ODA1ZGFjYTU0NmIiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6IjE1N2E4OGI0ODlkNjgxMjhkM2IyNTY0OTNkMTJhN2E1ODc5NTczNmQ1ODI3ZGJmZjA3ZWZiMmFiZmE1MWVhNTkiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6IjczZDE1OGFhYWM0ZTAzNDRjOThiOGRkZDIwNzZkMjI4NTQ5OTE4YzBjYTJlODUwZDM1NGY4OTgyYTk4NzM1NTEifQ"+ },+ {+ "resource": "repo://libs/partners/openai/tests/integration_tests/embeddings/test_base.py#L38-L65",+ "version": "repo-lines-v1:sha256:1742e07119bcb09e5aa43e3f10728a3b7029f7e0ce6267274eef8fabac5c0ddc:eyJzZWxlY3RlZExpbmVDb3VudCI6MjgsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6ImI0NTMyNDc0MGJmZmMzYjk1Zjk0ZGIyZDdiM2Q1MGU1ZDkxMDEyNmUzNTllOTYzOGU3Y2I1NTIzZjFjMjQwM2IiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjI4ODFjYjgwMGJhOTI5YzcwYmY5OWY5YjRiZTYyMmZjYThhNDY1NTkyNTkwMzVmNDJkMGMyZjA4ZjBhY2RhOTkiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6IjBmY2Y2ZDYxNzNhNTA3NTQwMjNjYjFjOTVjZDBhYTU0YjQxNGYwY2M0ZGY1NGExNDQ4MGI3NjI3MWZiNzE5ODEiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6ImQxOTNlNmJiZjNkNWE0ZTY5MTM4NzBhMGUzNjUyNjAxYzkxMDAzOWVjYjZkYjI4MWM0NDNmZjA5YTE4N2M3NmEifQ"+ }+ ]+ },+ {+ "id": "claim_09427430956f4c3d8c39687af0212d84",+ "statement": "VCR (Video Cassette Recorder) records HTTP interactions during test execution: in recording phase, the test runs with a valid API key and --record-mode=once/new_episodes, VCR intercepts HTTP calls, scrubbing functions redact sensitive headers (authorization, cookies, organization) and OAuth secret fields in request/response bodies, then the cassette is saved as compressed YAML (.yaml.gz) and committed to git. In playback phase, VCR loads the cassette and replays pre-recorded responses without making live calls or requiring credentials.",+ "evidence": [+ {+ "resource": "repo://libs/partners/openai/Makefile#L40-L43",+ "version": "repo-lines-v1:sha256:11e8869cd9ad3d186371833270e57f6b9b33e6bfb1fb7b21204584ccecc8bddf:eyJzZWxlY3RlZExpbmVDb3VudCI6NCwiZmlyc3RTZWxlY3RlZExpbmVIYXNoIjoiYWE5YjMxNjhmZmFkM2U1NDQwMzY3Y2Y1NTg2OTAyZTE1NGNlMWJmYWJmOGM5ODlhNjUzYWRiZGQ1ZDgxZTU3OSIsImxhc3RTZWxlY3RlZExpbmVIYXNoIjoiZDhiZTQwMTJkYzZlODBmMGRhYTAwNWMwYWI5MDBkODY0M2UyMWE5NTVkNDZiYTlkZGJiZDk2ZDVmNDM5Zjg1ZiIsInByZWNlZGluZ0NvbnRleHRMaW5lQ291bnQiOjMsInByZWNlZGluZ0NvbnRleHRIYXNoIjoiNDgwZjAyNjdlOGNlNzQ5ZmY3YmVhMWQ0NGJmZTc4MmMzZWI1NjRlMDIxMDVlZGZkYjQ2MjNlMjU2ZjA5ZDQwYyIsImZvbGxvd2luZ0NvbnRleHRMaW5lQ291bnQiOjMsImZvbGxvd2luZ0NvbnRleHRIYXNoIjoiZmNlNGVlYjJlZGM5OWFiNzIxYTJmNTJhOGZhODc5YjM0ODY1MzUzNWViZTA4ZTUxNDdmZmE2MzkwM2IxZjRkNSJ9"+ },+ {+ "resource": "repo://libs/partners/openai/tests/conftest.py#L1-L249",+ "version": "repo-lines-v1:sha256:b85e00ecaa85790473365ec6ee983a68cac7244ca3be79b50cde32a75f250676:eyJzZWxlY3RlZExpbmVDb3VudCI6MjQ5LCJmaXJzdFNlbGVjdGVkTGluZUhhc2giOiJjZjIzNDc5YTZiNDFhOGU5NGRkNTk5OWUzNjgzNDFhMDRiMTM1OTQ3OWZiMzM4MTA4MDk2MGI5YWVlMjJlMjkyIiwibGFzdFNlbGVjdGVkTGluZUhhc2giOiI1Yjg0MzIyZDBmMzg1NDQ0M2U0YzU1ZDNlMjkzNmNkM2QwZGY2OGJmMjlmZWVlYjE4OTVlNTkwNGQwM2I4YTg0IiwicHJlY2VkaW5nQ29udGV4dExpbmVDb3VudCI6MCwicHJlY2VkaW5nQ29udGV4dEhhc2giOiJlM2IwYzQ0Mjk4ZmMxYzE0OWFmYmY0Yzg5OTZmYjkyNDI3YWU0MWU0NjQ5YjkzNGNhNDk1OTkxYjc4NTJiODU1IiwiZm9sbG93aW5nQ29udGV4dExpbmVDb3VudCI6MCwiZm9sbG93aW5nQ29udGV4dEhhc2giOiJlM2IwYzQ0Mjk4ZmMxYzE0OWFmYmY0Yzg5OTZmYjkyNDI3YWU0MWU0NjQ5YjkzNGNhNDk1OTkxYjc4NTJiODU1In0"+ },+ {+ "resource": "repo://libs/standard-tests/langchain_tests/conftest.py#L85-L143",+ "version": "repo-lines-v1:sha256:0847d3b4c21779d53de43eaa537155485dbdc62d2e1b37090ac0037e49bc7e4f:eyJzZWxlY3RlZExpbmVDb3VudCI6NTksImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjMyZjBhNjBhZTkwYjJkYTExMDk5MjU1OTM2NTZjMzRhM2QwYTk3YTkxNWFmZDNmMzEyMTRhNzIyMDU1NmQ3YTYiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjQ4OTNmNDBlMzc4MWViODk2YzgyZDA0NmEwODA2N2ExMWUzNWNkZjJmMWRmYWYyNmZlYTkwYjhkYjY2NzY0MTMiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6IjE0MTI5MDc2ZTFiNDMxYTVhZGVjOGE4Mjg5MThmOWU4YzRmM2Q4NzlmOWUwNmRlY2EzNjVlOWQ5ZDM4OGEwMGIiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6IjcyMzc1ZjdjZDVkMWMzYWI1YzFlMjE1N2ViNjFhNjRhMDRlOTZiZDA1YTg1NThkYmY0MWRmZWUxMTE4YjcxMDcifQ"+ }+ ]+ },+ {+ "id": "claim_c6bb62ad54ab4bbd92d4cced4f63fd6f",+ "statement": "LangChain scrubs sensitive data from cassettes via multi-layer redaction before recording: request/response headers (authorization, openai-organization, cookies, set-cookie, chatgpt-account-id) are replaced with **REDACTED**; request/response bodies undergo recursive JSON parsing to redact OAuth secret fields (access_token, refresh_token, id_token, code, device_code, client_secret, code_verifier) and JWT-shaped strings; binary payloads (PNG, JPEG, PDF, audio) are skipped for performance since JWTs and OAuth secrets are ASCII-only.",+ "evidence": [+ {+ "resource": "repo://libs/partners/openai/tests/conftest.py#L13-L187",+ "version": "repo-lines-v1:sha256:5f44337e39382b7b881604a9db2369ef8c88b98b57d43ded55ada0c0156f033a:eyJzZWxlY3RlZExpbmVDb3VudCI6MTc1LCJmaXJzdFNlbGVjdGVkTGluZUhhc2giOiJjNWJjMjVmOTBlNjI4MWQyMWIyOWUyY2M5YmJhYzdiYzQxYTU4MzRiZjhhNTdkOTQzMDMyMzk2M2QxZTQ3YThmIiwibGFzdFNlbGVjdGVkTGluZUhhc2giOiI3MjA4NTMyOTEwY2ZjZWZlNTg3MDNkNDM0NDVhOWMyMDJiMTI0ODc3MmYxNmVmNWExNjMwZTYyZjI1ZGYwMjc0IiwicHJlY2VkaW5nQ29udGV4dExpbmVDb3VudCI6MywicHJlY2VkaW5nQ29udGV4dEhhc2giOiJlNWMxYzQ2MmUyYTM5ZDc0NzU5ZjVlMWIxMjZmNzY4M2EyYjczMDExOGUxOGY1MTIyYjA4Y2VkZWViNjUwZTIzIiwiZm9sbG93aW5nQ29udGV4dExpbmVDb3VudCI6MywiZm9sbG93aW5nQ29udGV4dEhhc2giOiI3MjM3NWY3Y2Q1ZDFjM2FiNWMxZTIxNTdlYjYxYTY0YTA0ZTk2YmQwNWE4NTU4ZGJmNDFkZmVlMTExOGI3MTA3In0"+ },+ {+ "resource": "repo://libs/partners/openai/tests/conftest.py#L59-L163",+ "version": "repo-lines-v1:sha256:934bfce3bf32df8d79d6d8298921566bbb942fc7410ed26fde42c2f00fa4636b:eyJzZWxlY3RlZExpbmVDb3VudCI6MTA1LCJmaXJzdFNlbGVjdGVkTGluZUhhc2giOiI3NjVkZDJlYzYyMjA0OGJjYmE5YjE1NTM3ZjI0YmYwNDI0ODVhNzNkNmI5NWMxMzQ5ZmI0YmEwZjc3OGE2OTZhIiwibGFzdFNlbGVjdGVkTGluZUhhc2giOiJmM2NjMWQwNTZiYWIwYTc1Mzg1ZWY4ODg1MzRiYTdhNDFlYzY0NTAyODAxYmRlZmI0MjUwNjliYjJkYmNlMDBhIiwicHJlY2VkaW5nQ29udGV4dExpbmVDb3VudCI6MywicHJlY2VkaW5nQ29udGV4dEhhc2giOiJhOThiMDYzZDliNDdlNjUzNzk2MjU1NzJjY2UxOTc2NjlkNTc2N2UxMmMxOGJlMDc1NjUyYjhjZDk4MWNlOGQ1IiwiZm9sbG93aW5nQ29udGV4dExpbmVDb3VudCI6MywiZm9sbG93aW5nQ29udGV4dEhhc2giOiJkYTc3MDc4NjBiMzhmZTcwNmZmNTJkZTNkNTUzZGFhN2QwZjI5ZDI1NWI0M2ZjMTE4OGMyMjQ1OGIyNmRjOWViIn0"+ }+ ]+ },+ {+ "id": "claim_bf8a85e3a5d74342a3dd8088396f740f",+ "statement": "LangChain partner packages inherit a standard suite of integration tests via ChatModelIntegrationTests from langchain_tests.integration_tests. Partner test classes override required properties (chat_model_class, chat_model_params) and feature-declaration properties (has_tool_calling, supports_image_inputs, supports_json_mode, etc.) to specify which capabilities to test. Each inherited test method is pre-marked with @pytest.mark.vcr; cassettes are generated automatically with names like test_invoke.yaml.gz or TestOpenAIStandard.test_invoke[model0].yaml.gz. This ensures all partners maintain consistent test coverage and automatically receive new tests when the standard suite is updated.",+ "evidence": [+ {+ "resource": "repo://libs/partners/openai/tests/integration_tests/chat_models/test_base_standard.py#L16-L94",+ "version": "repo-lines-v1:sha256:bd2c60d786f836bed35769da649514788beedd817b5d25366cacf323d85e89f5:eyJzZWxlY3RlZExpbmVDb3VudCI6NzksImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6ImJjNWExYzAzOWM1OTM5MGMzOTY0MDlmNTU3OGUzNDU4ZGUzOWI5ZmZjYzY0OTNkZjA4MWM0ODY2YWJlYjI3NmEiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6ImYyNmU4NTBjODIyNGZjMmVmOTk2MDM0MDM4ZjNlMjJiNzA2YmQwMTk0NjQ4YWU3MTg2ZjY5MzNkZGUwZGRhYjkiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6IjYwMjM0YTQwZWNmNjU1OTUyOGMzODQ4ZDFkZjdkYWYyMzE5ZDFhNGNjOTU5ZWUxNWQ0MzllMjJjNmJmY2U0OWMiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6ImJlYzM2ZDNlNWQ2ZjgwOGY5NWEwMTc5ODBhN2NjZDUwNGU2MzUyNzEwMGRkYjI2MzJiYmVlNzkxNjc1NDYzOTkifQ"+ },+ {+ "resource": "repo://libs/standard-tests/langchain_tests/integration_tests/__init__.py#L36-L60",+ "version": "repo-lines-v1:sha256:88df4c5b0118791afa9db41d100fded21aa9f50a43560f7da7f4b99c7611e239:eyJzZWxlY3RlZExpbmVDb3VudCI6MjUsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjY1ZTRlMGQwM2EyNmFlMDczODVmYWQzOWQzZDYwNTVmZTg5ZDg5ODQ1NTZiNGI1ZjcxNzcxYjQ1ZWVhZjg0ZjAiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjliZjFjMjdmZmQ5ODNjYjhmN2E1NzZlM2EyYTZhOGQzNmEyOWZlMzAyOWJkMTM1Y2UyY2QyOTk1ODUyYTA5MGQiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6ImE0YjI1MDQ1NDYyMzNkMmQzNTE2NDI4OGIyZmY2YWI5MzQ0MzJlYjYwYzBlMzE4OWRiMThmNWZkMDNiMTE0OGIiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjowLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6ImUzYjBjNDQyOThmYzFjMTQ5YWZiZjRjODk5NmZiOTI0MjdhZTQxZTQ2NDliOTM0Y2E0OTU5OTFiNzg1MmI4NTUifQ"+ },+ {+ "resource": "repo://libs/standard-tests/langchain_tests/integration_tests/chat_models.py#L194-L500",+ "version": "repo-lines-v1:sha256:621e928c667141b675a2e6447321f89f00e1383c6b014262bae3e49a225d16c7:eyJzZWxlY3RlZExpbmVDb3VudCI6MzA3LCJmaXJzdFNlbGVjdGVkTGluZUhhc2giOiIzMzFhNDcyMTkwZTA0ODJjYTlmMzdkZWQyNTVjOTQwNmZiNTIyYzA3OWYwMzE2MzdmZjk1NGY5ZDg0MTc4NTE2IiwibGFzdFNlbGVjdGVkTGluZUhhc2giOiJhNmVmNmQ0NzYyN2M5OGMxY2FhZGEzODAzM2Q0M2UxMmMxOWEwNzkzYjdhOTkzYzVlMGE3ZmQ3ZTY0YjJjZjU0IiwicHJlY2VkaW5nQ29udGV4dExpbmVDb3VudCI6MywicHJlY2VkaW5nQ29udGV4dEhhc2giOiI0ZTNlZTdmYjcwNzQzZTA3YjdjNjk5NWNiMTVhMWEyNWIwYzE2ZDM5YTU1ZGM4ZmIxM2UwOTcyMDYyYjc3MDg3IiwiZm9sbG93aW5nQ29udGV4dExpbmVDb3VudCI6MywiZm9sbG93aW5nQ29udGV4dEhhc2giOiI1ZjBjOWUwM2UwODliOWM3NjhjZWU4MTZjZjE5OTNlYzZlNDMwNTM4NGM3ZGYzNmM4NDdiMDljZjE1NTJiMWRhIn0"+ }+ ]+ },+ {+ "id": "claim_c8de971f76774573acd42090227df82d",+ "statement": "Each package's conftest.py extends base VCR configuration from langchain_tests.conftest.base_vcr_config via a vcr_config() fixture. Configuration includes record_mode (once/new_episodes/none), match_on strategy (method/uri/body or custom json_body for JSON-ignoring-order matching), filter_headers, before_record hooks (remove_request_headers, remove_response_headers), serializer (yaml.gz), and custom matchers registered in pytest_recording_configure().",+ "evidence": [+ {+ "resource": "repo://libs/partners/openai/tests/conftest.py#L190-L249",+ "version": "repo-lines-v1:sha256:cd6487781a7c4c4b6ded25db13dc8947476013ae99271f7d20a8d84bdb5faa01:eyJzZWxlY3RlZExpbmVDb3VudCI6NjAsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjUzMDM2NWQxNGM3ZGFiM2Q2NWIyMGVlYjNhZmU3ZTVkNGUzMGU4Zjc5OGU3OWFkMDZlNTk0MjI4Nzc0YTc0ODYiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjViODQzMjJkMGYzODU0NDQzZTRjNTVkM2UyOTM2Y2QzZDBkZjY4YmYyOWZlZWViMTg5NWU1OTA0ZDAzYjhhODQiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6IjczMDMyNWY5ODBiNGFiZTBhNWJmZGViMmQzZWI5MzQ4NzZkM2EwNDMzMjU2NDQ0NzJjMTM2Y2NhMDJiOWE4MGEiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjowLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6ImUzYjBjNDQyOThmYzFjMTQ5YWZiZjRjODk5NmZiOTI0MjdhZTQxZTQ2NDliOTM0Y2E0OTU5OTFiNzg1MmI4NTUifQ"+ },+ {+ "resource": "repo://libs/standard-tests/langchain_tests/conftest.py#L130-L155",+ "version": "repo-lines-v1:sha256:e3d0704dff8fca8d0a61d64b2b6b1bd421654204ab5faef64b64dd5b52df2ddf:eyJzZWxlY3RlZExpbmVDb3VudCI6MjYsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjYxNzhlNTQ1YjAyMTRlNDM2NDIxYTRiMzBiZDQ0NThjNDgxZGY5OTY5NWRkNjRmZjhkNmM1MDkxMTZjMmE5NTIiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjAxY2I2ZmI5YmVjNzJmZjA3ZTY4MDU0N2M3NTAyMzZkYWZmNDMzOWVhZTY5ODBkM2IwOTQwMmRkYmE4YzcwOTMiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6ImQzZDE3MWRlNzU0MzFhMDIxYTBkOTRmYTc2ZmFiZjBkNzEzOWM4OThjMWEwYjQ0YjQzY2E2MDkwM2ZhMWI4NDUiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjowLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6ImUzYjBjNDQyOThmYzFjMTQ5YWZiZjRjODk5NmZiOTI0MjdhZTQxZTQ2NDliOTM0Y2E0OTU5OTFiNzg1MmI4NTUifQ"+ }+ ]+ },+ {+ "id": "claim_5dcb8b6b3a3f498f9e65527bc159f832",+ "statement": "Pull request CI via check_diffs.yml runs _compile_integration_test.yml to validate integration tests compile without syntax or import errors via pytest -m compile, catching issues before test execution. This is a fast check that runs for every package with changed files.",+ "evidence": [+ {+ "resource": "repo://.github/workflows/_compile_integration_test.yml#L1-L65",+ "version": "repo-lines-v1:sha256:79fd5034f5f18f22c0d239890f27e420c240564cb6b8ce5ff4a9c775cf540802:eyJzZWxlY3RlZExpbmVDb3VudCI6NjUsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjRiZGJjZjJjYzljZDRmNGZiN2ViMTIxZTE1ZmI0MTAwMGUxNjZiZTdkMmRhYTg3MDM1NTlkYTA0MjkyZjNmMTMiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6ImNjMzMwYzU3MjBjZjQ4Mjg1MGQ0NWFkY2IyZmQ1MmVmNzdmY2VmOTkxNWY0MDE0ZWEwMjJhY2ZjMTU4MzEyMTciLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjowLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6ImUzYjBjNDQyOThmYzFjMTQ5YWZiZjRjODk5NmZiOTI0MjdhZTQxZTQ2NDliOTM0Y2E0OTU5OTFiNzg1MmI4NTUiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjowLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6ImUzYjBjNDQyOThmYzFjMTQ5YWZiZjRjODk5NmZiOTI0MjdhZTQxZTQ2NDliOTM0Y2E0OTU5OTFiNzg1MmI4NTUifQ"+ },+ {+ "resource": "repo://.github/workflows/check_diffs.yml#L116-L129",+ "version": "repo-lines-v1:sha256:55a232a2111f4b7f25b6b6308cc5eb902150f94cb2e9d6fe7a5358054a4d6874:eyJzZWxlY3RlZExpbmVDb3VudCI6MTQsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjUxZDA4MTA5NWQ3NDYyYzEzYmRjNWU5NTk1YWY5MTQwNzEyMDBhYjdmNWNlYzgzOGZlNTZjMDM0YTY0YWY3ZTUiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjU5ZDVkZDNlOGEyNGQ1Y2VlMjhlYTIzZjdiNTRlYWY1MjQ2OGZmMWVkY2FhNWVmNTg5NzBmMWQ5NWYxMjRmNWMiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6ImYzNWJmNjBhOGQ3YTViOTJhNTU1NTM4ODI1Yjk2ZTFiNWQ1MDVjMzhkMWYxZGFiMmU3ZjkzNDY4MTE5MzFmMjUiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6IjQ0MTIxNmUwZGE2MzgzNzFiN2FlMGRlNzFmODAxN2Q4MGM4MGU3NDM1ZWFlZWI4OWZlN2MyZmNhZjk5YzEwODEifQ"+ }+ ]+ },+ {+ "id": "claim_da79468c707842fd886cc72aa0eb127a",+ "statement": "Pull request CI via check_diffs.yml runs _test_vcr.yml to execute cassette-backed integration tests in playback-only mode (--record-mode=none), requiring no API keys and no live calls. If a cassette is missing or request bodies don't match, the test fails immediately. This catches stale cassettes caused by test code changes.",+ "evidence": [+ {+ "resource": "repo://.github/workflows/_test_vcr.yml#L1-L66",+ "version": "repo-lines-v1:sha256:69050e686a468c8ea429a563b7050fe40dd39acb7ab90334b481bc7bc0a37762:eyJzZWxlY3RlZExpbmVDb3VudCI6NjYsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6ImY3OGRiODQ4OTFlMzViNzFmYTUwYmQ5N2YyMzJkMjNjNDFkMGNmNjkzMTM1ZDQzNjA2YTc2NGY1Yjg2YjU0ODMiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6ImNjMzMwYzU3MjBjZjQ4Mjg1MGQ0NWFkY2IyZmQ1MmVmNzdmY2VmOTkxNWY0MDE0ZWEwMjJhY2ZjMTU4MzEyMTciLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjowLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6ImUzYjBjNDQyOThmYzFjMTQ5YWZiZjRjODk5NmZiOTI0MjdhZTQxZTQ2NDliOTM0Y2E0OTU5OTFiNzg1MmI4NTUiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjowLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6ImUzYjBjNDQyOThmYzFjMTQ5YWZiZjRjODk5NmZiOTI0MjdhZTQxZTQ2NDliOTM0Y2E0OTU5OTFiNzg1MmI4NTUifQ"+ },+ {+ "resource": "repo://.github/workflows/check_diffs.yml#L131-L144",+ "version": "repo-lines-v1:sha256:15dfcb350969800c998b661453a8f1330c13341e61c480c6bbdba8bd58d16e47:eyJzZWxlY3RlZExpbmVDb3VudCI6MTQsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjU5ZWViNzQ5ZDk4ZGU2M2ZhOTAwYTQyNzIwNjM5MjQ1YzZiNGNhNmZjMDRkYWU1NWQxMzExYmM4ZGRjZjgyZTEiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjU5ZDVkZDNlOGEyNGQ1Y2VlMjhlYTIzZjdiNTRlYWY1MjQ2OGZmMWVkY2FhNWVmNTg5NzBmMWQ5NWYxMjRmNWMiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6IjIyNmU0NDUxOGY4NDJjZDkzMjk1ZjExMjdhNDY5MGM1YjA5Yjk4N2RlN2YwMWZhNDhjMWI0MDMwMmQ0NTY2MzEiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6ImRjZWIyZTcwN2Y1NmZjNTAwMzFjM2M1MjhjNGE4Zjk1NWU0YzU3MjNjZGNhOGE5NWI1N2UxMDU3MjQ0Yzg1NjMifQ"+ }+ ]+ },+ {+ "id": "claim_4d402e0507a74fd78fba4f99cfa62d03",+ "statement": "Scheduled integration tests (integration_tests.yml) run daily or on-demand with live API credentials from GitHub secrets. Only tests marked @pytest.mark.scheduled run in these workflows; VCR-marked tests are skipped. The workflow computes a dynamic test matrix for affected partner packages and runs make integration_tests, which smoke-tests each supported SDK major version.",+ "evidence": [+ {+ "resource": "repo://.github/workflows/integration_tests.yml#L1-L150",+ "version": "repo-lines-v1:sha256:7a7511cd84bba69ac8de61f1adaac6a67f23c8baf7c0bdb4533183a142a6254f:eyJzZWxlY3RlZExpbmVDb3VudCI6MTUwLCJmaXJzdFNlbGVjdGVkTGluZUhhc2giOiI2Nzc2ZDc3MjE0ZWE5NGJiZDcyY2VkMDZjNDljZWJkOTUxY2M5MjI2NzNiZmE0NWEyY2UyZTQwNmM0MmJlMmMyIiwibGFzdFNlbGVjdGVkTGluZUhhc2giOiJhNTM4ZGY2ZTdhZGQ0YjMwZDQwZjc0N2VkYWYxMGVjZGIyODM1MGFhYTEyNTk2ZTJkZjNjZWRkMjAyODE0ODE1IiwicHJlY2VkaW5nQ29udGV4dExpbmVDb3VudCI6MCwicHJlY2VkaW5nQ29udGV4dEhhc2giOiJlM2IwYzQ0Mjk4ZmMxYzE0OWFmYmY0Yzg5OTZmYjkyNDI3YWU0MWU0NjQ5YjkzNGNhNDk1OTkxYjc4NTJiODU1IiwiZm9sbG93aW5nQ29udGV4dExpbmVDb3VudCI6MywiZm9sbG93aW5nQ29udGV4dEhhc2giOiI2N2IzMDRlYTA2N2FjYjZkZTVhYzUyNThlZGQxYjU1YzRhMmMzOWE3ODNjOTI3MDYxNjEzZWIxODlkMDRhOTM3In0"+ },+ {+ "resource": "repo://libs/partners/openai/Makefile#L31-L43",+ "version": "repo-lines-v1:sha256:6083e0b2111881dfbb431ced5c66772498fb631c78814961d1284c65e4cbbbbe:eyJzZWxlY3RlZExpbmVDb3VudCI6MTMsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjBlMjg0MTUwYzAzNWI1YTA0NmRhNzc5ODlkYjA5MmRlZjA0ZTE5MDdkMWRkMDRkMjI5YTlhMGY1MzcxZTMwNGYiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6ImQ4YmU0MDEyZGM2ZTgwZjBkYWEwMDVjMGFiOTAwZDg2NDNlMjFhOTU1ZDQ2YmE5ZGRiYmQ5NmQ1ZjQzOWY4NWYiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6IjAwM2RiMWVhZGQ3OGI4NDBjMDFjNzY0MTU1NmZhNzE1NDNkMmZiY2ViZTIwZjcxMmFhMmQ0MzlkMTM5ZDE0OTIiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6ImZjZTRlZWIyZWRjOTlhYjcyMWEyZjUyYThmYTg3OWIzNDg2NTM1MzVlYmUwOGU1MTQ3ZmZhNjM5MDNiMWY0ZDUifQ"+ }+ ]+ },+ {+ "id": "claim_57dfd38045d2447787c3108068a0caa0",+ "statement": "Cassettes are stored in module-specific subdirectories like tests/integration_tests/chat_models/cassettes/test_base/ or tests/cassettes/ at the package root. The vcr_cassette_dir fixture computes the correct directory per test module. For parameterized tests, cassette names include parameter identifiers (e.g., test_invoke[model0].yaml.gz, test_invoke[model1].yaml.gz).",+ "evidence": [+ {+ "resource": "repo://libs/standard-tests/langchain_tests/conftest.py#L145-L149",+ "version": "repo-lines-v1:sha256:bcbfe6950c06171c9fd25966f03f3a4bf38b50b58c9f4297473fc19d7b9701ce:eyJzZWxlY3RlZExpbmVDb3VudCI6NSwiZmlyc3RTZWxlY3RlZExpbmVIYXNoIjoiMDFiYTQ3MTljODBiNmZlOTExYjA5MWE3YzA1MTI0YjY0ZWVlY2U5NjRlMDljMDU4ZWY4Zjk4MDVkYWNhNTQ2YiIsImxhc3RTZWxlY3RlZExpbmVIYXNoIjoiMDFjYjZmYjliZWM3MmZmMDdlNjgwNTQ3Yzc1MDIzNmRhZmY0MzM5ZWFlNjk4MGQzYjA5NDAyZGRiYThjNzA5MyIsInByZWNlZGluZ0NvbnRleHRMaW5lQ291bnQiOjMsInByZWNlZGluZ0NvbnRleHRIYXNoIjoiYzQ5NjM5OGM5ZTQ3MGM3NTkxMGUxMzVmOWQzYTljOWIzZWY2ZWYxNWJhMTEzMTM3NTkwNWJiZjFiOTg3M2JjMiIsImZvbGxvd2luZ0NvbnRleHRMaW5lQ291bnQiOjMsImZvbGxvd2luZ0NvbnRleHRIYXNoIjoiNzIzNzVmN2NkNWQxYzNhYjVjMWUyMTU3ZWI2MWE2NGEwNGU5NmJkMDVhODU1OGRiZjQxZGZlZTExMThiNzEwNyJ9"+ }+ ]+ },+ {+ "id": "claim_22e021804c0543d493e7b564d6328620",+ "statement": "VCR matches requests during cassette replay using configurable strategies: default is [method, uri, body]; OpenAI tests use custom json_body matcher that parses both bodies as JSON and compares parsed trees, ignoring whitespace and key order. Custom matchers can be registered via pytest_recording_configure() to implement provider-specific matching logic.",+ "evidence": [+ {+ "resource": "repo://libs/partners/openai/tests/conftest.py#L229-L249",+ "version": "repo-lines-v1:sha256:ae75bbef6086ff82080bae4afbcba4baebc3beca8750c97b8da645f3bde4e3de:eyJzZWxlY3RlZExpbmVDb3VudCI6MjEsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjU3ZDNhMzVmOGFhOTE4MDczODRiNTYzYTRhMWZlZjE4YjQ3NTRmNmMyYTc4NzRmNjMwYzdkZWNkMDlmN2MyNzgiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjViODQzMjJkMGYzODU0NDQzZTRjNTVkM2UyOTM2Y2QzZDBkZjY4YmYyOWZlZWViMTg5NWU1OTA0ZDAzYjhhODQiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6IjA1N2NiMDJiNjA3NWMxNDEwYWQwOGIzZjQ5YzIyOTdjNTU1MGQ5ODA5NzEyYzg5N2QyM2I5MTU1YTMzNzljMjciLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjowLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6ImUzYjBjNDQyOThmYzFjMTQ5YWZiZjRjODk5NmZiOTI0MjdhZTQxZTQ2NDliOTM0Y2E0OTU5OTFiNzg1MmI4NTUifQ"+ },+ {+ "resource": "repo://libs/standard-tests/langchain_tests/conftest.py#L130-L143",+ "version": "repo-lines-v1:sha256:0144da3602191e08b1c7c3a3d0ea02abb6d35b5ffbf3a7e28f89554b904f1087:eyJzZWxlY3RlZExpbmVDb3VudCI6MTQsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjYxNzhlNTQ1YjAyMTRlNDM2NDIxYTRiMzBiZDQ0NThjNDgxZGY5OTY5NWRkNjRmZjhkNmM1MDkxMTZjMmE5NTIiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjQ4OTNmNDBlMzc4MWViODk2YzgyZDA0NmEwODA2N2ExMWUzNWNkZjJmMWRmYWYyNmZlYTkwYjhkYjY2NzY0MTMiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6ImQzZDE3MWRlNzU0MzFhMDIxYTBkOTRmYTc2ZmFiZjBkNzEzOWM4OThjMWEwYjQ0YjQzY2E2MDkwM2ZhMWI4NDUiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6IjcyMzc1ZjdjZDVkMWMzYWI1YzFlMjE1N2ViNjFhNjRhMDRlOTZiZDA1YTg1NThkYmY0MWRmZWUxMTE4YjcxMDcifQ"+ }+ ]+ },+ {+ "id": "claim_2828089de5cc4298b9b1194b6ddaf072",+ "statement": "VCR integration tests support both sync and async code identically; async tests work because VCR intercepts the underlying httpx/requests library. Streaming tests via stream() or stream_events() are fully supported; VCR records the stream sequence and replays it identically on playback.",+ "evidence": [+ {+ "resource": "repo://libs/partners/openai/tests/integration_tests/chat_models/test_base.py#L1302-L1356",+ "version": "repo-lines-v1:sha256:8f782997a2a4a99ad22536c883c9e82b77a965e3abeafa779065a6e7d1e6324b:eyJzZWxlY3RlZExpbmVDb3VudCI6NTUsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6ImI0NTMyNDc0MGJmZmMzYjk1Zjk0ZGIyZDdiM2Q1MGU1ZDkxMDEyNmUzNTllOTYzOGU3Y2I1NTIzZjFjMjQwM2IiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6ImI0NTMyNDc0MGJmZmMzYjk1Zjk0ZGIyZDdiM2Q1MGU1ZDkxMDEyNmUzNTllOTYzOGU3Y2I1NTIzZjFjMjQwM2IiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6IjNlZWViNDdlZDQyNTVjOTIzYmY0OTdmYmI2YjcyODI0M2FmZjBhZGZmZTU0MDQzYTY5MzY5Mzg4NTA2YTAzMDMiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6IjllYjk4OTEwZDc1NDY5NmI5NzY3NTE5OThiMzUzMTZjMTgzZjA4YTM4ZmIyMjYzYTA1NDM2MmM0ODE0OWMzNjcifQ"+ },+ {+ "resource": "repo://libs/partners/openai/tests/integration_tests/embeddings/test_base.py#L53-L65",+ "version": "repo-lines-v1:sha256:12ea5a2af5c6c9d1bc6c5d3b119a4244a7aa427067d71dbf77c3936af2c2c30d:eyJzZWxlY3RlZExpbmVDb3VudCI6MTMsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6ImI0NTMyNDc0MGJmZmMzYjk1Zjk0ZGIyZDdiM2Q1MGU1ZDkxMDEyNmUzNTllOTYzOGU3Y2I1NTIzZjFjMjQwM2IiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjI4ODFjYjgwMGJhOTI5YzcwYmY5OWY5YjRiZTYyMmZjYThhNDY1NTkyNTkwMzVmNDJkMGMyZjA4ZjBhY2RhOTkiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6IjViNjFlNzliYjM1ZjlkZTFiZWJiZmZhNTIwYzgzYzEwZGM4YjgzZmJlZWZjY2E1YjA5YjNkN2U5NWE5OGU5NjQiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6ImQxOTNlNmJiZjNkNWE0ZTY5MTM4NzBhMGUzNjUyNjAxYzkxMDAzOWVjYjZkYjI4MWM0NDNmZjA5YTE4N2M3NmEifQ"+ }+ ]+ },+ {+ "id": "claim_be882bec446143dc9770753b11575dae",+ "statement": "OpenAI Codex tests require special VCR handling in CI: conftest.py uses pytest_collection_modifyitems() to skip Codex tests at collection time unless running in --record-mode=none (cassette playback), and uses an autouse fixture to monkeypatch _FileChatGPTOAuthTokenProvider token methods with fake in-memory tokens for VCR playback without requiring on-disk OAuth files.",+ "evidence": [+ {+ "resource": "repo://libs/partners/openai/tests/integration_tests/chat_models/conftest.py#L66-L147",+ "version": "repo-lines-v1:sha256:b97eef509e815d61903c1593c52de0c953c752cdf6b6a8f7cb3c43feee075640:eyJzZWxlY3RlZExpbmVDb3VudCI6ODIsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6ImNmYzYwZGExMTM1NTc1OTRhYTlhZmUyNjJmYjUxZjNhM2RlMWNhYTdjNDdhNTg4NTExYjdlYjA0MjY3OTY0ZmMiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjMwYzFmMTg4ZjE0MmVkN2E4MjQ2ODBiMjA3MTcyYzU1MTliYzYxNGE0OGZkYTdjZjE2N2VkYjhkZGY3OTk1NmMiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6ImQ3MDE0OWUwNjlhZDY3ZWNjZjQ3MzY0NmZmMWM3NTAwNTBkMzI5ZDExMDAxOGRjNTc2Njg3OGVhZmExZDYwN2QiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjowLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6ImUzYjBjNDQyOThmYzFjMTQ5YWZiZjRjODk5NmZiOTI0MjdhZTQxZTQ2NDliOTM0Y2E0OTU5OTFiNzg1MmI4NTUifQ"+ }+ ]}],"verification": {"by": "openwiki/0.5.0",- "at": "2026-09-28T08:35:20.640Z"+ "at": "2026-10-20T08:25:57.412Z"}}diff --git a/openwiki/.claims/mcp-integration.json b/openwiki/.claims/mcp-integration.jsonindex 08fb925303..a49b5e8dda 100644--- a/openwiki/.claims/mcp-integration.json+++ b/openwiki/.claims/mcp-integration.json@@ -1,6 +1,6 @@{"schemaVersion": 1,- "pageVersion": "sha256:aa9e35da19127c337d9ca84bffab4b5b80d9cc78063469ee9a65827d4867d36c",+ "pageVersion": "sha256:4774281caf07d43ca8482b32d368fa17bb8d55b57aa1123ef43d83b3f1998cdd","claims": [{"id": "claim_a20f2f32ba21436d869cf463fc4e93f6",@@ -251,6 +251,6 @@],"verification": {"by": "openwiki/0.5.0",- "at": "2026-09-28T08:35:20.640Z"+ "at": "2026-10-20T08:25:57.412Z"}}diff --git a/openwiki/.claims/messages.json b/openwiki/.claims/messages.jsonindex 9143708136..e209b980a7 100644--- a/openwiki/.claims/messages.json+++ b/openwiki/.claims/messages.json@@ -1,6 +1,6 @@{"schemaVersion": 1,- "pageVersion": "sha256:9a300b45af58ddf5b9c8a669d194b5ea592a85e27837e6b2066229dd7d924556",+ "pageVersion": "sha256:9d2bad428de5e38f36866a9e7a86d8653b2ad1628148cb2079acf2e7f8f0e7e4","claims": [{"id": "claim_cd426b48afb54e54a30a82b280ab266d",@@ -219,6 +219,6 @@],"verification": {"by": "openwiki/0.5.0",- "at": "2026-09-28T08:35:20.640Z"+ "at": "2026-10-20T08:25:57.412Z"}}diff --git a/openwiki/.claims/middleware.json b/openwiki/.claims/middleware.jsonindex 9a36aaaa00..dbe645a4c3 100644--- a/openwiki/.claims/middleware.json+++ b/openwiki/.claims/middleware.json@@ -1,6 +1,6 @@{"schemaVersion": 1,- "pageVersion": "sha256:b8080e5df75c67cc4c69c2dc6ae72e2c8385efe2b711e32f89d064f4c2925191",+ "pageVersion": "sha256:3e2a5b3cbf1f0cf13ad86c8a1be82a3e64735424a664221373888efa04be5322","claims": [{"id": "claim_6ce968382a514edb90e74830ccdebef7",@@ -195,10 +195,40 @@"version": "repo-lines-v1:sha256:7ef1873b30d8420a5f483c882f53c472a9a66cdd2300c0a6b2eb017f7231fb8b:eyJzZWxlY3RlZExpbmVDb3VudCI6MiwiZmlyc3RTZWxlY3RlZExpbmVIYXNoIjoiZjkzMzljMzIxNmJjMDNjMjFmNDQzYzdhYjdmN2M2Y2JmMDFmMTUwZmIyMjVjMzcwNGRjOWQ2NTdhYWM5Y2QyZiIsImxhc3RTZWxlY3RlZExpbmVIYXNoIjoiZDkxMzU2OTQ0NGM1ZjQwZjJiMTZkZmU3Y2EyYzc2YWJhYjgwODk2M2RiMTY1ODM5OGU2ODY5YmNiODg2ZWUzNyIsInByZWNlZGluZ0NvbnRleHRMaW5lQ291bnQiOjMsInByZWNlZGluZ0NvbnRleHRIYXNoIjoiNmNlZmM3YzlhOGMyNDMyNmM2MGIwMGNjN2E3YzIyZjMxMTQzNWE0OWFmMTMzNzg2ZDczZWExOTcwNTIwNzMzNyIsImZvbGxvd2luZ0NvbnRleHRMaW5lQ291bnQiOjMsImZvbGxvd2luZ0NvbnRleHRIYXNoIjoiNGViMjc1MTdkNmUzZjFiMDA4MTUyN2MxZDdhNzRlMTJjMjU2ZGZhZjhkOTRkNDllM2UwYTE4MGIxM2NmZDAwMiJ9"}]+ },+ {+ "id": "claim_07ed755cb4694cccbd3f2945c6a157cf",+ "statement": "ToolCallRequest is immutable; middleware must use request.override() to create a new request with modifications, preserving the original request.",+ "evidence": [+ {+ "resource": "repo://libs/langchain_v1/langchain/agents/middleware/types.py#L88-L158",+ "version": "repo-lines-v1:sha256:f2f4c44da1619f24d77f6fa8d0957eeff9ecb4d07077d0afdfd56c8349be7359:eyJzZWxlY3RlZExpbmVDb3VudCI6NzEsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjZkM2FkMDdlNzE0NWQzMmE4MThkMWE5ODcwNDY4NDgxOTMwODgwYmMxZmJlMmQyYmNkNjY4N2U5MzAwODEwMTciLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6ImYzZDAwY2YyNzA5NjRkNDRhMTNkZmFjODc1MmIwOWZjYzQzNWIwZjE5YjMxNmFiY2Y4MWE3YWE2NGJiMTIyZDYiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6Ijc2MTlmYmNkMDIyMzI5NDQ3ODAwMmU4Zjg2ZmNlZWU3ZDgyYjc0OWFhM2M1ZjhhMDZmYjM3Y2JkMjBhOGY5MTQiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6IjU2OTFmOTBmMzQ5M2RhYWM3NDdiOTQ4ZGI0MTg0MTQ0YjVjZmE3NGE2ODRhMjNiOTNlNDdlMjZlMjIwMTAxMDYifQ"+ }+ ]+ },+ {+ "id": "claim_4deaf0ceb27249bea0ff478a8faadda8",+ "statement": "ToolRetryMiddleware wraps wrap_tool_call to automatically retry failed tool calls with exponential backoff; supports custom exception filtering, configurable on_failure behavior, optional jitter, and can target specific tools.",+ "evidence": [+ {+ "resource": "repo://libs/langchain_v1/langchain/agents/middleware/tool_retry.py#L32-L79",+ "version": "repo-lines-v1:sha256:0a4ebafd32fd92656bbcd18b004b8ebf8e1b7dc68538c973f83f1efd56850ce2:eyJzZWxlY3RlZExpbmVDb3VudCI6NDgsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6ImYyOWUwZTVkOTZhZDgyZGJjOGZlMTgyOThmNGU4NTBhZTcyYzZhZGU1Mjc1MzMwOTA3ZWEwZTc5NDk3MDJiNjIiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6Ijc1ZWZmOThjODJiNjI2Y2JlOTZmN2M3MmEyNTlmMDBkYjMwNzhiNTU0ZmQ4N2M3YjM2M2VhNzMyZDQ5MTkwZjQiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6IjM2MGQzMWI0YjhkMDBmZjQ1MWIwYzEwN2E0ODIyNWE2ZjYzNjljNGQ1OWI5YjQyNzc1OGUwZDM4YjA0YmQ0NGYiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6IjNlMjEwYjczY2M4ZWYwODNmMjY2MWY2ZTRlNWRkZGRkMDUyY2FjMzczMGY2ZDBmYmRmNzljNzgzZjM4ZjQ1ZjgifQ"+ }+ ]+ },+ {+ "id": "claim_8d295bc97ca54a50b1073d5b4dbe4c99",+ "statement": "ToolCallLimitMiddleware enforces maximum tool call counts per thread and per run; supports exit behaviors (continue blocks exceeded tools, error raises exception, end stops immediately with explanatory messages); tracks calls globally or per tool name.",+ "evidence": [+ {+ "resource": "repo://libs/langchain_v1/langchain/agents/middleware/tool_call_limit.py#L141-L198",+ "version": "repo-lines-v1:sha256:f5721e3e3328d58bf69cf8051fc75012395db99878440daeb08a2bd4eb83d31e:eyJzZWxlY3RlZExpbmVDb3VudCI6NTgsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjQ0MDI3YmYxNzU1MWFiM2UyZmZjZGVlZWJkMTM3ZDdlNmRjNjcxZDZhNzYyNzlmM2ZkMWIzMTYzNzU2NTcyMmQiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6ImE2YTcxNTI1NzJlZTg0ZjEwOTA2Yzc0YjlmMmE5MjQzNGRkYWIwZTNjNDI4MTNiMDRlNTk3ZWZjZWM5NTFiMjYiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6IjIxOGFlMDAzNjJjOTVlZDRkNGQzYWI5MmUwYjc1NThkMjA5NTdlZGJhNDY2ZTY0YjE1ZjAwZjI3MGNmMDFkZjYiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6IjZlN2U1YWE2NDI3YWIwNWUxZjcwOWQyNTRmNWQ5OWQzNTFiYjY0YWY3NTc1NjNhNTQzOTYzNmM5MDhkYmFkNDEifQ"+ }+ ]}],"verification": {"by": "openwiki/0.5.0",- "at": "2026-10-16T08:25:55.096Z"+ "at": "2026-10-20T08:25:57.412Z"}}diff --git a/openwiki/.claims/model-initialization.json b/openwiki/.claims/model-initialization.jsonindex 6f768d2036..2d64178610 100644--- a/openwiki/.claims/model-initialization.json+++ b/openwiki/.claims/model-initialization.json@@ -1,6 +1,6 @@{"schemaVersion": 1,- "pageVersion": "sha256:bd811dcc6b70cbe1b135d1ae06d5196272d0742d1df5c7491d4adfa89cf21a9a",+ "pageVersion": "sha256:5a2be7274697dcbafac21e6bf5ba7bab6b2d063b4cc2d2d6e5b907fc326ff7bc","claims": [{"id": "claim_189e539212e149fdb6d26bfac3426a8c",@@ -181,6 +181,6 @@],"verification": {"by": "openwiki/0.5.0",- "at": "2026-09-28T08:35:20.640Z"+ "at": "2026-10-20T08:25:57.412Z"}}diff --git a/openwiki/.claims/openai-provider.json b/openwiki/.claims/openai-provider.jsonindex 65234383ca..562602af37 100644--- a/openwiki/.claims/openai-provider.json+++ b/openwiki/.claims/openai-provider.json@@ -1,6 +1,6 @@{"schemaVersion": 1,- "pageVersion": "sha256:a04ac2a2275b26e967eb8732d53b5e7b4a2f0bcece2b6bd58dd768eaa08b1435",+ "pageVersion": "sha256:3b62c72f2c6094be774a0fadd4114b6a4dd8aeb8e9ca7056d8cef7983e876a40","claims": [{"id": "claim_347664eb68464142b558791c7a95093f",@@ -307,6 +307,6 @@],"verification": {"by": "openwiki/0.5.0",- "at": "2026-10-16T08:25:55.096Z"+ "at": "2026-10-20T08:25:57.412Z"}}diff --git a/openwiki/.claims/partner-pattern.json b/openwiki/.claims/partner-pattern.jsonindex 99793626f2..3e5b5cac42 100644--- a/openwiki/.claims/partner-pattern.json+++ b/openwiki/.claims/partner-pattern.json@@ -1,6 +1,6 @@{"schemaVersion": 1,- "pageVersion": "sha256:bd88bc8f77ba65a0d006fb5b078a928cb1abd56f3b6a6959908e28dede3409b6",+ "pageVersion": "sha256:f108faaa3396cd150a11b17a4e481b11cb9a6cd907e10498f36c4dc1a29eabbf","claims": [{"id": "claim_7c2a1600fd294471a122d693305b38f8",@@ -157,6 +157,6 @@],"verification": {"by": "openwiki/0.5.0",- "at": "2026-10-16T08:25:55.096Z"+ "at": "2026-10-20T08:25:57.412Z"}}diff --git a/openwiki/.claims/prompts.json b/openwiki/.claims/prompts.jsonindex 92002eef6c..36509968e3 100644--- a/openwiki/.claims/prompts.json+++ b/openwiki/.claims/prompts.json@@ -1,6 +1,6 @@{"schemaVersion": 1,- "pageVersion": "sha256:479c5428fb5c4d5a6a9cb84f2f11bf8a578e6af0b1f5e1208f47fa98d0f563df",+ "pageVersion": "sha256:a3a993a0163b7711b9ea4a298f431f50bcf2d1e4ee6aacff72765c6128326ef4","claims": [{"id": "claim_06ad6af0140b4318b25f43272f89e77f",@@ -175,10 +175,62 @@"version": "repo-lines-v1:sha256:9e7a196791d7921f5dda4aff01828a5731663f7a163f5da719a6140c2fec3dee:eyJzZWxlY3RlZExpbmVDb3VudCI6NTAsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjdmZGRjYTFjZDMwMjFlNzA0YjcxMjNiMTYwMGIzOGM3ZDExNTRhYWZiNGJlNzEwOTA1ZTVkZDE1MjBlNzk0NTMiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjU5MjU2OTVlYTJkY2RhMWM2M2JlMjg1Yjc4MDlhMmEwMzYwZGEzZGZiYWY3ZjMzYjJkMTA0NzJmYzZhMDNkMDEiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjowLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6ImUzYjBjNDQyOThmYzFjMTQ5YWZiZjRjODk5NmZiOTI0MjdhZTQxZTQ2NDliOTM0Y2E0OTU5OTFiNzg1MmI4NTUiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6IjgxZjAyMzJlOTNkNTcxMDA4MTM4N2E5ZWFkNmFjZmRlZTYzNGRkZWU3YzQ2ZjE0NDc3Y2NhZGRhMDZmZWE5OTIifQ"}]+ },+ {+ "id": "claim_79f34f700c37495ebb45ff07c5809964",+ "statement": "PromptValue is the abstract base type returned by all prompt templates via invoke() or format_prompt(). It has two main concrete types: StringPromptValue (wraps a formatted string) and ChatPromptValue (wraps a sequence of BaseMessage objects). Both support to_string() and to_messages() for dual representation, enabling prompt routing between string and chat formats.",+ "evidence": [+ {+ "resource": "repo://libs/core/langchain_core/prompt_values.py#L24-L52",+ "version": "repo-lines-v1:sha256:55ee5be9f33956629201e1833474eff0da775f55d5916bd8fc8999954a7eedf9:eyJzZWxlY3RlZExpbmVDb3VudCI6MjksImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjFiMGIxMDllMjZkNzcxNzAwOWFhNjJhMjM5YTBiNzhjMmIyNTAwODhlN2FiYjIzNzM3NmQwOWIxY2Q2Y2NkMzciLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjAxYmE0NzE5YzgwYjZmZTkxMWIwOTFhN2MwNTEyNGI2NGVlZWNlOTY0ZTA5YzA1OGVmOGY5ODA1ZGFjYTU0NmIiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6ImE5OGIwNjNkOWI0N2U2NTM3OTYyNTU3MmNjZTE5NzY2OWQ1NzY3ZTEyYzE4YmUwNzU2NTJiOGNkOTgxY2U4ZDUiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6ImVlNjcyM2I1YjIxMWFjNmIwOThhNDY4MGNmYmE1NTM5NzdhNTZjMzZlYjAyYTk5NzM2Nzk4ZTZmZjEzYWVlM2UifQ"+ },+ {+ "resource": "repo://libs/core/langchain_core/prompt_values.py#L54-L78",+ "version": "repo-lines-v1:sha256:560084020f6a18562806d76d540a9d60bb6d7eb45a92d549fbdde13595c9d306:eyJzZWxlY3RlZExpbmVDb3VudCI6MjUsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjNjYTU5ZTBjMjBlNmUwMGNiZmUzMzY5NjRmMjBhZmM5ZDliNjk3NDdjMDJlZjNiZWFiNzU3OTA0ZjEzZTExOGQiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjAxYmE0NzE5YzgwYjZmZTkxMWIwOTFhN2MwNTEyNGI2NGVlZWNlOTY0ZTA5YzA1OGVmOGY5ODA1ZGFjYTU0NmIiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6Ijg3OWNmOTczZmExOGY4NGI3MmQzZGYwNDVjMWU4OTljOTA0NDJmM2RkN2Y3NTgwNDZlMjRhYmI1MmRjYzI3ZmUiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6IjlkM2FiZDhkNDM0ZGQ2OGY2YWUzN2EzODdmOWNhNjEyNDQ4MjE3YTUyMjBmMjU1N2I2MWUyNWIyNTExOWRlNTUifQ"+ },+ {+ "resource": "repo://libs/core/langchain_core/prompt_values.py#L80-L105",+ "version": "repo-lines-v1:sha256:a959f132fc5d207c286369e07f969014b1bcce5389ae33b8c1496803d219a111:eyJzZWxlY3RlZExpbmVDb3VudCI6MjYsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6ImY0MDJlNzQyMzA1ODQ5NzA0YmIxNzIzOTQ1MWVkN2RiZTcwYmVkOGY1NTQyOTQ2NzNiM2IwNGJlODVkZDNkZGQiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjAxYmE0NzE5YzgwYjZmZTkxMWIwOTFhN2MwNTEyNGI2NGVlZWNlOTY0ZTA5YzA1OGVmOGY5ODA1ZGFjYTU0NmIiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6IjYwYzI2Y2I3NmJkNzRmODhlYWZhYjNlMTY1MDVlM2M1Y2Q3NDY5MjY1ZDEzOWUzM2JiMWU5YjE0MzllNDEwMjQiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6IjU5NjU2NGExNmRmM2EyNDU2YWZlMTcwMTQ5YzBkYjIxMjhhYTc2YjUyMzU5ZDAzZjJkODA0MmI3NGYwZDM2ZDYifQ"+ },+ {+ "resource": "repo://libs/core/langchain_core/prompts/base.py#L134-L138",+ "version": "repo-lines-v1:sha256:f81fbb39704404d20d323896973b74982a7faef30e4a87c63195086225a11024:eyJzZWxlY3RlZExpbmVDb3VudCI6NSwiZmlyc3RTZWxlY3RlZExpbmVIYXNoIjoiNDRkYTkzNTAwMTlkYzFlNjY3NDUyNjQzODczMTYxOTk3MjI1ZTljZTYwMTA3YWY3YjY0Zjg0MGRkZWNmZGE0ZiIsImxhc3RTZWxlY3RlZExpbmVIYXNoIjoiMDFiYTQ3MTljODBiNmZlOTExYjA5MWE3YzA1MTI0YjY0ZWVlY2U5NjRlMDljMDU4ZWY4Zjk4MDVkYWNhNTQ2YiIsInByZWNlZGluZ0NvbnRleHRMaW5lQ291bnQiOjMsInByZWNlZGluZ0NvbnRleHRIYXNoIjoiYzQyZTk3Y2JhZGFlMjIwNTk5YTg2NTcwYjg0NDZjM2QyZjdiMWI0ZjZjMzE3OWE0MzM3ZjgxY2VhZTI4NzU0OCIsImZvbGxvd2luZ0NvbnRleHRMaW5lQ291bnQiOjMsImZvbGxvd2luZ0NvbnRleHRIYXNoIjoiZTYxNmE4YzI1NzcxMmVkZDliY2M4OWU2NjllMGMxNjQyNmI3ODEwMzgzMjljZGQwZjYwNGJhMWQzMzY3MWY5MyJ9"+ }+ ]+ },+ {+ "id": "claim_76fa6577fffe4449a0d0c0cef19f83c4",+ "statement": "When a ChatPromptTemplate has exactly one input variable, invoke() accepts a non-dict argument directly and auto-wraps it as {variable_name: argument}. This enables simplified API usage for single-input prompts.",+ "evidence": [+ {+ "resource": "repo://libs/core/langchain_core/prompts/base.py#L161-L176",+ "version": "repo-lines-v1:sha256:277d769aa5bc6c7f0d1c28e717785c1ec9b54fe9bbab8e965e83b86ac5147d54:eyJzZWxlY3RlZExpbmVDb3VudCI6MTYsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjYxNDY4MTVjZjE3NGI1ZDQxNzk3YWNhMTk3MDQ3Yzg2N2FjODgxODk2YmRiMzZhOWVlNTViNzIyYTNiMDU0MDEiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjUxMDM0ODFjNTdkMGYwZGMwZjc2Y2QyY2M4YjM2MDRjNGU4Mjk2ZGE0MTIyYWRkMTllODE3NDVkYzdlMzMxYTYiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6IjcwMGU2Yzc0ZDBkZTUzNzk1MGRkMGY2ZjNiZjQwYWQxNTk0NGMwOTg5YTRiNzMwNWI3YmQ4NmEyYzE5YzZkYjIiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6ImFiOWEwNWQ3MTE0MjM0MzEzNzg0Zjg4MWYzMDIyNmZhNTU4ZGNhNDQ5N2NjNTFmM2Q0NWY2NWUyNmE3NGJjOTgifQ"+ }+ ]+ },+ {+ "id": "claim_406cac4d761042139548f16fc9353bec",+ "statement": "Prompt partial_variables can contain callable values, which are evaluated lazily at format time via _merge_partial_and_user_variables(). This enables dynamic values like timestamps or random selections.",+ "evidence": [+ {+ "resource": "repo://libs/core/langchain_core/prompts/base.py#L307-L314",+ "version": "repo-lines-v1:sha256:7ada273a151f4f5710cacc217b033105cac0ddb30f3e324b53c4c2c1624ac233:eyJzZWxlY3RlZExpbmVDb3VudCI6OCwiZmlyc3RTZWxlY3RlZExpbmVIYXNoIjoiYmFkZjA1NDk2YmQ3NjhjNDY4NzJmNDUwYmQzN2VjOTdjOGFmMjI5YTIxODI5ODRmMDJlYWQ1OWQ2YTgxNTA3ZiIsImxhc3RTZWxlY3RlZExpbmVIYXNoIjoiZjYzNjk2NWViYjM2YWI3NWU1NjFlYWZlNTJhZTJlZGNhOGUxNzBjZWNmNTk0NTY0YzZjMDcyODBlM2QxNDgyZCIsInByZWNlZGluZ0NvbnRleHRMaW5lQ291bnQiOjMsInByZWNlZGluZ0NvbnRleHRIYXNoIjoiN2U1MTIyMDg4OWRiYTJmMTg3YjcyNTY0NTNhM2MzNDllOTc0OTRiZDFhZDE0ODBlODgyMDBhN2UxMzZmMjc5MCIsImZvbGxvd2luZ0NvbnRleHRMaW5lQ291bnQiOjMsImZvbGxvd2luZ0NvbnRleHRIYXNoIjoiOTc1MTQ3MjY3NDUyYWM0ZWIyOGUzMDBhMGZmYTk1YWQ4OTE0YWJmOTZmNDBlZWYyODg3NmUzOTY3MjkxZTI1MSJ9"+ }+ ]+ },+ {+ "id": "claim_fd9acce46d4740cba302c3115278aee6",+ "statement": "When a ChatPromptTemplate contains an optional MessagesPlaceholder, the template automatically adds that variable to partial_variables with an empty list default and tracks it in optional_variables, making the placeholder omittable from input dicts.",+ "evidence": [+ {+ "resource": "repo://libs/core/langchain_core/prompts/chat.py#L1074-L1083",+ "version": "repo-lines-v1:sha256:e9044b985f19888195278e1d7b18dfe0977e86cde0457eaeb413c2358c8baa2c:eyJzZWxlY3RlZExpbmVDb3VudCI6MTAsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjZiZDY1YWI0ZjM3Zjk1ZDZkODM2YmU2MjExMzhiODNlOGM0M2Y4MzEyZDQ1ZDViZjgyZDlmY2RiODQ0NjBhNzgiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6ImYwZjNhMDc2Y2ViNWVhMWRkZGZmYzFkMTQzMjk0NDVlMWQ0ODgyN2U0ZGM4NjE3MDFlYTNiMTIyZTQzNjk1MjEiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6ImFhNTU5MWIzZWU1ZTMyYTk1ODY5MmVkZTM2MzQwODUyYTliZjY0MTQwYjU4NjcwOTYzMmVjNjBiNjY4YzdiMjciLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6ImEwZDdiYTU3ZTMxNTM1MjRmNTY4NGQ5M2NlMzhlYjQ0ZWEwYzExNzllYjhlYzU4OTNjYmNjOTNlYWZkNzQ2ZTMifQ"+ }+ ]}],"verification": {"by": "openwiki/0.5.0",- "at": "2026-09-28T08:35:20.640Z"+ "at": "2026-10-20T08:25:57.412Z"}}diff --git a/openwiki/.claims/quickstart.json b/openwiki/.claims/quickstart.jsonindex bbdabef3f0..c46d1eb7bd 100644--- a/openwiki/.claims/quickstart.json+++ b/openwiki/.claims/quickstart.json@@ -1,6 +1,6 @@{"schemaVersion": 1,- "pageVersion": "sha256:0f7765fb1d5ef0b5af05853c8dd950bee0d5f1bc0dc545d12d841f726b374f51",+ "pageVersion": "sha256:fb0558a846d2bb48b39f75e29312f97379fab566b6f5fe4129ce562061674b2c","claims": [{"id": "claim_7425c73f5e4c4667b8babba66c3663a0",@@ -183,6 +183,6 @@],"verification": {"by": "openwiki/0.5.0",- "at": "2026-10-19T08:31:23.057Z"+ "at": "2026-10-20T08:25:57.412Z"}}diff --git a/openwiki/.claims/runnables.json b/openwiki/.claims/runnables.jsonindex f40aa5771c..7ad998e316 100644--- a/openwiki/.claims/runnables.json+++ b/openwiki/.claims/runnables.json@@ -1,6 +1,6 @@{"schemaVersion": 1,- "pageVersion": "sha256:3c4eabfc05e650c9d18abad787eb26ca228fccc2f2993bae92151344718c1698",+ "pageVersion": "sha256:475690ec509a89d75f95c038280bda38de49b3228a17ccbc3ecdda4cb5a287b8","claims": [{"id": "claim_c00f8ff82e09494a9cdfb9149dda319c",@@ -63,6 +63,6 @@],"verification": {"by": "openwiki/0.5.0",- "at": "2026-10-16T08:25:55.096Z"+ "at": "2026-10-20T08:25:57.412Z"}}diff --git a/openwiki/.claims/source-map.json b/openwiki/.claims/source-map.jsonindex d603c23dc0..2810468feb 100644--- a/openwiki/.claims/source-map.json+++ b/openwiki/.claims/source-map.json@@ -1,6 +1,6 @@{"schemaVersion": 1,- "pageVersion": "sha256:52313842b55fedcf187350157ca3802ebe7d58aa780a8065539a57e5c99d95c8",+ "pageVersion": "sha256:5e4b92c2cb6f167b3e78d25a80ee2b9b9bccebaa00d1153a2551cf9c114577d0","claims": [{"id": "claim_c71edae5b0f64c8fa79c17ef1aca0f6b",@@ -199,6 +199,6 @@],"verification": {"by": "openwiki/0.5.0",- "at": "2026-10-19T08:31:23.057Z"+ "at": "2026-10-20T08:25:57.412Z"}}diff --git a/openwiki/.claims/streaming.json b/openwiki/.claims/streaming.jsonindex 2fc57efe83..d462ec8c85 100644--- a/openwiki/.claims/streaming.json+++ b/openwiki/.claims/streaming.json@@ -1,6 +1,6 @@{"schemaVersion": 1,- "pageVersion": "sha256:2de6aba507dba1baae1391c75deecbbcaa023c038ca1aedf859e19eafb44bf2f",+ "pageVersion": "sha256:b594d5497c4409f0fd87498a02ca117318c50856bf0bedeed627b72e4e2c2a8f","claims": [{"id": "claim_87d5d462354440a7bccb6dbe992c60d3",@@ -213,6 +213,6 @@],"verification": {"by": "openwiki/0.5.0",- "at": "2026-10-16T08:25:55.096Z"+ "at": "2026-10-20T08:25:57.412Z"}}diff --git a/openwiki/.claims/structured-output.json b/openwiki/.claims/structured-output.jsonindex 604768197d..1894d9b243 100644--- a/openwiki/.claims/structured-output.json+++ b/openwiki/.claims/structured-output.json@@ -1,6 +1,6 @@{"schemaVersion": 1,- "pageVersion": "sha256:f21e3e28f4b0f6a2e1676685bc07733d58f0c614276dc01afd01919fa0c76167",+ "pageVersion": "sha256:b59d18005bb60bd8a9e3ffedc320256d9d8ef28d14d01731550757571a74afc5","claims": [{"id": "claim_150a5dc8a9c14fc19c3597a746649ba0",@@ -197,6 +197,6 @@],"verification": {"by": "openwiki/0.5.0",- "at": "2026-09-28T08:35:20.640Z"+ "at": "2026-10-20T08:25:57.412Z"}}diff --git a/openwiki/.claims/tools.json b/openwiki/.claims/tools.jsonindex 5af33076ab..966ec85d1e 100644--- a/openwiki/.claims/tools.json+++ b/openwiki/.claims/tools.json@@ -1,6 +1,6 @@{"schemaVersion": 1,- "pageVersion": "sha256:5ef144d1673a8c9bac92b48f6531aa2f32ae51805f71e0cf48eb3dfbba7ddb34",+ "pageVersion": "sha256:8c205f9cfc427a48af09a109860f0eb9febf4772e344a443382f2f743b6c4e79","claims": [{"id": "claim_72f3312a1c4a494889542dc6efdbf940",@@ -211,10 +211,58 @@"version": "repo-lines-v1:sha256:436274b5dcf2c57abdf86c1e0fc3c0061283c60a27a1158bd1466176b72f82d3:eyJzZWxlY3RlZExpbmVDb3VudCI6MTAsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6ImM1MzViY2E3YjMzZGRhMzdiNzljZDFlNGYyNTVkYmY2YmFhMDdjZWVlMGZiYTU1ODMyZTkyYmQ5ODkxODlhY2MiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjAxYmE0NzE5YzgwYjZmZTkxMWIwOTFhN2MwNTEyNGI2NGVlZWNlOTY0ZTA5YzA1OGVmOGY5ODA1ZGFjYTU0NmIiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6Ijk1ODg0MGQ5YWJjYmIyMjYwZDE3ZWFiNmFkOWQ3ZDlhNzcwNDc3OWZhNGVhZjA1YjlkYTMwNTFmZjNhYzNhMWEiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6ImJlODBhOTE5MDFiMzg5ZWIyZDA4ZmFlNmRlYzM2Y2JlZDYzNGEwMDUyYTU1NTNlNDZkNmE4YjYwMTgzNDhjMjkifQ"}]+ },+ {+ "id": "claim_234acc2d725b4f4f899da20f3d0c4879",+ "statement": "The bind_tools() method on chat models configures model instances to emit tool calls within AIMessage objects; each provider implementation (OpenAI, Anthropic, etc.) converts BaseTool instances or dicts to provider-specific schemas via utilities like convert_to_openai_function(), then binds formatted tools to model invocation to return a new Runnable that accepts optional tool_choice parameter controlling model behavior.",+ "evidence": [+ {+ "resource": "repo://libs/core/langchain_core/language_models/chat_models.py#L2366-L2383",+ "version": "repo-lines-v1:sha256:a2c56a9bc7a84b7ed47b879ac55e9139606dc73bd2023a8ced246310d05fb38c:eyJzZWxlY3RlZExpbmVDb3VudCI6MTgsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6ImYxODU0YjA0NjkxN2UzYWIyYWQwMjllMGVlYWU3ZjkxZDBiZTNkNjkwMTRiYjYyN2FhZGRlZjJlNjlkMzg4MmQiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjI3YjQ4Nzk3YmM1N2JkZGEzOGQ4MTE5NjhkMTE0YjgzNTZkN2I0YmUzMzFhMTQyZmY4ZDgzNWUwMzc3NjVlYzAiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6ImE1NzQzYjMwYzc5OTI2MzkwNGY4ZTgxODQyNDM3OWY5ZDIyYjJjMjAxY2I2ZTJmNzUzMzA0MTc3Y2YxYzk4OWQiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6IjVhMTQxNjFmOTNhMDJmMzU5YmQ4MDVmZWI0Yjg5NmM0ZjExZWFiNGM1Zjc4NDA2ZmRjZjk5N2NlZGM2N2MyZGIifQ"+ },+ {+ "resource": "repo://libs/core/langchain_core/utils/function_calling.py#L515-L574",+ "version": "repo-lines-v1:sha256:7cca7b42a0a127f5052b86dcf4a58517c20b7946f06473ae49e1cd038456f052:eyJzZWxlY3RlZExpbmVDb3VudCI6NjAsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6ImJmYWQ1OWViODM5NTI1YTAwNTY4NjE4YzNmODE5NzhlZjljNjZiNWI5ZGY4MmY0Njc4N2Q1Mzc1MTc3ZTJjNGMiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6ImU5NzBlNTVjMWM5NjNiOTJkN2RkNjMzMTBjMDY4MzAwMGYwYjgwMjEyMGI1NTFiZTBjN2EzMWM4OTQ1NmZjMTciLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6ImE5OGIwNjNkOWI0N2U2NTM3OTYyNTU3MmNjZTE5NzY2OWQ1NzY3ZTEyYzE4YmUwNzU2NTJiOGNkOTgxY2U4ZDUiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6ImNjZGNmMDZhY2Y0ZDYzMTJjOGU2YjM4ZDFjMjYwMDg1NmQzNGVhYTA0YWMwYjBlMDE1NzE1NzMxOGQ4ODkyMTIifQ"+ }+ ]+ },+ {+ "id": "claim_618d768bfc0a47dab16b578a6c8b24a9",+ "statement": "ToolNode is a specialized graph node that executes tool calls from AIMessage; it extracts ToolCall dicts, looks up BaseTool instances by name, invokes each with tool_call_id for error handling, and returns ToolMessage objects with matching tool_call_id and status (success/error) for model feedback, respecting each tool's handle_tool_error configuration.",+ "evidence": [+ {+ "resource": "repo://libs/langchain_v1/langchain/agents/factory.py#L1130-L1151",+ "version": "repo-lines-v1:sha256:0c8c554e463eebc0ddbb905d2f68ef27dd4514557cd5f3cd6ef20c4923bb4249:eyJzZWxlY3RlZExpbmVDb3VudCI6MjIsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjU5NmU1NTNmYjUxNmIyMjBjYzVkNTUzODNlNWQxNDYxY2EyODUzOTEyYTRjNWQwNjZiY2NlNjg3ZmYzNDI2MTkiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjJmZjBjZGJhYWE0MDI2YWZiNjNlOGRiYWE0MjYxMDA3YjIxN2U5MTNmMDZiMWJhZWFiOTdjMDU5Yzk2NDdlYTkiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6ImM0MDZiYjY2MjEzMDVlZGZmMDk1OGU4OWJiN2Y0NTM0ZDJiMTI3ZDIyYjJhYzkwNGU4ZDY1MzZmZjNjYzA5YjciLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6ImE5NTIwNWRlYWMwMzZhNjlhZDMyYjI5OTFlOWVjNWVlMWU2ODc3NzAzNjdmYTI1MWIyNmRlZjU1ZWI2YzBjYjMifQ"+ },+ {+ "resource": "repo://libs/langchain_v1/langchain/agents/factory.py#L35-L35",+ "version": "repo-lines-v1:sha256:b70871375ad326e56a68cade469735dc64df2896c92a7c74c3e223660f084545:eyJzZWxlY3RlZExpbmVDb3VudCI6MSwiZmlyc3RTZWxlY3RlZExpbmVIYXNoIjoiYjcwODcxMzc1YWQzMjZlNTZhNjhjYWRlNDY5NzM1ZGM2NGRmMjg5NmM5MmE3Yzc0YzNlMjIzNjYwZjA4NDU0NSIsImxhc3RTZWxlY3RlZExpbmVIYXNoIjoiYjcwODcxMzc1YWQzMjZlNTZhNjhjYWRlNDY5NzM1ZGM2NGRmMjg5NmM5MmE3Yzc0YzNlMjIzNjYwZjA4NDU0NSIsInByZWNlZGluZ0NvbnRleHRMaW5lQ291bnQiOjMsInByZWNlZGluZ0NvbnRleHRIYXNoIjoiNmExNjM0YjIzZTgwNmUzZmE1MTk1YTU3NjQ3ZTM3YTk5Y2QxZTE3N2RkNjc0NDA5MjYwYjFlYzVkODFmNTZkNyIsImZvbGxvd2luZ0NvbnRleHRMaW5lQ291bnQiOjMsImZvbGxvd2luZ0NvbnRleHRIYXNoIjoiYmUzMDQ2NGFhNGY3N2UwZTg4NTA1OGNkYWMwN2M4NmRjM2I5NDRkNGI0OWJkOGYyOGMxNTA4YWVmZjA0MGZmYiJ9"+ }+ ]+ },+ {+ "id": "claim_22655d955fe04510bbfa1ac534af7796",+ "statement": "Tool call extraction and validation follows: models emit structured JSON in AIMessage.tool_calls; ToolNode extracts ToolCall dicts with name/args/id; tool name is resolved against agent's tool registry; args dict is validated via tool's args_schema via Pydantic; invalid calls (unknown name, bad JSON, missing args) are caught and returned as ToolMessage with status=error for model correction.",+ "evidence": [+ {+ "resource": "repo://libs/core/langchain_core/tools/base.py#L1009-L1135",+ "version": "repo-lines-v1:sha256:899a9cd38841879080e0d62013f442bfbe7473c0ed4f2843d83e1e6d19116df1:eyJzZWxlY3RlZExpbmVDb3VudCI6MTI3LCJmaXJzdFNlbGVjdGVkTGluZUhhc2giOiIwMDhjZDk3OTY5Yjk0ZjdjYWJkOWFiODUyY2RlY2RjOWNlOTllNTJkNzJlYzFjZDE4YjhhZWNhMjlhOWUyYmUyIiwibGFzdFNlbGVjdGVkTGluZUhhc2giOiI4MjBlN2JiNmFkMzZjNjE5YWIxZjJiM2MyYjQzNTVjNjFlNWI1NTc3MmM4MmU2NGU1YmVkZmZkZDQ5YzQzNzMxIiwicHJlY2VkaW5nQ29udGV4dExpbmVDb3VudCI6MywicHJlY2VkaW5nQ29udGV4dEhhc2giOiI0ZDg5MjM5YTEwYTAwMTRmMjM0ZTE3MjM3NWQxMWZkZWFmNjdjNWFhNzJjZjFkYTMzMjMxMWQ3NGJiNjEwMTBhIiwiZm9sbG93aW5nQ29udGV4dExpbmVDb3VudCI6MywiZm9sbG93aW5nQ29udGV4dEhhc2giOiJjMTIxMzUwY2E0NmI3Yjc0OWVkZTdlYTBhNmFhYmQ1ZGFjYWNmYmJkMTdmOGRkZTZjMjZmMmRkN2UyN2IxYjkxIn0"+ }+ ]+ },+ {+ "id": "claim_b68aa35bc0644b9ab17bd9356474dedf",+ "statement": "Different model providers format tools using provider-specific utilities: OpenAI via convert_to_openai_function() generates function definitions with JSON schema parameters; Anthropic uses tool_use block format; each provider's bind_tools() converts tool_call_schema to provider format, optionally with provider extras (cache_control, defer_loading) before binding to model invocation.",+ "evidence": [+ {+ "resource": "repo://libs/core/langchain_core/utils/function_calling.py#L515-L574",+ "version": "repo-lines-v1:sha256:7cca7b42a0a127f5052b86dcf4a58517c20b7946f06473ae49e1cd038456f052:eyJzZWxlY3RlZExpbmVDb3VudCI6NjAsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6ImJmYWQ1OWViODM5NTI1YTAwNTY4NjE4YzNmODE5NzhlZjljNjZiNWI5ZGY4MmY0Njc4N2Q1Mzc1MTc3ZTJjNGMiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6ImU5NzBlNTVjMWM5NjNiOTJkN2RkNjMzMTBjMDY4MzAwMGYwYjgwMjEyMGI1NTFiZTBjN2EzMWM4OTQ1NmZjMTciLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6ImE5OGIwNjNkOWI0N2U2NTM3OTYyNTU3MmNjZTE5NzY2OWQ1NzY3ZTEyYzE4YmUwNzU2NTJiOGNkOTgxY2U4ZDUiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6ImNjZGNmMDZhY2Y0ZDYzMTJjOGU2YjM4ZDFjMjYwMDg1NmQzNGVhYTA0YWMwYjBlMDE1NzE1NzMxOGQ4ODkyMTIifQ"+ }+ ]}],"verification": {"by": "openwiki/0.5.0",- "at": "2026-10-16T08:25:55.096Z"+ "at": "2026-10-20T08:25:57.412Z"}}diff --git a/openwiki/.claims/unit-tests.json b/openwiki/.claims/unit-tests.jsonindex 1f332a0c94..266d60f608 100644--- a/openwiki/.claims/unit-tests.json+++ b/openwiki/.claims/unit-tests.json@@ -1,6 +1,6 @@{"schemaVersion": 1,- "pageVersion": "sha256:65f906ea13a560a244a94274e39853d77724d9155f5b1d7f6a03cf63bd4401a0",+ "pageVersion": "sha256:30f7076a57707ee9b99d576412ebd6ab8fd33cc101b67ac8a996c24d2ca4c7d2","claims": [{"id": "claim_bdde90f4e5f6413f8214fe7e80b66a9a",@@ -253,6 +253,6 @@],"verification": {"by": "openwiki/0.5.0",- "at": "2026-10-16T08:25:55.096Z"+ "at": "2026-10-20T08:25:57.412Z"}}diff --git a/openwiki/.last-update.json b/openwiki/.last-update.jsonindex bee5dcb77e..9627ba6121 100644--- a/openwiki/.last-update.json+++ b/openwiki/.last-update.json@@ -1,7 +1,7 @@{- "updatedAt": "2026-10-19T08:33:45.910Z",+ "updatedAt": "2026-10-20T09:03:29.657Z","command": "update",- "gitHead": "4fe944a581895ab47b0f56e204829594d5ba74a8",+ "gitHead": "afafd55d34cb11b794781fd0f7bef9127c633f84","model": "claude-haiku-4-5","status": "complete","language": "en"diff --git a/openwiki/.page-manifest.json b/openwiki/.page-manifest.jsonindex 6d44f0c90d..6bd05d076f 100644--- a/openwiki/.page-manifest.json+++ b/openwiki/.page-manifest.json@@ -2,165 +2,165 @@"schemaVersion": 1,"pages": {"/openwiki/agent-execution.md": {- "pageVersion": "sha256:c36ed3bfa6acfdaf33179bd7cf4a4811864ccff80181c5c88b46227be3eacc14",+ "pageVersion": "sha256:92e1659edb1431caa7488ed87852baf133c4e28a0c60dc030f37d14183bfcc34","completedBy": "openwiki/0.5.0",- "completedRunId": "ba665f2e-3417-4c76-8a2d-52fa91daba8a",- "gitHead": "4fe944a581895ab47b0f56e204829594d5ba74a8",- "sourceFingerprint": "sha256:26e1133e9f133d43aca68c19c6bd49891878f419ffac91efc49fe6eda894578a"+ "completedRunId": "93f7fa19-b0d9-4083-8bb8-7b8d5e2cf243",+ "gitHead": "afafd55d34cb11b794781fd0f7bef9127c633f84",+ "sourceFingerprint": "sha256:49ff29145e5143f8addbdef7c966ef3d960fba75f9aaee44f060341dc8946af9"},"/openwiki/agent-factory.md": {- "pageVersion": "sha256:a04138ae1db4de18f11689760a882c8412eab3e79b77dcabedd87303f75ae572",+ "pageVersion": "sha256:05ec9cf83d64fd275b2a0e1adba90063fa3b558ef7819d365e213c5c671b0e3d","completedBy": "openwiki/0.5.0",- "completedRunId": "ba665f2e-3417-4c76-8a2d-52fa91daba8a",- "gitHead": "4fe944a581895ab47b0f56e204829594d5ba74a8",- "sourceFingerprint": "sha256:26e1133e9f133d43aca68c19c6bd49891878f419ffac91efc49fe6eda894578a"+ "completedRunId": "93f7fa19-b0d9-4083-8bb8-7b8d5e2cf243",+ "gitHead": "afafd55d34cb11b794781fd0f7bef9127c633f84",+ "sourceFingerprint": "sha256:49ff29145e5143f8addbdef7c966ef3d960fba75f9aaee44f060341dc8946af9"},"/openwiki/architecture.md": {- "pageVersion": "sha256:a8a8280c4ddd71ccbbf3677a87a94d5c31685d96a5bb5cccd3c5dc0aee89dd80",+ "pageVersion": "sha256:33c8ba85a592f81d7a811f88b428dd70840db09b45def3921f13794e3c4add31","completedBy": "openwiki/0.5.0",- "completedRunId": "201c671f-83f0-45f8-92ce-18c70465fa25",- "gitHead": "4fe944a581895ab47b0f56e204829594d5ba74a8",- "sourceFingerprint": "sha256:26e1133e9f133d43aca68c19c6bd49891878f419ffac91efc49fe6eda894578a"+ "completedRunId": "93f7fa19-b0d9-4083-8bb8-7b8d5e2cf243",+ "gitHead": "afafd55d34cb11b794781fd0f7bef9127c633f84",+ "sourceFingerprint": "sha256:49ff29145e5143f8addbdef7c966ef3d960fba75f9aaee44f060341dc8946af9"},"/openwiki/callbacks.md": {- "pageVersion": "sha256:a78a1b44776018b2b89e5ce8c517e88fc5ec7f49e79d371e4ef23477fb4aed5f",+ "pageVersion": "sha256:319adc32e1b28ab8cf2f77a73f1d0e1f42b3f8f444674c03d3ec61e4a833fd63","completedBy": "openwiki/0.5.0",- "completedRunId": "f94a34bc-2b6e-4da1-9ac1-8a882a7bb35b",- "gitHead": "4fe944a581895ab47b0f56e204829594d5ba74a8",- "sourceFingerprint": "sha256:26e1133e9f133d43aca68c19c6bd49891878f419ffac91efc49fe6eda894578a"+ "completedRunId": "93f7fa19-b0d9-4083-8bb8-7b8d5e2cf243",+ "gitHead": "afafd55d34cb11b794781fd0f7bef9127c633f84",+ "sourceFingerprint": "sha256:49ff29145e5143f8addbdef7c966ef3d960fba75f9aaee44f060341dc8946af9"},"/openwiki/chat-models.md": {- "pageVersion": "sha256:d4e1d9ef9bf4df3d0af48fc7d5987181cc75cb01f01a63b305c09d741e0b7f7c",+ "pageVersion": "sha256:69ae6606835a7391ad452cf02839eb505c867719234e759cd642cacfeb3fd448","completedBy": "openwiki/0.5.0",- "completedRunId": "f94a34bc-2b6e-4da1-9ac1-8a882a7bb35b",- "gitHead": "4fe944a581895ab47b0f56e204829594d5ba74a8",- "sourceFingerprint": "sha256:26e1133e9f133d43aca68c19c6bd49891878f419ffac91efc49fe6eda894578a"+ "completedRunId": "93f7fa19-b0d9-4083-8bb8-7b8d5e2cf243",+ "gitHead": "afafd55d34cb11b794781fd0f7bef9127c633f84",+ "sourceFingerprint": "sha256:49ff29145e5143f8addbdef7c966ef3d960fba75f9aaee44f060341dc8946af9"},"/openwiki/ci-workflows.md": {- "pageVersion": "sha256:e12eb01b934b7a55a3e84d53fac3c48f28f9c03b5b2e7d14f47df7d98f8253fc",+ "pageVersion": "sha256:da5ba9e019af005b5bc6b68ae51a34dfb3d4f8ac1370d9207839f408f03f5df1","completedBy": "openwiki/0.5.0",- "completedRunId": "f94a34bc-2b6e-4da1-9ac1-8a882a7bb35b",- "gitHead": "4fe944a581895ab47b0f56e204829594d5ba74a8",- "sourceFingerprint": "sha256:26e1133e9f133d43aca68c19c6bd49891878f419ffac91efc49fe6eda894578a"+ "completedRunId": "93f7fa19-b0d9-4083-8bb8-7b8d5e2cf243",+ "gitHead": "afafd55d34cb11b794781fd0f7bef9127c633f84",+ "sourceFingerprint": "sha256:49ff29145e5143f8addbdef7c966ef3d960fba75f9aaee44f060341dc8946af9"},"/openwiki/composability.md": {- "pageVersion": "sha256:08b16574d155fea41f84c89a32fa0f8c6c34fcf5a6f640ab81d2d0dd5f796884",+ "pageVersion": "sha256:97475861bc89497ade34906008e15de726598966ea5262ccbb3ac874c4058013","completedBy": "openwiki/0.5.0",- "completedRunId": "ba665f2e-3417-4c76-8a2d-52fa91daba8a",- "gitHead": "4fe944a581895ab47b0f56e204829594d5ba74a8",- "sourceFingerprint": "sha256:26e1133e9f133d43aca68c19c6bd49891878f419ffac91efc49fe6eda894578a"+ "completedRunId": "93f7fa19-b0d9-4083-8bb8-7b8d5e2cf243",+ "gitHead": "afafd55d34cb11b794781fd0f7bef9127c633f84",+ "sourceFingerprint": "sha256:49ff29145e5143f8addbdef7c966ef3d960fba75f9aaee44f060341dc8946af9"},"/openwiki/dev-commands.md": {- "pageVersion": "sha256:0ec51ab0fa47477f5eb49c0577be6cd4558b283f0a678cd572dc0f65f65db57a",+ "pageVersion": "sha256:1e077d6d230b10aa6ab972d1298a9c1184b176fb5533a82ad57fd71e41255e15","completedBy": "openwiki/0.5.0",- "completedRunId": "ba665f2e-3417-4c76-8a2d-52fa91daba8a",- "gitHead": "4fe944a581895ab47b0f56e204829594d5ba74a8",- "sourceFingerprint": "sha256:26e1133e9f133d43aca68c19c6bd49891878f419ffac91efc49fe6eda894578a"+ "completedRunId": "93f7fa19-b0d9-4083-8bb8-7b8d5e2cf243",+ "gitHead": "afafd55d34cb11b794781fd0f7bef9127c633f84",+ "sourceFingerprint": "sha256:49ff29145e5143f8addbdef7c966ef3d960fba75f9aaee44f060341dc8946af9"},"/openwiki/integration-tests.md": {- "pageVersion": "sha256:7a27a082b6fe0666d7a3e17b00aac82017d7095d7cc66a084355eb8c5f47b347",+ "pageVersion": "sha256:1be30d833c732d00acbcfab6fd7f39ef050985ef73799852adb7e8a2c9de0ad7","completedBy": "openwiki/0.5.0",- "completedRunId": "ba665f2e-3417-4c76-8a2d-52fa91daba8a",- "gitHead": "4fe944a581895ab47b0f56e204829594d5ba74a8",- "sourceFingerprint": "sha256:26e1133e9f133d43aca68c19c6bd49891878f419ffac91efc49fe6eda894578a"+ "completedRunId": "93f7fa19-b0d9-4083-8bb8-7b8d5e2cf243",+ "gitHead": "afafd55d34cb11b794781fd0f7bef9127c633f84",+ "sourceFingerprint": "sha256:49ff29145e5143f8addbdef7c966ef3d960fba75f9aaee44f060341dc8946af9"},"/openwiki/mcp-integration.md": {- "pageVersion": "sha256:aa9e35da19127c337d9ca84bffab4b5b80d9cc78063469ee9a65827d4867d36c",+ "pageVersion": "sha256:4774281caf07d43ca8482b32d368fa17bb8d55b57aa1123ef43d83b3f1998cdd","completedBy": "openwiki/0.5.0",- "completedRunId": "ba665f2e-3417-4c76-8a2d-52fa91daba8a",- "gitHead": "4fe944a581895ab47b0f56e204829594d5ba74a8",- "sourceFingerprint": "sha256:26e1133e9f133d43aca68c19c6bd49891878f419ffac91efc49fe6eda894578a"+ "completedRunId": "93f7fa19-b0d9-4083-8bb8-7b8d5e2cf243",+ "gitHead": "afafd55d34cb11b794781fd0f7bef9127c633f84",+ "sourceFingerprint": "sha256:49ff29145e5143f8addbdef7c966ef3d960fba75f9aaee44f060341dc8946af9"},"/openwiki/messages.md": {- "pageVersion": "sha256:9a300b45af58ddf5b9c8a669d194b5ea592a85e27837e6b2066229dd7d924556",+ "pageVersion": "sha256:9d2bad428de5e38f36866a9e7a86d8653b2ad1628148cb2079acf2e7f8f0e7e4","completedBy": "openwiki/0.5.0",- "completedRunId": "ba665f2e-3417-4c76-8a2d-52fa91daba8a",- "gitHead": "4fe944a581895ab47b0f56e204829594d5ba74a8",- "sourceFingerprint": "sha256:26e1133e9f133d43aca68c19c6bd49891878f419ffac91efc49fe6eda894578a"+ "completedRunId": "93f7fa19-b0d9-4083-8bb8-7b8d5e2cf243",+ "gitHead": "afafd55d34cb11b794781fd0f7bef9127c633f84",+ "sourceFingerprint": "sha256:49ff29145e5143f8addbdef7c966ef3d960fba75f9aaee44f060341dc8946af9"},"/openwiki/middleware.md": {- "pageVersion": "sha256:b8080e5df75c67cc4c69c2dc6ae72e2c8385efe2b711e32f89d064f4c2925191",+ "pageVersion": "sha256:3e2a5b3cbf1f0cf13ad86c8a1be82a3e64735424a664221373888efa04be5322","completedBy": "openwiki/0.5.0",- "completedRunId": "f94a34bc-2b6e-4da1-9ac1-8a882a7bb35b",- "gitHead": "4fe944a581895ab47b0f56e204829594d5ba74a8",- "sourceFingerprint": "sha256:26e1133e9f133d43aca68c19c6bd49891878f419ffac91efc49fe6eda894578a"+ "completedRunId": "93f7fa19-b0d9-4083-8bb8-7b8d5e2cf243",+ "gitHead": "afafd55d34cb11b794781fd0f7bef9127c633f84",+ "sourceFingerprint": "sha256:49ff29145e5143f8addbdef7c966ef3d960fba75f9aaee44f060341dc8946af9"},"/openwiki/model-initialization.md": {- "pageVersion": "sha256:bd811dcc6b70cbe1b135d1ae06d5196272d0742d1df5c7491d4adfa89cf21a9a",+ "pageVersion": "sha256:5a2be7274697dcbafac21e6bf5ba7bab6b2d063b4cc2d2d6e5b907fc326ff7bc","completedBy": "openwiki/0.5.0",- "completedRunId": "ba665f2e-3417-4c76-8a2d-52fa91daba8a",- "gitHead": "4fe944a581895ab47b0f56e204829594d5ba74a8",- "sourceFingerprint": "sha256:26e1133e9f133d43aca68c19c6bd49891878f419ffac91efc49fe6eda894578a"+ "completedRunId": "93f7fa19-b0d9-4083-8bb8-7b8d5e2cf243",+ "gitHead": "afafd55d34cb11b794781fd0f7bef9127c633f84",+ "sourceFingerprint": "sha256:49ff29145e5143f8addbdef7c966ef3d960fba75f9aaee44f060341dc8946af9"},"/openwiki/openai-provider.md": {- "pageVersion": "sha256:a04ac2a2275b26e967eb8732d53b5e7b4a2f0bcece2b6bd58dd768eaa08b1435",+ "pageVersion": "sha256:3b62c72f2c6094be774a0fadd4114b6a4dd8aeb8e9ca7056d8cef7983e876a40","completedBy": "openwiki/0.5.0",- "completedRunId": "f94a34bc-2b6e-4da1-9ac1-8a882a7bb35b",- "gitHead": "4fe944a581895ab47b0f56e204829594d5ba74a8",- "sourceFingerprint": "sha256:26e1133e9f133d43aca68c19c6bd49891878f419ffac91efc49fe6eda894578a"+ "completedRunId": "93f7fa19-b0d9-4083-8bb8-7b8d5e2cf243",+ "gitHead": "afafd55d34cb11b794781fd0f7bef9127c633f84",+ "sourceFingerprint": "sha256:49ff29145e5143f8addbdef7c966ef3d960fba75f9aaee44f060341dc8946af9"},"/openwiki/partner-pattern.md": {- "pageVersion": "sha256:bd88bc8f77ba65a0d006fb5b078a928cb1abd56f3b6a6959908e28dede3409b6",+ "pageVersion": "sha256:f108faaa3396cd150a11b17a4e481b11cb9a6cd907e10498f36c4dc1a29eabbf","completedBy": "openwiki/0.5.0",- "completedRunId": "f94a34bc-2b6e-4da1-9ac1-8a882a7bb35b",- "gitHead": "4fe944a581895ab47b0f56e204829594d5ba74a8",- "sourceFingerprint": "sha256:26e1133e9f133d43aca68c19c6bd49891878f419ffac91efc49fe6eda894578a"+ "completedRunId": "93f7fa19-b0d9-4083-8bb8-7b8d5e2cf243",+ "gitHead": "afafd55d34cb11b794781fd0f7bef9127c633f84",+ "sourceFingerprint": "sha256:49ff29145e5143f8addbdef7c966ef3d960fba75f9aaee44f060341dc8946af9"},"/openwiki/prompts.md": {- "pageVersion": "sha256:479c5428fb5c4d5a6a9cb84f2f11bf8a578e6af0b1f5e1208f47fa98d0f563df",+ "pageVersion": "sha256:a3a993a0163b7711b9ea4a298f431f50bcf2d1e4ee6aacff72765c6128326ef4","completedBy": "openwiki/0.5.0",- "completedRunId": "ba665f2e-3417-4c76-8a2d-52fa91daba8a",- "gitHead": "4fe944a581895ab47b0f56e204829594d5ba74a8",- "sourceFingerprint": "sha256:26e1133e9f133d43aca68c19c6bd49891878f419ffac91efc49fe6eda894578a"+ "completedRunId": "93f7fa19-b0d9-4083-8bb8-7b8d5e2cf243",+ "gitHead": "afafd55d34cb11b794781fd0f7bef9127c633f84",+ "sourceFingerprint": "sha256:49ff29145e5143f8addbdef7c966ef3d960fba75f9aaee44f060341dc8946af9"},"/openwiki/quickstart.md": {- "pageVersion": "sha256:0f7765fb1d5ef0b5af05853c8dd950bee0d5f1bc0dc545d12d841f726b374f51",+ "pageVersion": "sha256:fb0558a846d2bb48b39f75e29312f97379fab566b6f5fe4129ce562061674b2c","completedBy": "openwiki/0.5.0",- "completedRunId": "201c671f-83f0-45f8-92ce-18c70465fa25",- "gitHead": "4fe944a581895ab47b0f56e204829594d5ba74a8",- "sourceFingerprint": "sha256:26e1133e9f133d43aca68c19c6bd49891878f419ffac91efc49fe6eda894578a"+ "completedRunId": "93f7fa19-b0d9-4083-8bb8-7b8d5e2cf243",+ "gitHead": "afafd55d34cb11b794781fd0f7bef9127c633f84",+ "sourceFingerprint": "sha256:49ff29145e5143f8addbdef7c966ef3d960fba75f9aaee44f060341dc8946af9"},"/openwiki/runnables.md": {- "pageVersion": "sha256:3c4eabfc05e650c9d18abad787eb26ca228fccc2f2993bae92151344718c1698",+ "pageVersion": "sha256:475690ec509a89d75f95c038280bda38de49b3228a17ccbc3ecdda4cb5a287b8","completedBy": "openwiki/0.5.0",- "completedRunId": "f94a34bc-2b6e-4da1-9ac1-8a882a7bb35b",- "gitHead": "4fe944a581895ab47b0f56e204829594d5ba74a8",- "sourceFingerprint": "sha256:26e1133e9f133d43aca68c19c6bd49891878f419ffac91efc49fe6eda894578a"+ "completedRunId": "93f7fa19-b0d9-4083-8bb8-7b8d5e2cf243",+ "gitHead": "afafd55d34cb11b794781fd0f7bef9127c633f84",+ "sourceFingerprint": "sha256:49ff29145e5143f8addbdef7c966ef3d960fba75f9aaee44f060341dc8946af9"},"/openwiki/source-map.md": {- "pageVersion": "sha256:52313842b55fedcf187350157ca3802ebe7d58aa780a8065539a57e5c99d95c8",+ "pageVersion": "sha256:5e4b92c2cb6f167b3e78d25a80ee2b9b9bccebaa00d1153a2551cf9c114577d0","completedBy": "openwiki/0.5.0",- "completedRunId": "201c671f-83f0-45f8-92ce-18c70465fa25",- "gitHead": "4fe944a581895ab47b0f56e204829594d5ba74a8",- "sourceFingerprint": "sha256:26e1133e9f133d43aca68c19c6bd49891878f419ffac91efc49fe6eda894578a"+ "completedRunId": "93f7fa19-b0d9-4083-8bb8-7b8d5e2cf243",+ "gitHead": "afafd55d34cb11b794781fd0f7bef9127c633f84",+ "sourceFingerprint": "sha256:49ff29145e5143f8addbdef7c966ef3d960fba75f9aaee44f060341dc8946af9"},"/openwiki/streaming.md": {- "pageVersion": "sha256:2de6aba507dba1baae1391c75deecbbcaa023c038ca1aedf859e19eafb44bf2f",+ "pageVersion": "sha256:b594d5497c4409f0fd87498a02ca117318c50856bf0bedeed627b72e4e2c2a8f","completedBy": "openwiki/0.5.0",- "completedRunId": "f94a34bc-2b6e-4da1-9ac1-8a882a7bb35b",- "gitHead": "4fe944a581895ab47b0f56e204829594d5ba74a8",- "sourceFingerprint": "sha256:26e1133e9f133d43aca68c19c6bd49891878f419ffac91efc49fe6eda894578a"+ "completedRunId": "93f7fa19-b0d9-4083-8bb8-7b8d5e2cf243",+ "gitHead": "afafd55d34cb11b794781fd0f7bef9127c633f84",+ "sourceFingerprint": "sha256:49ff29145e5143f8addbdef7c966ef3d960fba75f9aaee44f060341dc8946af9"},"/openwiki/structured-output.md": {- "pageVersion": "sha256:f21e3e28f4b0f6a2e1676685bc07733d58f0c614276dc01afd01919fa0c76167",+ "pageVersion": "sha256:b59d18005bb60bd8a9e3ffedc320256d9d8ef28d14d01731550757571a74afc5","completedBy": "openwiki/0.5.0",- "completedRunId": "ba665f2e-3417-4c76-8a2d-52fa91daba8a",- "gitHead": "4fe944a581895ab47b0f56e204829594d5ba74a8",- "sourceFingerprint": "sha256:26e1133e9f133d43aca68c19c6bd49891878f419ffac91efc49fe6eda894578a"+ "completedRunId": "93f7fa19-b0d9-4083-8bb8-7b8d5e2cf243",+ "gitHead": "afafd55d34cb11b794781fd0f7bef9127c633f84",+ "sourceFingerprint": "sha256:49ff29145e5143f8addbdef7c966ef3d960fba75f9aaee44f060341dc8946af9"},"/openwiki/tools.md": {- "pageVersion": "sha256:5ef144d1673a8c9bac92b48f6531aa2f32ae51805f71e0cf48eb3dfbba7ddb34",+ "pageVersion": "sha256:8c205f9cfc427a48af09a109860f0eb9febf4772e344a443382f2f743b6c4e79","completedBy": "openwiki/0.5.0",- "completedRunId": "f94a34bc-2b6e-4da1-9ac1-8a882a7bb35b",- "gitHead": "4fe944a581895ab47b0f56e204829594d5ba74a8",- "sourceFingerprint": "sha256:26e1133e9f133d43aca68c19c6bd49891878f419ffac91efc49fe6eda894578a"+ "completedRunId": "93f7fa19-b0d9-4083-8bb8-7b8d5e2cf243",+ "gitHead": "afafd55d34cb11b794781fd0f7bef9127c633f84",+ "sourceFingerprint": "sha256:49ff29145e5143f8addbdef7c966ef3d960fba75f9aaee44f060341dc8946af9"},"/openwiki/unit-tests.md": {- "pageVersion": "sha256:65f906ea13a560a244a94274e39853d77724d9155f5b1d7f6a03cf63bd4401a0",+ "pageVersion": "sha256:30f7076a57707ee9b99d576412ebd6ab8fd33cc101b67ac8a996c24d2ca4c7d2","completedBy": "openwiki/0.5.0",- "completedRunId": "f94a34bc-2b6e-4da1-9ac1-8a882a7bb35b",- "gitHead": "4fe944a581895ab47b0f56e204829594d5ba74a8",- "sourceFingerprint": "sha256:26e1133e9f133d43aca68c19c6bd49891878f419ffac91efc49fe6eda894578a"+ "completedRunId": "93f7fa19-b0d9-4083-8bb8-7b8d5e2cf243",+ "gitHead": "afafd55d34cb11b794781fd0f7bef9127c633f84",+ "sourceFingerprint": "sha256:49ff29145e5143f8addbdef7c966ef3d960fba75f9aaee44f060341dc8946af9"}}}diff --git a/openwiki/agent-execution.md b/openwiki/agent-execution.mdindex a0fca146cc..c72977a5f0 100644--- a/openwiki/agent-execution.md+++ b/openwiki/agent-execution.md@@ -5,7 +5,7 @@ description: Traces the runtime lifecycle of an agent from user input through motags: [agent-execution, control-flow, state-machine, loop-control, tool-dispatch, middleware, langchain]verified:- by: openwiki/0.5.0- at: 2026-09-28T08:35:20.640Z+ at: 2026-10-20T08:25:57.412Zsources:- id: openwiki-source-71e882e1ac9757ea8e959a7cresource: repo://libs/langchain_v1/langchain/agents/factory.pydiff --git a/openwiki/agent-factory.md b/openwiki/agent-factory.mdindex a236c388df..0396f74153 100644--- a/openwiki/agent-factory.md+++ b/openwiki/agent-factory.md@@ -15,7 +15,7 @@ sources:generated: { by: "openwiki/0.5.0", at: "2026-09-21T08:30:16.745Z" }verified:- by: openwiki/0.5.0- at: 2026-09-28T08:35:20.640Z+ at: 2026-10-20T08:25:57.412Z---## Overviewdiff --git a/openwiki/architecture.md b/openwiki/architecture.mdindex cc62c96570..5c9c52e3ed 100644--- a/openwiki/architecture.md+++ b/openwiki/architecture.md@@ -37,7 +37,7 @@ sources:generated: { by: "openwiki/0.5.0", at: "2026-10-19T08:31:23.057Z" }verified:- by: openwiki/0.5.0- at: 2026-10-19T08:31:23.057Z+ at: 2026-10-20T08:25:57.412Z---## Overviewdiff --git a/openwiki/callbacks.md b/openwiki/callbacks.mdindex 00dd44ce81..d246fb7531 100644--- a/openwiki/callbacks.md+++ b/openwiki/callbacks.md@@ -23,7 +23,7 @@ sources:generated: { by: "openwiki/0.5.0", at: "2026-09-28T08:35:20.640Z" }verified:- by: openwiki/0.5.0- at: 2026-10-16T08:25:55.096Z+ at: 2026-10-20T08:25:57.412Z---diff --git a/openwiki/chat-models.md b/openwiki/chat-models.mdindex 0d311989c5..cf0baca10e 100644--- a/openwiki/chat-models.md+++ b/openwiki/chat-models.md@@ -17,7 +17,7 @@ sources:generated: { by: "openwiki/0.5.0", at: "2026-09-28T08:35:20.640Z" }verified:- by: openwiki/0.5.0- at: 2026-10-16T08:25:55.096Z+ at: 2026-10-20T08:25:57.412Z---## Overviewdiff --git a/openwiki/ci-workflows.md b/openwiki/ci-workflows.mdindex 89ede7978e..0e98075d18 100644--- a/openwiki/ci-workflows.md+++ b/openwiki/ci-workflows.md@@ -28,10 +28,12 @@ sources:resource: repo://.github/workflows/pr_labeler.yml- id: openwiki-source-12805fbf767dc2a3e238645eresource: repo://.github/workflows/pr_lint.yml-generated: { by: "openwiki/0.5.0", at: "2026-09-28T08:35:20.640Z" }+ - id: openwiki-source-4d1645cb6317345817452838+ resource: repo://.pre-commit-config.yaml+generated: { by: "openwiki/0.5.0", at: "2026-10-20T08:25:57.412Z" }verified:- by: openwiki/0.5.0- at: 2026-10-16T08:25:55.096Z+ at: 2026-10-20T08:25:57.412Z---# CI/CD Workflows: GitHub Actions and Release Process@@ -329,6 +331,41 @@ Two modes:- Optional `allow-prereleases` flag permits transitive prerelease dependencies during alpha cycles- Final releases block prerelease dependencies unless explicitly allowed+## Pre-Commit Hooks++Local developers use pre-commit hooks (`.pre-commit-config.yaml`) to enforce code quality standards before pushing:++### Hook Categories++**Standard hooks** (all packages):+- **Branch protection**: Prevents direct commits to `master` branch+- **YAML/TOML validation**: Ensures valid syntax+- **Whitespace fixes**: Removes trailing spaces, ensures newline-terminated files+- **Smart quotes normalization**: Converts curly quotes to straight quotes+- **Space normalization**: Replaces non-breaking spaces with regular spaces++**Per-package format & lint hooks**:+- Each package directory (core, langchain, standard-tests, text-splitters, and 17+ partner packages) runs:+ - `make format`: Auto-formats code (via ruff, Black, etc.)+ - `make lint`: Lints code (via Ruff, MyPy, markdown-lint)+- Partner packages run both targets with their own isolated Makefiles+- Hooks trigger only when files in that package directory change++**Version consistency hooks**:+- Enforce that version strings in `pyproject.toml` match version files (e.g., `langchain_core/version.py`)+- Applies to core, langchain_v1, anthropic, chroma, and deepseek packages+- Prevents accidental version mismatches during development++### Workflow++1. **Local commit**: Developer runs `git commit`+2. **Pre-commit triggers**: Hooks run against staged files+3. **Formatting applied**: Hooks auto-format code in place+4. **If issues remain**: Commit aborts; developer must fix remaining issues (e.g., lint violations) and re-stage+5. **Success**: Commit proceeds after all checks pass++This catches common issues before pushing and reduces CI turnaround time for formatting-only changes.+## Configuration & Operations### Environment Variables@@ -364,6 +401,108 @@ Isolated jobs (build, testing) receive no write permissions; publishing jobs run- Supports per-package cache suffixes to avoid cross-contamination- Parameters: `python-version`, `cache-suffix`, `working-directory`, `enable-cache`+## Workflow Selection & Running Locally++### Selecting CI Workflows for Pull Requests++CI runs automatically on all pull requests. The `check_diffs.yml` workflow intelligently selects which checks to run based on files changed:++**Change detection maps files to workflows**:+- Changes in `libs/core/` → Full linting, unit tests, Pydantic compatibility, integration test compilation; downstream packages also tested+- Changes in `libs/langchain/`, `libs/text-splitters/`, etc. → Linting, unit tests, downstream dependency tests+- Changes in `libs/partners/{name}/` → Package-specific linting, unit tests, integration tests (if supported), and tests for affected dependents+- No package changes (e.g., `.github/`, docs-only) → Skips package CI; may run workflow-related checks instead+- `ci-ignore` label on PR → Skips all checks (use with caution for pure documentation updates)++The `check_diffs.py` script outputs separate matrices for each check type, allowing parallel execution and fast feedback on unaffected packages.++### Debugging CI Failures++**Common failure patterns**:++1. **Linting failures** (`🧹 Linting` job):+ - **Ruff violations**: Inline GitHub annotations show exact lines. Run `make lint_package` locally to see full output+ - **MyPy type errors**: Run `make lint_tests` to check test code type stubs+ - **Markdown lint**: Check `.markdownlint.json` rules; run locally to debug++2. **Unit test failures** (`🧪 Unit Testing` job):+ - **Current dependency failures**: Run `make test PYTEST_EXTRA=-q` locally with same Python version+ - **Minimum version failures**: Run the minimum-versions step locally to reproduce: extract min versions via `get_min_versions.py`, downgrade via `uv pip install <min-spec>`, then re-run tests+ - **Clean working directory**: If tests generate files, CI will fail the cleanup step; ensure tests clean up or add patterns to `.gitignore`++3. **Pydantic compatibility failures** (`🐍 Pydantic Version Testing`):+ - Reproduce locally: `uv pip install "pydantic~=<failing-version>"` then `make test`+ - Check for hardcoded Pydantic version assumptions in code++4. **VCR cassette failures** (`📼 VCR Cassette Tests`):+ - Stale cassettes detected: Cassette file doesn't match current test inputs+ - Re-record locally with real API credentials: `make test_vcr --record` or set `CASSETTE_RECORD=new` environment variable+ - Commit updated cassette file++5. **Integration test compilation failures** (`🔗 Compile Integration Tests`):+ - Import or syntax errors in test code: Run `pytest -m compile tests/integration_tests` locally+ - Missing dependencies: Ensure `test_integration` group is installed via `uv sync --group test_integration`++6. **Release workflow failures**:+ - **Version mismatch**: Check that `pyproject.toml` version matches the release version input (PEP 440 normalization applied)+ - **PyPI already published**: Version already exists on PyPI; increment version and retry+ - **Pre-release checks fail**: Run wheel install, import, and unit tests locally to diagnose+ - **Prior partner tests fail**: The new core breaks an existing partner package; investigate breaking API changes++7. **PR lint failures** (`🏷️ PR Title Lint`):+ - **Conventional Commits format**: PR title must match `<type>[optional scope]: <description>` with allowed types and scopes+ - **Empty scope parentheses**: Rejected; either remove `()` or provide a scope like `(core)`+ - **Invalid type or scope**: Check the `pr_lint.yml` file for complete allowed lists++### Running Workflows Locally++Most CI workflows require GitHub Actions context (secrets, `GITHUB_OUTPUT`, etc.) and cannot fully run locally. However, you can simulate the key steps:++**Simulate linting**:+```bash+cd libs/core # or your package+make lint_package # lint package code+make lint_tests # lint test code+```++**Simulate unit tests**:+```bash+cd libs/core+make test PYTEST_EXTRA=-q # current dependencies+python -m pip install packaging requests+python .github/scripts/get_min_versions.py pyproject.toml pull_request 3.11 # get min spec+pip install <min-spec>+make tests PYTEST_EXTRA=-q # minimum dependencies+```++**Simulate release pre-checks**:+```bash+cd libs/core+uv build # build distributions+uv pip install dist/*.whl # install wheel+python -c "import langchain_core" # verify import+make tests # run full test suite+python .github/scripts/check_prerelease_dependencies.py pyproject.toml # check deps+```++**Using pre-commit locally**:+```bash+pip install pre-commit+cd <repo-root>+pre-commit run --all-files # run all checks against staged files+pre-commit run --hook-stage commit # run only commit-stage hooks+```++### Key Workflow Files Reference++- **Primary CI**: `.github/workflows/check_diffs.yml` (entry point for PR tests)+- **Linting template**: `.github/workflows/_lint.yml` (reusable, called by check_diffs)+- **Unit tests template**: `.github/workflows/_test.yml` (reusable, called by check_diffs)+- **Release workflow**: `.github/workflows/_release.yml` (manual dispatch for releases)+- **Integration tests**: `.github/workflows/integration_tests.yml` (daily + manual dispatch)+- **Change detection script**: `.github/scripts/check_diff.py` (determines test matrices)+- **Version management script**: `.github/scripts/get_min_versions.py` (extracts min versions)+## Important Invariants & Failure Modes1. **No caching in release pre-checks**: Missing dependencies would be masked by cached venvs, allowing broken releases to publishdiff --git a/openwiki/composability.md b/openwiki/composability.mdindex 5c2d851bb3..1a2d3b1eb6 100644--- a/openwiki/composability.md+++ b/openwiki/composability.md@@ -1,604 +1,685 @@---type: "Concept"-title: "Composability and LCEL Chains"-description: "How Runnable components compose through LCEL operators, creating reusable workflows with automatic async, batch, and streaming support."-tags: ["composability", "LCEL", "runnables", "chaining", "operators"]-sources:- - id: openwiki-source-a1981e868973f6fd7f71e12e- resource: repo://libs/core/langchain_core/runnables/base.py- - id: openwiki-source-48e94bbe49ab4f33ba87e9cb- resource: repo://libs/core/langchain_core/runnables/branch.py- - id: openwiki-source-f9f4c1dc4f9cdf80d824ce15- resource: repo://libs/core/langchain_core/runnables/fallbacks.py- - id: openwiki-source-de6c904bd0171642bd50f6d9- resource: repo://libs/core/langchain_core/runnables/router.py-generated: { by: "openwiki/0.5.0", at: "2026-09-28T08:35:20.640Z" }+title: "Agent Composability: Building Complex Agents"+description: "Patterns for composing agents through middleware layers, subagent delegation, tool selection strategies, and context management across hierarchical agent workflows."+tags: ["composability", "agents", "middleware", "subagents", "tool-delegation", "context-management"]verified:- by: openwiki/0.5.0- at: 2026-09-28T08:35:20.640Z+ at: 2026-10-20T08:25:57.412Z+sources:+ - id: openwiki-source-2bb5c49861e72a9099b51970+ resource: repo://libs/langchain_v1/langchain/agents/_subagent_transformer.py+ - id: openwiki-source-71e882e1ac9757ea8e959a7c+ resource: repo://libs/langchain_v1/langchain/agents/factory.py+ - id: openwiki-source-737abffff349404aff61cdc1+ resource: repo://libs/langchain_v1/langchain/agents/middleware/provider_tool_search.py+ - id: openwiki-source-a5eb2874945fdc55df0c578f+ resource: repo://libs/langchain_v1/langchain/agents/middleware/tool_selection.py+ - id: openwiki-source-03e8ca0eebe37feda8566793+ resource: repo://libs/langchain_v1/langchain/agents/middleware/types.py+generated: { by: "openwiki/0.5.0", at: "2026-10-20T08:25:57.412Z" }----## Overview-Composability is the core feature of LangChain's Runnable protocol: the ability to declaratively chain, parallelize, and conditionally route components. Every composed chain automatically inherits sync (`invoke`), async (`ainvoke`), batch (`batch`/`abatch`), and streaming (`stream`/`astream`) capabilities—with optimizations for efficiency.--The two main composition primitives are **`RunnableSequence`** (sequential chaining via the `|` operator) and **`RunnableParallel`** (parallel execution via dict syntax). Conditional routing is achieved with **`RunnableBranch`** and **`RouterRunnable`**.+Agent composability in LangChain enables building complex, hierarchical agent systems through three primary mechanisms: **middleware composition** (layered request/response interception), **subagent delegation** (tool-based agent dispatch), and **tool selection strategies** (filtering and routing). These patterns allow multiple agents to coordinate, share context, and delegate specialized tasks while maintaining observability and fault isolation.-## Sequential Composition: The `|` Operator+The composability model is fundamentally built on **middleware layers** that wrap and transform agent execution at multiple hooks (before/after agent, before/after model, around tool execution), combined with **parallel/sequential tool execution** via LangGraph's `Send` command and **state schema composition** that merges input from multiple agents into unified workflows.-The **pipe operator** (`|`) chains Runnables in sequence, with each step's output becoming the next step's input. This is the most common composition pattern.+## Middleware Composition: Layering Request/Response Handlers-```python-from langchain_core.runnables import RunnableLambda--add_one = RunnableLambda(lambda x: x + 1)-mul_two = RunnableLambda(lambda x: x * 2)+Middleware forms the backbone of agent composability. Each middleware instance registers hooks that intercept execution at well-defined points, enabling cross-cutting concerns without modifying core agent logic.-sequence = add_one | mul_two-sequence.invoke(1) # (1 + 1) * 2 = 4-```+### Middleware Stack Architecture-The `|` operator creates a **`RunnableSequence`**, which:-- Invokes each step in order, passing output to the next input-- Flattens nested sequences for efficiency-- Automatically preserves streaming properties if all steps support the `transform` method-- Supports both sync and async execution+When multiple middleware are registered, they compose into a stack where **first in the list becomes the outermost layer**:-### Data Flow+```python+from langchain.agents import create_agent+from langchain.agents.middleware import (+ AgentMiddleware,+ ModelRequest,+ ModelResponse,+)-```-Input → Step 1 → Step 2 → Step 3 → Output+class LoggingMiddleware(AgentMiddleware):+ def wrap_model_call(self, request, handler):+ print(f"Calling model with {len(request.tools)} tools")+ response = handler(request)+ print(f"Model returned {len(response.result)} messages")+ return response++class RetryMiddleware(AgentMiddleware):+ def wrap_model_call(self, request, handler):+ for attempt in range(3):+ try:+ return handler(request)+ except Exception as e:+ if attempt == 2:+ raise+ print(f"Retry attempt {attempt + 1}")++# Middleware order: LoggingMiddleware wraps RetryMiddleware wraps the model+agent = create_agent(+ model="openai:gpt-4o",+ tools=[...],+ middleware=[+ LoggingMiddleware(),+ RetryMiddleware(),+ ]+)```-When a dict is piped into a sequence, it becomes a **`RunnableParallel`**:+**Control flow:** LoggingMiddleware.wrap_model_call → RetryMiddleware.wrap_model_call → actual model execution-```python-sequence = add_one | {- "mul_2": RunnableLambda(lambda x: x * 2),- "mul_5": RunnableLambda(lambda x: x * 5),-}-sequence.invoke(1) # {'mul_2': 4, 'mul_5': 10}-```+Middleware receive a `handler` callback (the next layer) and must invoke it to continue execution. Each middleware can:+- **Inspect** the request or response without modification+- **Rewrite** the request (e.g., modify tools, system message, state) before calling handler+- **Short-circuit** execution (skip handler entirely to return early)+- **Retry** by calling handler multiple times+- **Return commands** from `wrap_model_call` or `wrap_tool_call` to control graph flow-## Parallel Composition: Branching with `+` and Dict Syntax+### Lifecycle Hooks-Parallel execution invokes multiple Runnables concurrently on the **same input**. This is achieved via dict literals within a sequence or directly with **`RunnableParallel`**.+Each agent execution triggers multiple hooks in sequence:-### Dict Literal Syntax+1. **`before_agent(state, runtime)`** – Runs once at start, before the first model call+2. **`before_model(state, runtime)`** – Runs before each model invocation; can update state or jump to different nodes+3. **`wrap_model_call(request, handler)`** – Intercepts the actual model call; middleware chains are composed here+4. **`after_model(state, runtime)`** – Runs after model response; can filter tool calls or update state+5. **`wrap_tool_call(request, handler)`** – Intercepts each tool execution+6. **`after_agent(state, runtime)`** – Runs once at end, after loop terminates-```python-from langchain_core.runnables import RunnableLambda, RunnableParallel--add_one = RunnableLambda(lambda x: x + 1)-mul_two = RunnableLambda(lambda x: x * 2)-mul_three = RunnableLambda(lambda x: x * 3)--# Dict syntax creates a RunnableParallel-sequence = add_one | {- "mul_2": mul_two,- "mul_3": mul_three,-}-sequence.invoke(1)-# Output: {'mul_2': 4, 'mul_3': 6}-```+### State Flow Through Middleware-### Explicit RunnableParallel+All hooks receive `state: AgentState[ResponseT]` and `runtime: Runtime[ContextT]`. The `AgentState` is a TypedDict containing:```python-parallel = RunnableParallel(- mul_2=mul_two,- mul_3=mul_three,-)-parallel.invoke(2)-# Output: {'mul_2': 4, 'mul_3': 6}+class AgentState(TypedDict):+ messages: Required[list[AnyMessage]] # Conversation history+ jump_to: NotRequired[JumpTo | None] # "model" | "tools" | "end" (ephemeral)+ structured_response: NotRequired[Any] # Parsed structured output (if configured)```-### Concurrent Execution--- **`RunnableParallel`** creates independent input copies for each branch using `atee` (async) or `safetee` (sync)-- Each branch executes concurrently, with chunks yielded in the order they complete-- For async streaming, tasks are managed with `asyncio.wait(return_when=FIRST_COMPLETED)` to emit output as soon as any branch produces a chunk-- The final result is a dict combining outputs from all branches+Hooks return `dict[str, Any] | None` for state updates. Updates are merged into the state using LangGraph reducers (e.g., `add_messages` for the `messages` field). The `jump_to` field allows middleware to override default routing—set to `"tools"` to skip the model, `"model"` to loop back, or `"end"` to exit early.-## Batching: Parallel Invocation over Multiple Inputs+### Model Call Interception-Batching processes multiple inputs efficiently through a pipeline. Unlike parallel branching, batching applies the **same sequence** to each input in parallel.+The `wrap_model_call` hook provides deepest control over model behavior. The middleware receives a `ModelRequest` containing:-### Sync Batch--```python-sequence = add_one | mul_two-results = sequence.batch([1, 2, 3])-# [4, 6, 8] # Each input processed in parallel via thread pool-```+- **`model`**: The LLM instance+- **`messages`**: List of conversation messages (excluding system prompt)+- **`system_message`**: SystemMessage instance (or None)+- **`tools`**: List of available tools+- **`tool_choice`**: Tool selection preference (e.g., `required`, `any`, specific tool name)+- **`response_format`**: Structured output specification (if enabled)+- **`state`**: Current agent state dictionary+- **`runtime`**: Runtime context with access to checkpointer, store, etc.-### Async Batch+Middleware can call `request.override(**updates)` to create a modified request:```python-results = await sequence.abatch([1, 2, 3])-# [4, 6, 8]+class ToolFilteringMiddleware(AgentMiddleware):+ def wrap_model_call(self, request, handler):+ # Keep only tools whose names start with 'safe_'+ filtered_tools = [+ t for t in request.tools+ if t.name.startswith('safe_')+ ]+ modified_request = request.override(tools=filtered_tools)+ return handler(modified_request)```-### Implementation+The handler returns a `ModelResponse` (or `AIMessage` or `ExtendedModelResponse` for command support), which middleware can inspect, modify, or replace before returning to the next layer.-- Default `batch` uses a thread pool executor via `get_executor_for_config`-- `abatch` uses `asyncio.gather` with concurrency control via `max_concurrency`-- Each step in the sequence batches its inputs independently-- **`RunnableSequence`** calls `batch` on each step in order, feeding outputs to the next+## Parallel and Sequential Tool Execution: Using `Send`-## Streaming: Token-by-Token Output+The agent's tool dispatch layer supports both parallel and sequential execution patterns through LangGraph's `Send` command. When a model requests multiple tools, the graph can dispatch them in parallel, each receiving its own isolated tool call.-Streaming emits output chunks as they are produced, enabling real-time responses from LLMs and other sequential generators.+### Parallel Tool Dispatch via `Send`-### Stream Method+The default tool routing dispatches each tool call independently:```python-for chunk in sequence.stream(1):- print(chunk) # Intermediate outputs as they become available+# In the model → tools edge decision logic:+if pending_tool_calls:+ # Each tool call gets a separate Send to the tools node+ return [Send("tools", [tool_call]) for tool_call in pending_tool_calls]```-### Astream Method (Async)+Each `Send` targets the tools node with a single `[tool_call]` in a list. The tools node executes it concurrently with other Sends. This enables true parallel execution:-```python-async for chunk in sequence.astream(1):- print(chunk) # Non-blocking iteration-```+- Tool 1 and Tool 2 run concurrently if the model called both+- Results arrive and are added to state in any order+- The graph reconvenes after all Send tasks complete+- The model is invoked again to process all results together-### Streaming Pipeline+### Implementation Details-A **`RunnableSequence`** preserves streaming properties:-- If all steps implement `transform` (which processes `Iterator[Input] → Iterator[Output]`), streaming passes through the entire pipeline-- If any step doesn't support `transform`, streaming blocks until that step completes, then resumes-- **`RunnableLambda`** does not implement `transform` by default; use **`RunnableGenerator`** for custom streaming logic+The tools node receives each tool call via `Send` and:+1. Looks up the tool by name+2. Invokes `wrap_tool_call` middleware for interception+3. Executes the tool with arguments+4. Returns a `ToolMessage` with the result-### Example: Prompt → Model → Parser+Middleware can override tool execution via `wrap_tool_call`:```python-from langchain_core.prompts import ChatPromptTemplate-from langchain_openai import ChatOpenAI-from langchain_core.output_parsers import StrOutputParser+class ToolValidationMiddleware(AgentMiddleware):+ def wrap_tool_call(self, request, execute):+ # Validate arguments before execution+ if not self.is_valid(request.tool_call):+ return ToolMessage(+ content="Invalid arguments",+ tool_call_id=request.tool_call["id"],+ status="error",+ )+ return execute(request)+```-prompt = ChatPromptTemplate.from_template("What is {topic}?")-model = ChatOpenAI()-parser = StrOutputParser()+### Sequential Tool Handling-chain = prompt | model | parser+For tools that must run in a specific order, use middleware to redirect:-# Stream tokens as the model generates them-for chunk in chain.stream({"topic": "composability"}):- print(chunk, end="", flush=True)+```python+class SequentialToolMiddleware(AgentMiddleware):+ def after_model(self, state, runtime):+ # Inspect tool calls and reorder them+ last_message = state["messages"][-1]+ if isinstance(last_message, AIMessage):+ # Reorder tool calls as needed+ reordered = self.reorder_tool_calls(last_message.tool_calls)+ # Update the message to reflect new order+ last_message.tool_calls[:] = reordered+ return None```-In this chain:-1. `ChatPromptTemplate` formats the input dict into a string prompt-2. `ChatOpenAI` streams tokens as they arrive from the API-3. `StrOutputParser` passes tokens through unchanged+## Subagent Composition: Tool-Based Agent Delegation-Tokens flow end-to-end without waiting for the full response.+Subagents enable hierarchical task delegation. A parent agent invokes a tool that internally creates and runs a child agent, receiving the result back as a tool message.-## Conditional Routing: RunnableBranch and RouterRunnable+### SubagentTransformer: Detecting Subagent Boundaries-Conditional logic routes inputs to different branches based on predicates.+The `SubagentTransformer` automatically detects when a nested agent run boundary occurs and surfaces it via `run.subagents`. A nested run is considered a subagent when:-### RunnableBranch: Predicate-Based Routing--A **`RunnableBranch`** evaluates conditions in order and executes the first matching branch:+1. It is created via `create_agent(name=...)` with an explicit name+2. Its `lc_agent_name` differs from its parent's name+3. It was triggered by a tool call (joined via `cause` metadata)```python-from langchain_core.runnables import RunnableBranch, RunnableLambda+from langchain.agents import SubagentTransformer-branch = RunnableBranch(- (lambda x: isinstance(x, int), RunnableLambda(lambda x: x * 2)),- (lambda x: isinstance(x, str), RunnableLambda(lambda x: x.upper())),- RunnableLambda(lambda x: "unknown"),-)+# The transformer is automatically added by create_agent's default transformer list+transformer = SubagentTransformer(scope=())-branch.invoke(5) # 10-branch.invoke("hello") # "HELLO"-branch.invoke(None) # "unknown"+# When consuming a run stream with this transformer:+# run.subagents yields SubagentRunStream or AsyncSubagentRunStream handles```-Conditions are evaluated sequentially; the first truthy result selects its corresponding Runnable. If no condition matches, the default branch executes.+Each subagent handle provides:+- **`name`**: The subagent's configured name+- **`cause`**: Metadata about the triggering tool call (LifecycleCause dict with `type: "toolCall"` and `tool_call_id`)+- **`status`**: Final status ("success", "failed", or running)+- **`error`**: Optional error message if failed-### RouterRunnable: Key-Based Routing+### Creating Delegating Tools-A **`RouterRunnable`** routes based on a string key in the input:+A tool can create and invoke a subagent:```python-from langchain_core.runnables.router import RouterRunnable--add = RunnableLambda(lambda x: x + 1)-square = RunnableLambda(lambda x: x ** 2)--router = RouterRunnable(runnables={"add": add, "square": square})-router.invoke({"key": "square", "input": 3}) # 9-router.invoke({"key": "add", "input": 3}) # 4+from langchain.agents import create_agent++def weather_lookup_tool(location: str, *, runtime) -> str:+ """Look up weather by delegating to a weather specialist agent."""+ # Create a child agent with specialized tools+ weather_agent = create_agent(+ model="openai:gpt-4o",+ name="weather_specialist", # Important: sets lc_agent_name+ tools=[get_forecast, get_historical_data],+ system_prompt="You are a weather expert.",+ )++ # Invoke the subagent+ result = weather_agent.invoke({+ "messages": [{"role": "user", "content": f"Weather for {location}?"}]+ })++ # Extract the final response+ last_message = result["messages"][-1]+ return last_message.content if hasattr(last_message, 'content') else str(result)```-The input is a dict with `"key"` (which Runnable to route to) and `"input"` (the data).+The `runtime` parameter is injected by the middleware framework and provides access to:+- **`state`**: Current agent state (via CONFIG_KEY_READ at execution time)+- **`checkpointer`**: Checkpoint store for resuming interrupted runs+- **`store`**: LangGraph persistent memory store+- **`context`**: User-provided runtime context (type `ContextT`)-## Composition with RunnablePassthrough+### State Merging Across Subagents-**`RunnablePassthrough`** forwards inputs unchanged or with additional keys, useful for preserving context in parallel branches:+When a subagent completes, its state is not automatically merged with the parent. The delegating tool must extract relevant outputs:```python-from langchain_core.runnables import RunnablePassthrough--chain = (- RunnableLambda(lambda x: x + 1)- | {- "original": RunnablePassthrough(),- "modified": RunnableLambda(lambda x: x * 2),+def research_agent_tool(topic: str, *, runtime) -> str:+ """Delegate research to a specialized agent, return its findings."""+ research_agent = create_agent(+ model="openai:gpt-4o",+ name="researcher",+ tools=[search_web, read_article],+ )++ result = research_agent.invoke({+ "messages": [{"role": "user", "content": f"Research {topic}"}]+ })++ # Return structured findings for the parent agent to use+ findings = {+ "topic": topic,+ "summary": result["messages"][-1].content,+ "sources": extract_sources(result["messages"]),}-)--chain.invoke(5)-# {'original': 6, 'modified': 12}+ return json.dumps(findings)```-Here, the passthrough preserves the intermediate result for reuse by another branch.--## Async Equivalents--Every method has an async counterpart:+The parent agent receives this result as a `ToolMessage` and can use it for further reasoning.-| Sync | Async |-|------|-------|-| `invoke(input)` | `ainvoke(input)` |-| `batch(inputs)` | `abatch(inputs)` |-| `stream(input)` | `astream(input)` |-| `transform(Iterator[Input])` | `atransform(AsyncIterator[Input])` |+## Tool Selection Strategies-Async methods integrate with the callback system and execute concurrency-aware batching via `asyncio.gather`.+When an agent has many tools, filtering to only relevant ones improves efficiency and focus. LangChain provides multiple strategies:-## Variable Binding and Context Flow+### 1. LLM-Based Tool Selection-In composed chains, data flows through steps along with execution context. Each step receives the output of the previous step as its input.+The `LLMToolSelectorMiddleware` uses a small language model to select the most relevant tools before calling the main model:-### Context Propagation+```python+from langchain.agents.middleware import LLMToolSelectorMiddleware-When a chain invokes, **`RunnableSequence`** creates a callback hierarchy for tracing:-- Each step is marked as a child run using `run_manager.get_child(f"seq:step:{i + 1}")`-- Callbacks, tags, and metadata flow through the chain via `RunnableConfig`-- `patch_config` updates the config for each step while preserving parent context+selector = LLMToolSelectorMiddleware(+ model="openai:gpt-5.5-mini", # Fast, cheaper model for selection+ max_tools=5, # Limit to 5 most relevant tools+)-```python-from langchain_core.runnables import RunnableLambda--# Context flows through each step-step1 = RunnableLambda(lambda x: x + 1)-step2 = RunnableLambda(lambda x: x * 2)-chain = step1 | step2--# Invoke with tracing config-result = chain.invoke(- 5,- config={- "run_name": "my_chain",- "callbacks": [my_tracer],- "tags": ["prod"],- }+agent = create_agent(+ model="openai:gpt-4o",+ tools=[tool1, tool2, tool3, ...tool50], # Many tools+ middleware=[selector],)-# Each step runs with inherited config while reporting to callbacks```-### Dict Composition and Key Selection+How it works:+1. Before the main model call, the selector model receives the user's query and full tool list+2. The selector model returns a structured list of tool names ranked by relevance+3. Only the selected tools are passed to the main model+4. The main model works with a reduced set and focuses better-When using dict syntax in a sequence, each dict key becomes a separate branch context:+Configuration options:+- **`max_tools`**: Maximum number of tools to select (default: 10)+- **`model`**: Which model to use for selection (default: inferred from main model)+- **`on_parsing_failure`**: Fallback if the selector fails (`"error"`, `"none"`, `"all"`, or a list of tool names)-```python-chain = step1 | {- "result_a": step2,- "result_b": step3,-}--# Output combines results from both branches-output = chain.invoke(input) # {'result_a': ..., 'result_b': ...}-```+### 2. Provider-Native Tool Search-Each branch (`result_a`, `result_b`) appears as a separate child run in the callback trace.+The `ProviderToolSearchMiddleware` defers tool schema loading to the provider (Anthropic, OpenAI). The provider includes a special "tool search" tool that lets the model retrieve full tool schemas only when needed:-## Fallback Patterns--Fallbacks provide resilience by switching to alternative Runnables when one fails, without retrying the same component.--### RunnableWithFallbacks Mechanics+```python+from langchain.agents.middleware import ProviderToolSearchMiddleware++agent = create_agent(+ model="anthropic:claude-opus-4-8",+ tools=[tool1, tool2, ...tool100], # Many tools+ middleware=[+ ProviderToolSearchMiddleware(searchable_tools=[+ "lookup_order",+ "check_inventory",+ "get_shipping_info",+ ])+ ],+)+```-**`RunnableWithFallbacks`** wraps a primary Runnable and a list of fallbacks:+Benefits:+- Initial request payload is small (only tool names, not schemas)+- Model can use the `tool_search_tool` to search for relevant tools dynamically+- Provider retrieves matching tool schemas on-demand+- Scales well with hundreds of tools-1. Tries the primary Runnable first-2. On an exception matching `exceptions_to_handle`, attempts each fallback in order-3. Stops on the first successful execution-4. If all fail, raises the first exception encountered+Only Anthropic and OpenAI support provider-native tool search. The middleware validates this at runtime.-Key attributes:-- **`runnable`**: The primary Runnable to execute-- **`fallbacks`**: A sequence of fallback Runnables (ordered)-- **`exceptions_to_handle`**: Tuple of exception types to trigger fallback (default: all exceptions)-- **`exception_key`**: Optional string key to pass the caught exception to fallbacks in the input dict+### 3. Exact Tool Matching-### Fallback at Component Level+For deterministic tool selection, middleware can implement exact matching on known conditions:```python-from langchain_core.runnables import RunnableLambda--primary_llm = ChatOpenAI(model="gpt-4")-fallback_llm = ChatAnthropic(model="claude-3-sonnet")--resilient_llm = primary_llm.with_fallbacks(- [fallback_llm],- exceptions_to_handle=(APIConnectionError,),-)--output = resilient_llm.invoke("What is composability?")-# Uses primary_llm; falls back to fallback_llm if APIConnectionError occurs+class ContextualToolMiddleware(AgentMiddleware):+ """Route to different tools based on context."""++ def wrap_model_call(self, request, handler):+ # Check if this is a file operation+ if any("file" in msg.content.lower() for msg in request.messages):+ # Keep only file tools+ file_tools = [t for t in request.tools if "file" in t.name.lower()]+ request = request.override(tools=file_tools)++ return handler(request)```-### Multiple Fallbacks with Provider Failover+This approach is fast, deterministic, and suitable for small tool sets.-Fallbacks are tried in order until one succeeds:+## Context Passing: Parent to Subagent-```python-model = ChatOpenAI().with_fallbacks([- ChatAnthropic(), # Try second- ChatClaude(), # Try third- ChatCohere(), # Try fourth- RunnableLambda(default_response), # Final fallback-])-```--The chain tries each fallback sequentially until one returns successfully or all are exhausted.+When invoking subagents, the parent can pass context that shapes the subagent's behavior:-### Fallback at Chain Level+### Context Via System Prompt```python-# Construct a chain with fallback-chain_with_fallback = (- prompt- | resilient_llm- | parser-).with_fallbacks([- RunnableLambda(lambda x: "Service unavailable")-])--output = chain_with_fallback.invoke({"topic": "composability"})-# If the entire chain fails, returns fallback response+def delegating_tool(query: str, *, runtime) -> str:+ # Parent context: user's stated preferences+ user_preferences = runtime.state.get("user_preferences", {})++ subagent = create_agent(+ model="openai:gpt-4o",+ name="child_agent",+ tools=[...],+ system_prompt=(+ f"You are helping a user with preferences: {user_preferences}. "+ f"Original request: {query}"+ ),+ )++ result = subagent.invoke({"messages": [{"role": "user", "content": query}]})+ return result["messages"][-1].content```-### Exception Passing to Fallbacks+### Context Via State-Use `exception_key` to pass the caught exception to fallbacks as part of the input:+For more structured context, pass data in the initial messages:```python-def fallback_with_context(input_dict):- error = input_dict.get("error")- if isinstance(error, APIConnectionError):- return "API is currently unavailable. Please try again later."- return "An unexpected error occurred."--chain = (- prompt | llm | parser-).with_fallbacks(- [RunnableLambda(fallback_with_context)],- exception_key="error", # Pass exception under "error" key-)--# Input becomes {"topic": "...", "error": <caught exception>}+def delegating_tool(task: str, *, runtime) -> str:+ # Extract context from parent state+ conversation_history = runtime.state.get("messages", [])++ subagent = create_agent(+ model="openai:gpt-4o",+ name="specialized_agent",+ tools=[...],+ )++ # Seed the subagent with parent's conversation context+ result = subagent.invoke({+ "messages": [+ *conversation_history[-3:], # Last 3 parent messages for context+ {"role": "user", "content": task},+ ]+ })++ return extract_result(result)```-This requires all Runnables (primary and fallbacks) to accept a dictionary as input.--## Retry Patterns--Retry logic automatically re-invokes a Runnable on failure, with configurable backoff and exception filtering.+### Context Via Runtime Store-### Retry at Component Level+For stateful coordination across many subagents, use the LangGraph store:```python-from langchain_core.runnables import RunnableLambda-from langchain_core.runnables.retry import ExponentialJitterParams--llm = ChatOpenAI(model="gpt-4")--resilient_llm = llm.with_retry(- retry_if_exception_type=(APIConnectionError, TimeoutError),- max_attempt_number=3,- wait_exponential_jitter=True,- exponential_jitter_params={"initial": 1, "max": 10},-)--output = resilient_llm.invoke("What is composability?")-# Retries up to 3 times on transient errors with exponential backoff+def delegating_tool(operation: str, *, runtime) -> str:+ # Read shared state from the store+ session_id = runtime.context.get("session_id")+ user_data = runtime.store.get(f"session:{session_id}", ["user_profile"])[0]++ subagent = create_agent(+ model="openai:gpt-4o",+ name="worker_agent",+ tools=[...],+ )++ # Subagent can also write to the store+ result = subagent.invoke({+ "messages": [{"role": "user", "content": operation}]+ })++ # Store the result for other subagents or parent to read+ runtime.store.put(f"session:{session_id}", [f"result:{operation}"], json.dumps(result))++ return "Operation completed"```-### RunnableRetry Implementation--**`RunnableRetry`** wraps any Runnable and applies retry logic using `tenacity`:+## State Schema Composition-- **`retry_exception_types`**: Tuple of exception types to retry on (default: all exceptions)-- **`max_attempt_number`**: Maximum retry attempts (default: 3)-- **`wait_exponential_jitter`**: Enable exponential backoff with jitter (default: True)-- **`exponential_jitter_params`**: Customize backoff parameters (`initial`, `max`, `exp_base`, `jitter`)+When middleware adds custom state fields or subagents return structured state, those schemas must be merged into the agent's overall state.-Retries are tracked in callbacks with tags like `retry:attempt:2` for visibility in traces.+### Declaring Custom State in Middleware-### Retry Strategy: Transient vs. Fatal Errors--Best practice: retry only on transient errors, not fatal ones:+Middleware can extend `AgentState` with additional fields:```python-model = ChatOpenAI().with_retry(- retry_if_exception_type=(- APIConnectionError, # Transient: network issues- TimeoutError, # Transient: slow API- RateLimitError, # Transient: quota exceeded- ),- max_attempt_number=5,- exponential_jitter_params={"initial": 0.5, "max": 30},+from typing_extensions import TypedDict+from langchain.agents.middleware import (+ AgentMiddleware,+ AgentState,+ OmitFromInput,)-# Do NOT retry on invalid input or authentication errors—these are fatal-```--### Retry at Chain Level+class CustomState(AgentState):+ """Extended state with middleware-specific fields."""++ analysis: dict # Added by analysis middleware, omitted from input+ retry_count: int # Counts retries, omitted from both input and output-```python-chain = (- prompt- | llm.with_retry(max_attempt_number=3) # Retry at LLM level- | parser-)-# Better than retrying the whole chain, which wastes time on non-failing steps+class AnalysisMiddleware(AgentMiddleware):+ state_schema = CustomState++ def after_model(self, state: CustomState, runtime):+ # Populate analysis field+ return {+ "analysis": {+ "tool_count": len(state.get("messages", [])),+ "complexity": self.rate_complexity(state),+ }+ }```-## Chaining Patterns--### Common Pattern: Prompt → Model → Parser--```python-from langchain_core.prompts import ChatPromptTemplate-from langchain_openai import ChatOpenAI-from langchain_core.output_parsers import StrOutputParser--chain = (- ChatPromptTemplate.from_template("What is {topic}?")- | ChatOpenAI()- | StrOutputParser()-)--# Single invoke-output = chain.invoke({"topic": "LLMs"})+When `create_agent` is called with this middleware, it automatically merges `CustomState` into the final state schema.-# Batch process-outputs = chain.batch([{"topic": "LLMs"}, {"topic": "Vectors"}])+### Schema Merging Rules-# Stream tokens-for chunk in chain.stream({"topic": "LLMs"}):- print(chunk, end="", flush=True)-```+When multiple middleware declare state extensions:+1. Schemas are merged left-to-right (first middleware's fields override later ones for conflicts)+2. Fields marked with `OmitFromSchema`, `OmitFromInput`, `OmitFromOutput` are excluded from the respective schemas+3. Reducer annotations (e.g., `add_messages`) are preserved+4. The final schema is published as the agent's `input_schema` and `output_schema`-### Fan-Out / Fan-In: Parallel Processing+## Failure Handling in Subagent Scenarios-```python-from langchain_core.runnables import RunnableLambda, RunnablePassthrough--chain = (- RunnablePassthrough()- | {- "summary": RunnableLambda(summarize),- "entities": RunnableLambda(extract_entities),- "sentiment": RunnableLambda(analyze_sentiment),- }-)+Subagent failures need careful handling to avoid cascading errors.-result = chain.invoke(text)-# {'summary': '...', 'entities': [...], 'sentiment': 'positive'}-```+### Tool-Level Failure Handling-### Conditional Execution+The delegating tool can catch and report subagent failures:```python-from langchain_core.runnables import RunnableBranch--route_logic = RunnableBranch(- (lambda x: "math" in x.lower(), math_chain),- (lambda x: "code" in x.lower(), code_chain),- general_chain,-)--output = route_logic.invoke("How do I calculate factorial?")+def resilient_delegation_tool(query: str, *, runtime) -> str:+ """Delegate work with graceful fallback."""+ try:+ subagent = create_agent(+ model="openai:gpt-4o",+ name="worker",+ tools=[...],+ )+ result = subagent.invoke({"messages": [{"role": "user", "content": query}]})+ return result["messages"][-1].content+ except Exception as e:+ # Return a fallback message instead of raising+ logger.error(f"Subagent failed: {e}")+ return f"I couldn't complete that task. Please try again or rephrase your request."```-## Type Safety and Schema Inference+### Middleware-Level Failure Handling-Chains infer input and output types from their components:+Use `wrap_tool_call` to intercept and handle failures:```python-sequence = add_one | mul_two--# Access inferred schemas-print(sequence.input_schema) # Pydantic model for input-print(sequence.output_schema) # Pydantic model for output-print(sequence.input_schema.model_json_schema())+class ToolErrorRecoveryMiddleware(AgentMiddleware):+ def wrap_tool_call(self, request, execute):+ try:+ return execute(request)+ except ValueError as e:+ # Return an error message instead of propagating+ return ToolMessage(+ content=f"Tool execution failed: {str(e)}. Please try with different parameters.",+ tool_call_id=request.tool_call["id"],+ name=request.tool_call["name"],+ status="error",+ )```-This enables validation and documentation without explicit type annotations.--## Optimization and Flattening+### Timeout and Resource Limits-**`RunnableSequence`** automatically flattens nested sequences:+For long-running subagents, use timeouts:```python-# These are equivalent:-chain1 = step1 | step2 | step3-chain2 = step1 | (step2 | step3)-chain3 = (step1 | step2) | step3+import signal+import contextlib++def delegating_tool_with_timeout(query: str, *, runtime, timeout_seconds=30) -> str:+ """Delegate with timeout."""+ subagent = create_agent(+ model="openai:gpt-4o",+ name="worker",+ tools=[...],+ )++ def timeout_handler(signum, frame):+ raise TimeoutError("Subagent exceeded time limit")++ old_handler = signal.signal(signal.SIGALRM, timeout_handler)+ signal.alarm(timeout_seconds)++ try:+ result = subagent.invoke({"messages": [{"role": "user", "content": query}]})+ return result["messages"][-1].content+ except TimeoutError:+ return "The operation took too long. Try a simpler request."+ finally:+ signal.alarm(0)+ signal.signal(signal.SIGALRM, old_handler)```-All produce a single flat sequence with steps `[step1, step2, step3]`, avoiding unnecessary nesting overhead.+## End-to-End Example: Multi-Tier Agent Hierarchy-## Serialization and Debugging--Composed chains support serialization via the LangChain serialization system, enabling:-- **Persistence**: Save and load chains-- **Tracing**: Automatic callback integration for debugging via LangSmith-- **Inspection**: Use `get_graph()` to visualize chain structure--Enable debug output:+Here's a complete example showing a 3-tier agent system:```python-from langchain_core.globals import set_debug+from langchain.agents import create_agent+from langchain.agents.middleware import LLMToolSelectorMiddleware+from langchain_openai import ChatOpenAI+from langchain_core.tools import tool-set_debug(True) # Print intermediate results-chain.invoke(input)+# Tier 3: Specialist agents for specific domains-# Or use callbacks:-from langchain_core.tracers import ConsoleCallbackHandler+@tool+def get_weather(location: str) -> str:+ """Get current weather."""+ return f"Weather in {location}: Sunny, 72°F"-chain.invoke(input, config={"callbacks": [ConsoleCallbackHandler()]})-```+weather_agent = create_agent(+ model="openai:gpt-4o-mini",+ name="weather_specialist",+ tools=[get_weather],+ system_prompt="You are a weather expert.",+)-## Extension: Custom Runnables+@tool+def search_flights(destination: str) -> str:+ """Search available flights."""+ return f"Flights to {destination}: AA100, UA201, DL303"-Implement **`Runnable`** to create custom components:+travel_agent = create_agent(+ model="openai:gpt-4o-mini",+ name="travel_specialist",+ tools=[search_flights],+ system_prompt="You are a travel booking specialist.",+)-```python-from langchain_core.runnables import Runnable, RunnableConfig-from typing import Iterator+# Tier 2: Coordinator delegates to specialists++def weather_tool(location: str, *, runtime) -> str:+ """Get weather by delegating to weather specialist."""+ result = weather_agent.invoke({+ "messages": [{"role": "user", "content": f"Weather for {location}"}]+ })+ return result["messages"][-1].content++def travel_tool(destination: str, *, runtime) -> str:+ """Find flights by delegating to travel specialist."""+ result = travel_agent.invoke({+ "messages": [{"role": "user", "content": f"Find flights to {destination}"}]+ })+ return result["messages"][-1].content++coordinator_agent = create_agent(+ model="openai:gpt-4o",+ name="trip_coordinator",+ tools=[weather_tool, travel_tool],+ system_prompt="You help users plan trips by checking weather and finding flights.",+ middleware=[LLMToolSelectorMiddleware(max_tools=2)],+)-class CustomRunnable(Runnable[str, int]):- def invoke(self, input: str, config: RunnableConfig | None = None) -> int:- return len(input)-- async def ainvoke(self, input: str, config: RunnableConfig | None = None) -> int:- return len(input)-- def stream(self, input: str, config: RunnableConfig | None = None) -> Iterator[int]:- # For streaming support, implement transform- for char in input:- yield 1-- async def astream(self, input: str, config: RunnableConfig | None = None):- for char in input:- yield 1+# Tier 1: Main entry point-# Immediately composable-chain = CustomRunnable() | another_step-```+def orchestrator_tool(planning_request: str, *, runtime) -> str:+ """Plan a trip by delegating to coordinator."""+ result = coordinator_agent.invoke({+ "messages": [{"role": "user", "content": planning_request}]+ })+ return result["messages"][-1].content-Custom Runnables are automatically compatible with all composition operators.+main_agent = create_agent(+ model="openai:gpt-4o",+ name="travel_assistant",+ tools=[orchestrator_tool],+ system_prompt="You are a helpful travel assistant.",+)-## Summary Table+# Use the system+output = main_agent.invoke({+ "messages": [{+ "role": "user",+ "content": "Plan a trip to Paris next week"+ }]+})-| Operator | Effect | Example |-|----------|--------|---------|-| `\|` | Sequential chaining | `step1 \| step2` |-| Dict in sequence | Parallel branching | `step1 \| {key1: step2, key2: step3}` |-| `RunnableBranch` | Conditional routing | `RunnableBranch((cond, runnable), default)` |-| `RouterRunnable` | Key-based routing | `RouterRunnable({"key": runnable})` |-| `.batch()` / `.abatch()` | Parallel input processing | `chain.batch([in1, in2])` |-| `.stream()` / `.astream()` | Token-by-token output | `for chunk in chain.stream(input):` |+print(output["messages"][-1].content)+```-See the [Runnables](runnables.md) page for protocol details and method signatures.+**Execution flow:**+1. `main_agent` receives the trip planning request+2. It invokes `orchestrator_tool`, which delegates to `coordinator_agent`+3. `coordinator_agent` with `LLMToolSelectorMiddleware` filters to relevant tools+4. Based on the query, it calls `weather_tool` and `travel_tool` (possibly in parallel via Send)+5. `weather_tool` invokes `weather_agent` (tier 3)+6. `travel_tool` invokes `travel_agent` (tier 3)+7. Results flow back up through the hierarchy+8. `main_agent` receives the final coordinated response++This hierarchy demonstrates:+- **Middleware composition** (selector filters tools at tier 2)+- **Subagent delegation** (tools create and invoke nested agents)+- **Parallel execution** (weather and travel agents run concurrently if both are needed)+- **State isolation** (each agent has its own state; results are manually extracted)+- **Observability** (each tier is traced independently via `SubagentTransformer`)++## Summary++Agent composability provides powerful patterns for building sophisticated multi-agent systems:++| Pattern | Use Case | Example |+|---------|----------|---------|+| **Middleware layers** | Cross-cutting concerns (retry, logging, validation) | Add `RetryMiddleware` to auto-retry failed model calls |+| **Subagent delegation** | Specialize work to child agents with focused tools | Weather expert agent invoked by travel coordinator |+| **Tool selection** | Filter tools in large sets for efficiency | `LLMToolSelectorMiddleware` for 100+ tools |+| **Parallel tool execution** | Run independent tools concurrently | Model calls 3 tools → 3 Sends dispatched in parallel |+| **Context passing** | Share parent state with subagents | System prompt includes user preferences from parent |+| **State composition** | Extend state with middleware-specific fields | Custom state schema with analysis results |++By combining these patterns, you can build agents that coordinate across multiple specialized domains, recover gracefully from failures, optimize token usage, and remain fully observable.diff --git a/openwiki/dev-commands.md b/openwiki/dev-commands.mdindex 25580e6e19..4179b8197e 100644--- a/openwiki/dev-commands.md+++ b/openwiki/dev-commands.md@@ -2,7 +2,10 @@type: "Developer Tools & Commands"title: "Development Commands and Local Setup"description: "Quick reference for uv, make, lint, test, and type-checking commands in the LangChain monorepo, including environment setup, pre-commit hooks, and testing workflows."-tags: [development, build, testing, linting, typing, uv, make, pre-commit, local-setup]+tags: [development, build, testing, linting, typing, uv, make, pre-commit, local-setup, conventional-commits]+verified:+ - by: openwiki/0.5.0+ at: 2026-10-20T08:25:57.412Zsources:- id: openwiki-source-4d1645cb6317345817452838resource: repo://.pre-commit-config.yaml@@ -20,10 +23,7 @@ sources:resource: repo://libs/Makefile- id: openwiki-source-a6e669bb11f217c6fbd06670resource: repo://libs/partners/anthropic/Makefile-generated: { by: "openwiki/0.5.0", at: "2026-09-03T15:18:34.589Z" }-verified:- - by: openwiki/0.5.0- at: 2026-09-28T08:35:20.640Z+generated: { by: "openwiki/0.5.0", at: "2026-10-20T08:25:57.412Z" }---## Overview@@ -47,6 +47,31 @@ uv sync --group lintThe `--all-groups` flag ensures you have tools for linting, type checking, and testing. See the [Contributing Guide in AGENTS.md](repo://AGENTS.md) for detailed development conventions and PR guidelines.+### uv Basics++`uv` is a fast Python package installer and dependency resolver that replaces `pip`, `poetry`, and `conda`. Key points:++- **No manual activation needed**: `uv sync` and `uv run` manage virtual environments automatically — do not source `.venv/bin/activate`.+- **Per-package environments**: Each package in `libs/` maintains its own environment via `uv.lock`. Do not create ad-hoc virtual environments outside package directories.+- **Dependency groups**: Install specific groups for faster setup: `--group test` (testing), `--group lint` (linting), `--group typing` (type checking), or all with `--all-groups`.+- **No implicit installation**: Use explicit `uv sync` calls with group selectors; never let dependencies install implicitly.++Common uv commands:++```bash+# Install/sync dependencies (respects groups and lock file)+uv sync --all-groups++# Run a command in the package environment+uv run --group test pytest tests/unit_tests/++# Update lock file (see Lock File Management below)+uv lock++# Run a command with an additional dependency (temporary)+uv run --with 'package>=1.0' --group test pytest tests/integration_tests/+```+### Pre-Commit SetupThe repository uses pre-commit hooks to enforce code quality on commit. Install and configure them once:@@ -65,6 +90,22 @@ pre-commit run --all-filespre-commit run ruff --all-files```+#### Bypassing Pre-Commit Hooks++To skip pre-commit hooks temporarily (use with caution):++```bash+# Skip all hooks for this commit+git commit --no-verify+```++**SKIP environment variables**: Some hooks accept `SKIP` to bypass specific checks:++```bash+# Skip specific hooks (check hook IDs in .pre-commit-config.yaml)+SKIP=core,langchain pre-commit run --all-files+```+## Pre-Commit HooksThe `.pre-commit-config.yaml` defines hooks that enforce:@@ -72,7 +113,8 @@ The `.pre-commit-config.yaml` defines hooks that enforce:- **Standard validation**: YAML/TOML syntax checking, proper file endings, no trailing whitespace- **Text normalization**: Fix curly quotes and non-standard spaces- **Per-package format and lint**: Each package in `libs/` (core, langchain, partners/*) runs `make format lint`-- **Version consistency checks**: Ensure `pyproject.toml` versions match source code for `langchain-core`, `langchain`, and partner packages+- **Version consistency checks**: Ensure `pyproject.toml` versions match source code for `langchain-core`, `langchain-v1`, and partner packages+- **Branch protection**: Prevents direct commits to the `master` branchThese hooks automatically prevent commits that fail linting or have formatting issues. They use the same Makefiles documented below.@@ -88,7 +130,7 @@ make testcd libs/langchain_v1 && make test```-Unit tests live in `tests/unit_tests/` (no network calls allowed). The test target uses `pytest` with `xdist` for parallelization and socket restrictions to prevent accidental network calls.+Unit tests live in `tests/unit_tests/` (no network calls allowed). The test target uses `pytest` with `xdist` for parallelization and socket restrictions to prevent accidental network calls. Tests are parallelized via the `-n auto` flag.### Run a Specific Test File@@ -100,6 +142,11 @@ make test TEST_FILE=tests/unit_tests/agents/test_agent.pyuv run --group test pytest tests/unit_tests/agents/test_agent.py```+The `TEST_FILE` parameter accepts:+- A single file: `tests/unit_tests/agents/test_agent.py`+- A directory: `tests/unit_tests/agents/`+- A test by name: `tests/unit_tests/agents/test_agent.py::TestClass::test_method`+### Integration TestsIntegration tests live in `tests/integration_tests/` and require network access and API keys. Run them separately:@@ -115,6 +162,15 @@ cd libs/langchain_v1make test # starts services, runs tests, stops services```+To run integration tests with specific SDK versions (useful for compatibility testing):++```bash+# Test with multiple versions of an SDK+cd libs/partners/anthropic+uv run --with 'anthropic>=0.120.0,<1.0.0' --group test --group test_integration pytest tests/integration_tests/+uv run --with 'anthropic>=1.0.0,<2.0.0' --group test --group test_integration pytest tests/integration_tests/+```+### Test in Watch ModeAuto-re-run tests as you edit code:@@ -123,7 +179,15 @@ Auto-re-run tests as you edit code:make test_watch```-This uses `pytest-watcher` (via the `ptw` command) and updates snapshots automatically.+This uses `pytest-watcher` (via the `ptw` command) and updates snapshots automatically. Useful for test-driven development.++### Extended Tests++Some packages include tests marked with `@pytest.mark.extended` that run slower or under different conditions:++```bash+make extended_tests+```### Coverage Reports@@ -135,6 +199,13 @@ make coverageThis produces `xml` and term-missing reports, useful for understanding untested code paths.+For targeted coverage (e.g., agent middleware):++```bash+cd libs/langchain_v1+make coverage_agents # generates HTML and term-missing coverage for agents+```+## Linting and Formatting### Run Full Linting Suite@@ -172,6 +243,17 @@ ruff format .Run from within a package directory or from the repo root. Ruff processes Python and Jupyter notebooks.+### Lint Changes Only++For faster iteration during development, lint only files changed in your branch:++```bash+make lint_diff+make format_diff+```++These targets run on `git diff` output against `master` branch.+### Type CheckingFull type checking with mypy:@@ -191,6 +273,10 @@ This checks all Python files for type errors (e.g., incorrect argument types, mi```bash# Type check specific file or directorymypy libs/core/langchain_core/runnables.py++# Type check only tests (faster)+cd libs/langchain_v1+make lint_tests```## Testing a Single Package@@ -235,7 +321,7 @@ cd libs && make lockcd libs && make check-lock```-The `.pre-commit-config.yaml` includes `UV_FROZEN = true`, which prevents unexpected lock file changes during regular development. Use the commands above when intentionally updating dependencies.+The Makefiles set `UV_FROZEN = true`, which prevents unexpected lock file changes during regular development. Use the commands above when intentionally updating dependencies.## Make Commands Reference@@ -249,7 +335,9 @@ All packages follow the same Makefile structure:| `make integration_tests` | Run integration tests (requires API keys) || `make extended_tests` | Run only tests marked with `@pytest.mark.extended` || `make lint` | Run ruff check + ruff format --diff + mypy |+| `make lint_diff` | Lint only changed files (git diff against master) || `make format` | Apply ruff format and ruff check --fix |+| `make format_diff` | Format only changed files (git diff against master) || `make type` | Run mypy type checking || `make coverage` | Run tests and generate coverage report || `make help` | Display all available targets |@@ -258,7 +346,31 @@ Package-specific commands (see Makefiles in each directory):- `langchain_v1`: `make test_fast`, `make coverage_agents`, `make start_services`, `make stop_services`- `core`: `make check_imports`, `make benchmark`-- `partners/*`: `make test TEST_FILE=tests/integration_tests/`+- `partners/*`: `make test TEST_FILE=tests/integration_tests/`, `make benchmark`++## Environment Variables++The Makefiles use a few environment variables to control behavior:++| Variable | Purpose | Default |+|----------|---------|---------|+| `UV_FROZEN` | Prevent lock file changes during `uv sync` | `true` in Makefiles |+| `TEST_FILE` | Path to test file or directory | `tests/unit_tests/` |+| `PYTEST_EXTRA` | Extra pytest options (e.g., `-vv`, `-x`) | (empty) |+| `LANGGRAPH_TEST_FAST` | Use in-memory services instead of Docker | `1` (fast) or `0` (full) |++Example: Run fast tests with extra pytest verbosity:++```bash+make test PYTEST_EXTRA="-vv" TEST_FILE=tests/unit_tests/agents+```++Example: Run full integration tests with Docker services:++```bash+cd libs/langchain_v1+LANGGRAPH_TEST_FAST=0 make test+```## Common Workflows@@ -300,42 +412,70 @@ make test_watchmake format```-### Linting a Changed File+### Fixing Lint Errors++When `make lint` fails:```bash-# Lint only files changed in the current branch-make lint_diff-make format_diff+# 1. Auto-fix formatting and simple lint issues+make format++# 2. Check what remains+make lint++# 3. Fix remaining issues manually (mypy errors, etc.) and re-check+make lint```-These targets run on `git diff` output against `master`.+For faster iteration on specific files:++```bash+# Lint and format specific file+ruff check --fix langchain/agents/agent.py+ruff format langchain/agents/agent.py+mypy langchain/agents/agent.py+```-### Type Checking Specific Modules+### Running Specific Tests```bash-# Type check a module while developing-mypy libs/langchain_v1/langchain/agents/agent.py+# All tests in a file+make test TEST_FILE=tests/unit_tests/agents/test_agent.py-# Type check tests (faster, uses test group)-cd libs/langchain_v1-make lint_tests-```+# Single test class+uv run --group test pytest tests/unit_tests/agents/test_agent.py::TestAgentClass -v-## Environment Variables+# Single test method+uv run --group test pytest tests/unit_tests/agents/test_agent.py::TestAgentClass::test_method_name -v-The Makefiles use a few environment variables to control behavior:+# All tests matching a pattern+uv run --group test pytest -k "test_agent" tests/unit_tests/-| Variable | Purpose | Default |-|----------|---------|---------|-| `UV_FROZEN` | Prevent lock file changes during `uv sync` | `true` in Makefiles |-| `TEST_FILE` | Path to test file or directory | `tests/unit_tests/` |-| `PYTEST_EXTRA` | Extra pytest options | (empty) |-| `LANGGRAPH_TEST_FAST` | Use in-memory services instead of Docker | `1` (fast) or `0` (full) |+# With extra verbosity and stopping on first failure+make test TEST_FILE=tests/unit_tests/agents PYTEST_EXTRA="-vv -x"+```-Example: Run fast tests with extra pytest verbosity:+## Conventional Commits and PR Titles-```bash-make test PYTEST_EXTRA="-vv" TEST_FILE=tests/unit_tests/agents+Follow [Conventional Commits](https://www.conventionalcommits.org/) format with required scope:++```txt+<type>(<scope>): <description>+```++**Format rules:**+- `<type>`: One of `feat`, `fix`, `chore`, `docs`, `refactor`, `perf`, `test`+- `<scope>`: Required—one of `core`, `langchain`, partner name (e.g., `anthropic`, `openai`), `infra`, or `docs`+- `<description>`: Lowercase start (unless first word is proper noun like `Azure`, `GitHub`, or a code name)+- Named entities (class, function, parameter names) should be wrapped in backticks++**Examples:**+```txt+feat(langchain): add new chat completion feature+fix(core): resolve type hinting issue in vector store+chore(anthropic): update infrastructure dependencies+feat(langchain): `ls_agent_type` tag on `create_agent` calls+fix(openai): infer Azure chat profiles from model name```## Troubleshooting@@ -369,6 +509,12 @@ This is intentional—unit tests have socket restrictions. For integration testsmake integration_tests```+To bypass socket restrictions temporarily (for debugging):++```bash+uv run --group test pytest --disable-socket=false tests/unit_tests/+```+### Ruff or mypy not found```bash@@ -386,8 +532,42 @@ uv sync --all-groupspre-commit run --all-files```+### Cache clearing issues++If you encounter stale cache issues:++```bash+# Clear mypy cache+rm -rf .mypy_cache++# Clear pytest cache+rm -rf .pytest_cache++# Clear ruff cache+rm -rf .ruff_cache++# Full clean: reinstall environment+rm uv.lock+uv sync --all-groups+```++### Dependency conflicts++When dependency resolution fails:++```bash+# Remove lock and resolve from scratch+cd libs/<package>+rm uv.lock+uv lock++# Or check for conflicts+uv sync --all-groups+```+## Related Documentation- [Contributing Guide](repo://AGENTS.md): Detailed development conventions, PR templates, and code standards- [System Architecture](repo:///openwiki/architecture.md): Three-layer design and module responsibilities- [CI/CD Workflows](repo:///openwiki/ci-workflows.md): GitHub Actions automation and release process+- [Unit Tests](repo:///openwiki/unit-tests.md): Unit test structure, fixtures, and best practicesdiff --git a/openwiki/index.md b/openwiki/index.mdindex 2354a7e3a9..08cdbb10ee 100644--- a/openwiki/index.md+++ b/openwiki/index.md@@ -10,18 +10,18 @@ okf_version: "0.2"- [Callback System and Handler Integration](callbacks.md) - Document the callback handler architecture, integration with runnables and chat models, and patterns for tracking execution events, streaming, and instrumentation.- [Chat Model Interface and Lifecycle](chat-models.md) - Document BaseChatModel protocol, input/output handling, streaming, and integration points with callbacks and model profiling. Covers the init_chat_model() factory, provider registry, and model instantiation.- [CI/CD Workflows: GitHub Actions and Release Process](ci-workflows.md) - LangChain's GitHub Actions-based CI/CD system automating testing, linting, and release management across a monorepo with intelligent change detection, parallel matrix testing, and strict release gates.-- [Composability and LCEL Chains](composability.md) - How Runnable components compose through LCEL operators, creating reusable workflows with automatic async, batch, and streaming support.+- [Agent Composability: Building Complex Agents](composability.md) - Patterns for composing agents through middleware layers, subagent delegation, tool selection strategies, and context management across hierarchical agent workflows.- [Development Commands and Local Setup](dev-commands.md) - Quick reference for uv, make, lint, test, and type-checking commands in the LangChain monorepo, including environment setup, pre-commit hooks, and testing workflows.-- [Integration Testing: Live API Tests and VCR Cassettes](integration-tests.md) - How to write integration tests that call real model APIs with VCR cassette recording for CI compatibility, including environment setup, cassette management, and parameterization patterns.+- [Integration Testing: Standard Test Suites & Providers](integration-tests.md) - How LangChain integration tests work: VCR cassettes for API recording/playback, standard test suite inheritance for providers, CI/CD integration, and test markers for live vs. recorded testing.- [MCP (Model Context Protocol) Integration](mcp-integration.md) - MCPAdapter bridges MCP servers to LangChain agents, discovering tools, handling protocol negotiation via FastMCP, managing multiple transports, and supporting mid-call user input via LangGraph interrupts.- [Message Types and Content Representation](messages.md) - Document the message abstraction, standardized content blocks for multimodal LLM I/O, message hierarchy, and provider-specific block translators.-- [Agent Middleware: Composable Request/Response Processing](middleware.md) - Comprehensive guide to the middleware composition system: hook types, typing, payload transformations, and practical examples for hooking into model calls, tool calls, and agent lifecycle.+- [Agent Middleware: Composable Request/Response Processing](middleware.md) - Comprehensive guide to the middleware composition system: lifecycle hooks, handler interception, state transformation, payload types, error handling, and implementation patterns for common middleware.- [Chat Model Initialization with init_chat_model](model-initialization.md) - Factory function for instantiating chat models from provider strings with unified configuration and runtime model switching.- [OpenAI Integration: ChatOpenAI and Azure Support](openai-provider.md) - ChatOpenAI integration for OpenAI's Chat Completions and Responses APIs, with support for tool calling, structured output, vision, streaming, and Azure deployment.- [Adding a New Chat Model Provider](partner-pattern.md) - Step-by-step guide to integrate a new LLM provider into LangChain's monorepo, including package structure, ChatModel implementation, streaming, function calling, structured output, and standard tests. Covers message conversion, error handling, model profiles, and optional advanced API modes like Responses API.-- [Prompt Templates and Few-Shot Learning](prompts.md) - Prompt templates define message sequences and variable substitution patterns for chat models. Few-shot learning selects examples dynamically to teach models by example.+- [Prompts: Templates & Composition](prompts.md) - Prompt templates define message sequences and variable substitution patterns for language models. Covers template syntax, PromptValue routing, runnable integration, and few-shot learning with dynamic example selection.- [LangChain Repository Quick Start](quickstart.md) - Entry point for engineers: orient to the monorepo structure, run first tests, understand what to edit for common tasks, and route to major development areas.-- [Runnable: Core Composition Layer](runnables.md) - Explain the Runnable protocol and how it enables composable chaining of LLM components through the LangChain Expression Language (LCEL).+- [Runnables: The Composition Protocol](runnables.md) - The Runnable protocol provides a unified, composable interface for every LangChain component. Runnable enables declarative composition through the pipe operator, orchestrates streaming, batch, and async execution, and carries configuration and callbacks through entire chains.- [Source Map: Repository File Organization](source-map.md) - Quick reference for locating code by topic, mapping LangChain concepts to their implementation paths across the monorepo including core abstractions, agents, middleware, partners, and configuration files.- [Streaming: Token-by-Token Output](streaming.md) - How streaming works across LLM components and chains, token-by-token delivery via AIMessageChunk, callback integration, and memory/latency tradeoffs.- [Structured Output and Response Formatting](structured-output.md) - Document the structured output system: response format specification, strategy selection (auto, provider, tool-based), parsing, validation, and middleware integration.diff --git a/openwiki/integration-tests.md b/openwiki/integration-tests.mdindex 08f071d04d..fbd40868eb 100644--- a/openwiki/integration-tests.md+++ b/openwiki/integration-tests.md@@ -1,12 +1,20 @@---type: "Testing & QA"-title: "Integration Testing: Live API Tests and VCR Cassettes"-description: "How to write integration tests that call real model APIs with VCR cassette recording for CI compatibility, including environment setup, cassette management, and parameterization patterns."-tags: [integration-tests, vcr, cassettes, api-testing, pytest, ci-cd, model-testing]+title: "Integration Testing: Standard Test Suites & Providers"+description: "How LangChain integration tests work: VCR cassettes for API recording/playback, standard test suite inheritance for providers, CI/CD integration, and test markers for live vs. recorded testing."+tags: [integration-tests, vcr, cassettes, api-testing, pytest, ci-cd, model-testing, standard-tests, test-markers]verified:- by: openwiki/0.5.0- at: 2026-09-28T08:35:20.640Z+ at: 2026-10-20T08:25:57.412Zsources:+ - id: openwiki-source-a12f520c2572fe032a111e3b+ resource: repo://.github/workflows/_compile_integration_test.yml+ - id: openwiki-source-d8a8900818f4abab719bd1b7+ resource: repo://.github/workflows/_test_vcr.yml+ - id: openwiki-source-6e3a52c89729b5704dbd7eec+ resource: repo://.github/workflows/check_diffs.yml+ - id: openwiki-source-9069a5dd5fbb579fbd5470ce+ resource: repo://.github/workflows/integration_tests.yml- id: openwiki-source-ff76574b014ac8b5c67560a6resource: repo://libs/langchain_v1/tests/integration_tests/chat_models/test_base.py- id: openwiki-source-bcf7be66f36f862f639f3c7a@@ -29,94 +37,117 @@ sources:resource: repo://libs/partners/openai/tests/integration_tests/embeddings/test_base.py- id: openwiki-source-db02c1dda8563ab005cd9d62resource: repo://libs/standard-tests/langchain_tests/conftest.py-generated: { by: "openwiki/0.5.0", at: "2026-09-28T08:35:20.640Z" }+ - id: openwiki-source-13cd70e2dd4252d8b05ac9c1+ resource: repo://libs/standard-tests/langchain_tests/integration_tests/__init__.py+ - id: openwiki-source-f7c26a6473517c7b426ef023+ resource: repo://libs/standard-tests/langchain_tests/integration_tests/chat_models.py+generated: { by: "openwiki/0.5.0", at: "2026-10-20T08:25:57.412Z" }---## Overview-Integration tests in LangChain differ fundamentally from unit tests: they call real model APIs (OpenAI, Anthropic, etc.) and require network access and valid credentials. To make these tests reproducible and CI-friendly without exposing API keys or relying on external services, LangChain uses **VCR cassettes**—recorded HTTP interactions that are replayed during test execution.+Integration tests in LangChain differ fundamentally from unit tests: they call real model APIs (OpenAI, Anthropic, Groq, etc.) and require network access and valid credentials. To make these tests reproducible and CI-friendly without exposing API keys or relying on external services, LangChain uses **VCR cassettes**—recorded HTTP interactions that are replayed during test execution.-This page covers the full lifecycle of integration testing: setting up environments, understanding the VCR pattern, organizing cassettes, writing tests that work with both live and recorded modes, handling parameterization, and managing cassette refresh workflows.+All LangChain partner packages inherit a standard suite of integration tests via `ChatModelIntegrationTests` and other base classes. This ensures consistent test coverage across providers while allowing provider-specific customization via property overrides and method extension.-## Environment Setup: API Keys and .env+This page covers:+- VCR cassette recording, playback, and security (scrubbing secrets)+- Test markers (`@pytest.mark.vcr`, `@pytest.mark.scheduled`) for classification+- Standard test suite inheritance and customization points+- CI/CD integration: compilation checks, VCR playback in PR checks, scheduled live testing+- Environment setup, cassette management, and best practices-Integration tests require valid API credentials to record cassettes (once) and for running live integration tests in scheduled or on-demand scenarios. Store credentials in a `.env` file at the integration test directory root.+## Test Markers: Classification and Execution-### .env File Location and Format+LangChain uses pytest markers to classify integration tests into three categories, each running in different CI contexts:-For most packages (e.g., OpenAI partner), the structure is:+### `@pytest.mark.vcr` — Cassette-Backed Tests-```-libs/partners/openai/tests/.env-```+Tests marked with `@pytest.mark.vcr` use **VCR cassettes** for playback. No API key is needed in CI; VCR intercepts HTTP calls and replays pre-recorded responses.-Example `.env.example` (visible in repo):--```bash-# openai-# your api key from https://platform.openai.com/account/api-keys-OPENAI_API_KEY=your_openai_api_key_here--# searchapi-SEARCHAPI_API_KEY=your_searchapi_api_key_here+```python+def test_chat_invoke():+ """Test chat invoke using a cassette."""+ chat = ChatOpenAI(model="gpt-4o-mini")+ response = chat.invoke("Hello")+ assert response.content```-**Important**: `.env` files are `.gitignore`d and never committed. Copy `.env.example` to `.env` locally and populate with valid keys.+**When cassettes are used**:+- **In CI**: Always. VCR runs with `--record-mode=none` (playback-only).+- **Locally**: On first run, if a cassette doesn't exist, `--record-mode=once` will record it (if API key is present). On subsequent runs, VCR replays the cassette.-### Automatic Skipping When Keys Are Missing+**Advantages**:+- Tests are **fast** (no network latency)+- Tests are **deterministic** (same response every time)+- **No credentials** needed in CI+- Cassettes are **committed to git** so all developers can run tests-Integration tests don't explicitly skip when API keys are absent. Instead:+### `@pytest.mark.scheduled` — Live API Tests-1. Tests marked `@pytest.mark.scheduled` (for live API calls) run **only** in scheduled CI or when explicitly selected-2. Tests marked `@pytest.mark.vcr` (for cassette playback) run in CI via `make test_vcr` without credentials-3. Tests without markers but that consume API keys will fail at runtime if no `.env` is present—this is intentional for development environments+Tests marked with `@pytest.mark.scheduled` run **live API calls** without cassettes. These tests are skipped in regular CI but run in scheduled daily workflows with real credentials.-When running `make integration_tests` locally, you must have a valid `OPENAI_API_KEY` in `.env`. If you don't, the test will error, alerting you that credentials are needed.+```python+def test_chat_streaming_live():+ """Test streaming behavior with a live API call."""+ chat = ChatOpenAI(model="gpt-4o-mini")+ response = chat.invoke("Tell me a joke")+ assert response.content+```-### Environment Loading+**When these run**:+- **In PR checks**: Skipped+- **In scheduled daily workflows** (`.github/workflows/integration_tests.yml`): Run with real API credentials+- **On-demand**: Can be manually triggered from GitHub Actions UI-The test conftest automatically loads `.env` on import:+**Purpose**: Validates that the model integrations work against live APIs. Catches issues not covered by cassettes (API changes, model behavior changes, breaking SDK changes).-```python-from pathlib import Path-from dotenv import load_dotenv+### No Marker — Unit-Like Tests-PROJECT_DIR = Path(__file__).resolve().parent.parent+Tests without `@pytest.mark.vcr` or `@pytest.mark.scheduled` run as offline unit tests. They don't require API keys and don't make network calls.-def _load_env() -> None:- dotenv_path = PROJECT_DIR / "tests" / ".env"- if dotenv_path.exists():- load_dotenv(dotenv_path)--_load_env()+```python+def test_model_name_set():+ """Test model initialization without API calls."""+ chat = ChatOpenAI(model="gpt-4o-mini")+ assert chat.model_name == "gpt-4o-mini"```-Credentials are then accessed via `os.environ["OPENAI_API_KEY"]` or similar in tests.+## VCR Cassettes: Recording, Playback, and Security-## The VCR Pattern: Recording and Playback+### The VCR Pattern**VCR** (Video Cassette Recorder, implemented by the `vcrpy` library) records HTTP interactions—requests and responses—the first time a test runs with a live API. On subsequent runs, VCR replays the recorded cassette instead of making live network calls.-### Recording Phase (Once, by Developers)+#### Recording Phase (Once, by Developers)When a new integration test is written or an existing test's behavior changes:-1. Run the test with `--record-mode=new_episodes` (or the default `once`) and a valid API key in `.env`+1. Run the test with a valid API key in `.env` and `--record-mode=once` (default) or `--record-mode=new_episodes`2. VCR intercepts all HTTP calls your test makes-3. **Before recording**, sensitive headers and tokens in request/response bodies are **scrubbed** (redacted to `PLACEHOLDER` or `**REDACTED**`)-4. The cassette is saved as a YAML file (optionally compressed as `.yaml.gz`)+3. **Before recording**, sensitive headers and tokens in request/response bodies are **scrubbed** (redacted)+4. The cassette is saved as a YAML file, optionally compressed as `.yaml.gz`5. The cassette is committed to the repository-### Playback Phase (Always, in CI and Local Development)+```bash+cd libs/partners/openai+uv run --group test --group test_integration pytest \+ --record-mode=new_episodes \+ tests/integration_tests/chat_models/test_base.py::test_chat_openai_invoke+```++#### Playback Phase (Always, in CI and Local Development)When running tests:1. VCR loads the cassette file2. Instead of making real API calls, VCR intercepts your HTTP client and returns the pre-recorded response3. No API key is needed; no credentials are exposed-4. Tests are fast (no network latency) and deterministic (same response every time)+4. Tests are fast and deterministic-### Cassette Location+### Cassette Location and NamingCassettes are stored relative to test modules in a `cassettes/` subdirectory:@@ -125,21 +156,24 @@ libs/partners/openai/tests/integration_tests/chat_models/test_base.py+ test_base_standard.pycassettes/test_base/- TestChatOpenAICodexStandard.test_invoke.yaml.gz+ test_invoke.yaml.gztest_chat_openai.yaml.gz+ test_base_standard/+ TestOpenAIStandard.test_invoke.yaml.gz+ TestOpenAIStandard.test_stream[model0].yaml.gz```-Or at the test root:+For parameterized tests, cassette names include parameter identifiers:```-libs/partners/openai/tests/cassettes/- test_langchain_openai_embeddings_equivalent_to_raw.yaml.gz- test_streaming_tool_call_v1_v2_parity.yaml.gz+test_invoke[gpt-4o-mini].yaml.gz+test_invoke[gpt-4o].yaml.gz```-The fixture `vcr_cassette_dir` (from `conftest.py`) computes the correct directory per test module:+The `vcr_cassette_dir` fixture (from `conftest.py`) computes the correct directory per test module:```python@pytest.fixture(scope="module")@@ -148,23 +182,26 @@ def vcr_cassette_dir(request: pytest.FixtureRequest) -> str:return str(module.parent / "cassettes" / module.stem)```-## Security: Scrubbing Sensitive Data+### Security: Scrubbing Sensitive DataVCR cassettes are **committed to git** and **visible to the world** (in public repositories). To prevent accidental exposure of API keys, JWTs, OAuth tokens, and other secrets, LangChain uses a multi-layer scrubbing pipeline.-### What Gets Redacted+#### What Gets Redacted-**Headers** (configured in `conftest.py`):+**Request and Response Headers** (configured in `conftest.py`):```python_EXTRA_HEADERS = [- ("openai-organization", "PLACEHOLDER"),- ("user-agent", "PLACEHOLDER"),("authorization", "PLACEHOLDER"),+ ("openai-organization", "PLACEHOLDER"),("cookie", "PLACEHOLDER"),+ ("set-cookie", "PLACEHOLDER"),+ ("chatgpt-account-id", "PLACEHOLDER"),]```+All headers are replaced with `**REDACTED**` during recording.+**Request and Response Bodies** (OAuth secret fields):```python@@ -175,6 +212,7 @@ _OAUTH_SECRET_FIELDS = frozenset({"code","device_code","client_secret",+ "code_verifier",})```@@ -184,9 +222,9 @@ Redaction is applied with specialized handlers:- **Form-encoded bodies**: Splits on `&` and redacts matching keys- **JWT patterns**: Uses regex to detect and redact JWT-shaped strings anywhere in the body-**Binary payloads** (PNG, JPEG, PDF, audio, etc.) are **skipped**—their magic bytes are detected and the scrubbing stack is bypassed for performance (JWTs and OAuth secrets are ASCII, so binary bodies can't carry them).+**Binary payloads** (PNG, JPEG, PDF, audio, etc.) are **skipped**—their magic bytes are detected and the scrubbing stack is bypassed for performance. JWTs and OAuth secrets are ASCII, so binary bodies cannot carry them.-### Scrubbing Configuration in conftest.py+#### Scrubbing Configuration in conftest.py```pythondef remove_request_headers(request: Any) -> Any:@@ -199,19 +237,61 @@ def remove_request_headers(request: Any) -> Any:@pytest.fixture(scope="session")def vcr_config() -> dict:- """Extend the default configuration coming from langchain_tests."""config = base_vcr_config()- config["match_on"] = ["json_body"] # Don't match on URI (it's redacted)- config.setdefault("filter_headers", []).extend(_EXTRA_HEADERS)config["before_record_request"] = remove_request_headersconfig["before_record_response"] = remove_response_headers- config["serializer"] = "yaml.gz" # Compress cassettes+ config["serializer"] = "yaml.gz"return config```+## Environment Setup: API Keys and .env++Integration tests require valid API credentials to record cassettes (once) and for running live integration tests in scheduled or on-demand scenarios. Store credentials in a `.env` file at the package's test directory root.++### .env File Location and Format++For partner packages (e.g., OpenAI), the structure is:++```+libs/partners/openai/tests/.env+```++Example `.env.example` (visible in repo):++```bash+# openai+# your api key from https://platform.openai.com/account/api-keys+OPENAI_API_KEY=your_openai_api_key_here++# searchapi+SEARCHAPI_API_KEY=your_searchapi_api_key_here+```++**Important**: `.env` files are `.gitignore`d and never committed. Copy `.env.example` to `.env` locally and populate with valid keys.++### Environment Loading++The test conftest automatically loads `.env` on import:++```python+from pathlib import Path+from dotenv import load_dotenv++PROJECT_DIR = Path(__file__).resolve().parent.parent++def _load_env() -> None:+ dotenv_path = PROJECT_DIR / "tests" / ".env"+ if dotenv_path.exists():+ load_dotenv(dotenv_path)++_load_env()+```++Credentials are then accessed via `os.environ["OPENAI_API_KEY"]` or similar in tests.+## Writing Integration Tests-### Basic Structure+### Basic Structure with VCRIntegration tests live in `tests/integration_tests/` (mirroring the layout of unit tests):@@ -223,21 +303,22 @@ libs/partners/openai/tests/__init__.pyconftest.pytest_base.py+ test_base_standard.pycassettes/```-A minimal integration test using pytest-recording (which auto-hooks VCR):+A minimal integration test using `@pytest.mark.vcr`:```pythonimport pytestfrom langchain_openai import ChatOpenAIfrom langchain_core.messages import HumanMessage[email protected] # Mark test to use VCRdef test_chat_openai_invoke():chat = ChatOpenAI(model="gpt-4o-mini")response = chat.invoke([HumanMessage(content="Hello")])- assert response.content # Assert the response is non-empty+ assert response.content```The `@pytest.mark.vcr` marker tells pytest-recording to automatically:@@ -246,45 +327,9 @@ The `@pytest.mark.vcr` marker tells pytest-recording to automatically:2. Use VCR to intercept HTTP calls3. Replay the cassette if it exists; record a new one if it doesn't (or if `--record-mode=new_episodes` is passed)-### Markers for Test Classification--**`@pytest.mark.scheduled`**: Marks tests for **live API calls** (no cassette). These run in scheduled CI workflows with real credentials.--```python-def test_chat_openai_streaming_live():- """Test streaming with a live API call."""- chat = ChatOpenAI(model="gpt-4o-mini", streaming=True)- response = chat.invoke("Hello")- assert response.content-```--These tests are **skipped in CI** unless explicitly selected or running in a scheduled job. Locally, they require a valid API key.--**`@pytest.mark.vcr`**: Marks tests for **cassette playback**. VCR is enabled; the cassette is replayed. No API key needed in CI.--```python-def test_chat_openai_with_tools():- """Test tool calling with a cassette."""- chat = ChatOpenAI(model="gpt-4o-mini")- tools = [...]- response = chat.invoke(..., tools=tools)- assert response.tool_calls-```--**No marker**: Tests without a marker run as **plain unit-like tests**, often for initialization, validation, or offline scenarios. They don't require an API key.--```python-def test_chat_openai_model_name():- """Test model name is set correctly."""- chat = ChatOpenAI(model="gpt-4o-mini")- assert chat.model_name == "gpt-4o-mini"-```-### Parameterized Integration Tests-When testing the same scenario against multiple models or configurations, use `pytest.mark.parametrize`:+When testing the same scenario against multiple models or configurations, use `@pytest.mark.parametrize`:```pythonimport pytest@@ -325,10 +370,10 @@ def test_chat_openai_streaming():for chunk in chat.stream("Hello"):chunks.append(chunk)assert len(chunks) > 0- assert chunks[-1].content # Final chunk has content+ assert chunks[-1].content```-The cassette records all the streaming HTTP chunks, and VCR replays them in order during playback.+The cassette records all the streaming HTTP chunks, and VCR replays them in order during playback. Async tests work identically—VCR intercepts the underlying `httpx`/`requests` library for both sync and async.### Testing Error Paths@@ -373,7 +418,7 @@ uv run --group test --group test_integration pytest \**Prerequisites**:- A valid `OPENAI_API_KEY` in `tests/.env`-- Network access (obviously)+- Network access**What happens**:1. pytest-recording starts VCR in record mode@@ -391,7 +436,7 @@ git commit -m "Add cassette for chat_openai_invoke integration test"### Refreshing Stale Cassettes-When test code changes (e.g., you change the prompt, the model, or the parameters), the cassette may become stale. VCR will attempt to match the new request body against the old cassette; if there's a mismatch, it will fail with a `CannotOverwriteExistingCassetteException` error (in playback mode) or suggest re-recording.+When test code changes (e.g., you change the prompt, the model, or the parameters), the cassette may become stale. VCR will attempt to match the new request body against the old cassette; if there's a mismatch, it will fail with a `CannotOverwriteExistingCassetteException` error (in playback mode).To refresh:@@ -404,6 +449,23 @@ uv run --group test --group test_integration pytest \This overwrites the cassette with the new interaction. Re-verify the cassette was scrubbed correctly, then commit.+### Inspecting Cassettes++To inspect a cassette, decompress and read:++```bash+gunzip -c libs/partners/openai/tests/cassettes/test_invoke.yaml.gz | head -50+```++Or, for a permanent view:++```bash+gunzip libs/partners/openai/tests/cassettes/test_invoke.yaml.gz+# Now test_invoke.yaml is readable+```++(Remember to re-compress or re-record before committing.)+### Cassette FormatCassettes are YAML files (optionally gzip-compressed). A typical cassette structure:@@ -438,26 +500,9 @@ request:- "PLACEHOLDER"```-### Inspecting Cassettes--To inspect a cassette, decompress and read:--```bash-gunzip -c libs/partners/openai/tests/cassettes/test_invoke.yaml.gz | head -50-```--Or, for a permanent view:--```bash-gunzip libs/partners/openai/tests/cassettes/test_invoke.yaml.gz-# Now test_invoke.yaml is readable-```--(Remember to re-compress or re-record before committing.)-## Running Integration Tests-### Full Integration Test Suite+### Full Integration Test Suite (Live)Run all integration tests against live APIs (requires credentials):@@ -469,14 +514,10 @@ make integration_tests # Runs full suite with live API callsThis invokes:```bash-uv run --with 'openai>=2.45.0,<3.0.0' --group test --group test_integration pytest \- -v --tb=short tests/integration_tests/--uv run --with 'openai>=3.0.0,<4.0.0' --group test --group test_integration pytest \- -v --tb=short tests/integration_tests/+uv run --group test --group test_integration pytest -v --tb=short tests/integration_tests/```-It also smoke-tests a single live request on each supported OpenAI SDK major version (2.x and 3.x).+It also smoke-tests a single live request on each supported SDK major version (e.g., OpenAI SDK 2.x and 3.x).### VCR Cassette Tests (CI Mode)@@ -506,41 +547,85 @@ cd libs/partners/openaimake integration_tests```-Only tests marked `@pytest.mark.scheduled` run in these workflows. See [CI/CD Workflows](repo:///openwiki/ci-workflows.md#integration-test-compilation) for details.+Only tests marked `@pytest.mark.scheduled` run in these workflows. See [CI/CD Workflows](repo:///openwiki/ci-workflows.md) for details.-## Streaming and Async Integration Tests+## Standard Test Suite Inheritance-### Async Tests+LangChain partner packages inherit a standard suite of integration tests via `ChatModelIntegrationTests` from `langchain_tests.integration_tests`. This allows all chat model providers to run a common set of tests without duplicating test code.-Async integration tests work the same as sync tests:+### How It Works++Each partner package defines a test class that inherits from `ChatModelIntegrationTests`:```python-async def test_chat_openai_ainvoke():- """Test async invoke."""- chat = ChatOpenAI(model="gpt-4o-mini")- response = await chat.ainvoke("Hello")- assert response.content+# libs/partners/openai/tests/integration_tests/chat_models/test_base_standard.py+from langchain_tests.integration_tests import ChatModelIntegrationTests+from langchain_openai import ChatOpenAI++class TestOpenAIStandard(ChatModelIntegrationTests):+ @property+ def chat_model_class(self) -> type[BaseChatModel]:+ return ChatOpenAI++ @property+ def chat_model_params(self) -> dict:+ return {"model": "gpt-4o-mini"}++ @property+ def supports_image_inputs(self) -> bool:+ return True++ @property+ def has_tool_calling(self) -> bool:+ return True```-VCR intercepts the underlying `httpx` (or `requests`) library, so both sync and async HTTP calls are recorded and replayed identically.+The base class (`ChatModelIntegrationTests`) implements dozens of test methods that exercise standard chat model capabilities: `invoke`, `ainvoke`, `stream`, `astream`, tool calling, structured output, image inputs, and more. Each test method is automatically marked with `@pytest.mark.vcr` so cassettes are recorded and replayed.++### Required Properties++Partner implementations **must** override two properties:++- **`chat_model_class`**: The model class to instantiate (e.g., `ChatOpenAI`)+- **`chat_model_params`**: Initialization parameters for the model (e.g., `{"model": "gpt-4o-mini"}`)-### Streaming with `stream_events`+### Feature Declaration Properties-Tests that use `stream_events` (the LangChain event streaming API) also work with cassettes:+Partner implementations can declare model capabilities via properties. These control which tests run and how they are executed:++- **`has_tool_calling`**: Whether the model supports tool/function calling+- **`has_tool_choice`**: Whether the model supports forcing a tool call via `tool_choice` parameter+- **`has_structured_output`**: Whether the model supports structured output+- **`supports_image_inputs`**: Whether the model accepts image inputs (base64)+- **`supports_image_urls`**: Whether the model accepts image URLs+- **`supports_json_mode`**: Whether the model supports `method='json_mode'` in structured output+- **`supports_pdf_inputs`**: Whether the model accepts PDF file inputs+- **`structured_output_kwargs`**: Dict of additional kwargs for `with_structured_output()` (e.g., `{"method": "json_schema"}`)++### Customization: Overriding Test Methods++Partners can override individual test methods to provide provider-specific behavior:```python-def test_chat_openai_stream_events():- """Test streaming events."""- chat = ChatOpenAI(model="gpt-4o-mini")- events = []- for event in chat.stream_events("Hello", version="v2"):- events.append(event)- assert len(events) > 0+class TestOpenAIStandard(ChatModelIntegrationTests):+ # ... properties ...++ def invoke_with_cache_read_input(self, *, stream: bool = False) -> AIMessage:+ """Override to test cache read with specific model features."""+ llm = ChatOpenAI(model="gpt-4o-mini", stream_usage=True)+ return llm.invoke("Cached prompt", ...)```-The underlying HTTP calls are recorded in the cassette; the event structure is replayed exactly.+### VCR Integration with Standard Tests++Standard test methods inherit VCR integration automatically:++1. Each test method is pre-marked with `@pytest.mark.vcr`+2. Cassettes are generated automatically with names like `TestOpenAIStandard.test_invoke.yaml.gz`, `TestOpenAIStandard.test_invoke[model0].yaml.gz` (for parameterized variants)+3. Tests run in CI via `make test_vcr --record-mode=none` to validate cassettes are up-to-date+4. When a partner updates a test (e.g., adds a new model to test), new cassettes are recorded with `--record-mode=new_episodes`++This approach ensures that all LangChain partners maintain consistent test coverage and that changes to the standard test suite (new test methods, new capabilities) are automatically picked up by all partners.## VCR Configuration Details@@ -555,7 +640,7 @@ from langchain_tests.conftest import CustomPersister, CustomSerializer, base_vcrdef vcr_config() -> dict:"""Extend the default configuration coming from langchain_tests."""config = base_vcr_config()- # Base config:+ # Base config includes:# - record_mode: "once"# - filter_headers: ["authorization", "x-api-key", "api-key"]# - match_on: ["method", "uri", "body"]@@ -592,8 +677,6 @@ By default, VCR matches requests by:match_on: ["method", "uri", "body"]```-This means: "A request matches a cassette if the HTTP method, URI, and body are identical."-For APIs with non-deterministic bodies (e.g., timestamps in the request), you can customize matchers or use `allow_playback_repeats` to reuse the same response for multiple request variants.OpenAI tests use a custom `json_body` matcher:@@ -602,19 +685,65 @@ OpenAI tests use a custom `json_body` matcher:config["match_on"] = ["json_body"] # Only match on JSON-parsed body (ignores whitespace/key order)```-This allows cassettes to match even if JSON key order differs.+This allows cassettes to match even if JSON key order differs. The matcher is registered in `pytest_recording_configure`:-## Integration with CI/CD+```python+def _json_body_matcher(r1: Any, r2: Any) -> None:+ """Match request bodies as parsed JSON, ignoring key order and tool description whitespace."""+ # Parses both bodies as JSON and compares parsed trees+ # Normalizes tool descriptions to handle Python version differences+ # Fails gracefully for non-JSON bodies+```++## CI/CD Integration-### CI Workflows+### Workflow StructureThe LangChain CI system runs integration tests at multiple points:-1. **Pull request checks** (`check_diffs.yml`): Compiles integration tests without running them-2. **VCR cassette tests** (`_test_vcr.yml`): Runs cassette-backed integration tests in playback-only mode-3. **Scheduled integration tests** (`integration_tests.yml`): Daily remote API testing with live credentials against partner libraries+1. **Pull request checks** (`check_diffs.yml`): Compiles integration tests without running them, then runs `make test_vcr` for cassette playback tests+2. **Scheduled integration tests** (`integration_tests.yml`): Daily remote API testing with live credentials against partner libraries++#### Integration Test Compilation (`_compile_integration_test.yml`)++Validates that integration tests compile without syntax or import errors:++```bash+uv run pytest -m compile tests/integration_tests+```++This is a fast check that catches import errors and syntax issues before attempting to run tests. It runs in `check_diffs.yml` for every package with changed files.++#### VCR Cassette Tests (`_test_vcr.yml`)++Runs cassette-backed integration tests in playback-only mode:++```bash+uv run pytest --record-mode=none -m vcr tests/integration_tests/+```++**Key features**:+- No API keys needed (fake key like `sk-fake` is set)+- Cassettes are **never recorded** or overwritten in CI+- If a cassette is missing, the test **fails immediately**+- If request bodies don't match, the test **fails immediately**+- Tests run in parallel for speed (`-n auto`)++This catches stale cassettes caused by test code changes without attempting live calls.-See [CI/CD Workflows: GitHub Actions and Release Process](repo:///openwiki/ci-workflows.md) for full details, including scheduled workflows and record mode management.+#### Scheduled Integration Tests (`integration_tests.yml`)++Runs with `make integration_tests` daily or on-demand:++```bash+uv run --group test --group test_integration pytest -v --tb=short tests/integration_tests/+```++**Key features**:+- Runs with real API credentials from secrets+- Runs only tests marked `@pytest.mark.scheduled`+- Tests marked `@pytest.mark.vcr` are skipped (use cassettes in PR checks instead)+- Smoke-tests each supported SDK major version### Cassette Validation in CI@@ -626,7 +755,7 @@ The `test_vcr` job runs with `--record-mode=none`, which means:This catches stale cassettes caused by test code changes without attempting live calls.-## Extension Points and Customization+## Advanced Configuration### Custom VCR Matchers@@ -667,59 +796,32 @@ def vcr_config() -> dict:return config```-## Standard Test Suite Inheritance+### Disabling Specific Tests in CI-LangChain partner packages inherit a standard suite of integration tests via `ChatModelIntegrationTests` from `langchain_tests.integration_tests`. This allows all chat model providers to run a common set of tests without duplicating test code.--### How It Works--Each partner package defines a test class that inherits from `ChatModelIntegrationTests`:+Some providers (e.g., Codex, audio models) require special handling in CI. Use `pytest_collection_modifyitems` hooks to skip tests at collection time:```python-# libs/partners/openai/tests/integration_tests/chat_models/test_base_standard.py-from langchain_tests.integration_tests import ChatModelIntegrationTests-from langchain_openai import ChatOpenAI--class TestOpenAIStandard(ChatModelIntegrationTests):- @property- def chat_model_class(self) -> type[BaseChatModel]:- return ChatOpenAI-- @property- def chat_model_params(self) -> dict:- return {"model": "gpt-4o-mini"}-- @property- def supports_image_inputs(self) -> bool:- return True-- @property- def has_tool_calling(self) -> bool:- return True+def pytest_collection_modifyitems(+ config: pytest.Config, items: list[pytest.Item]+) -> None:+ """Skip Codex tests in CI unless they are replaying VCR cassettes."""+ if not os.getenv("CI") or _vcr_record_mode(config) == "none":+ return+ # Skip Codex tests unless in playback mode```-The base class (`ChatModelIntegrationTests`) implements dozens of test methods that exercise standard chat model capabilities: `invoke`, `ainvoke`, `stream`, `astream`, tool calling, structured output, image inputs, and more. Each test method is automatically marked with `@pytest.mark.vcr` so cassettes are recorded and replayed.--### Customization Points--Partner implementations override properties to declare:--- **`chat_model_class`**: The model class to instantiate-- **`chat_model_params`**: Default parameters (model name, API key, etc.)-- **`supports_*` properties**: Declare which features the model supports (images, tools, JSON mode, etc.)-- **`has_*` properties**: Declare model capabilities (tool calling, structured output, etc.)-- **Custom methods**: Override test methods to provide provider-specific behavior (e.g., handling audio inputs, reasoning models)--### VCR Integration with Standard Tests--Standard test methods inherit VCR integration:--1. Each test method is pre-marked with `@pytest.mark.vcr`-2. Cassettes are generated automatically with names like `test_invoke.yaml.gz`, `test_invoke[model0].yaml.gz` (for parameterized variants)-3. Tests run in CI via `make test_vcr --record-mode=none` to validate cassettes are up-to-date-4. When a partner updates a test (e.g., adds a new model to test), new cassettes are recorded with `--record-mode=new_episodes`+And use autouse fixtures to stub dependencies:-This approach ensures that all LangChain partners maintain consistent test coverage and that changes to the standard test suite (new test methods, new capabilities) are automatically picked up by all partners.+```python[email protected](autouse=True)+def _fake_codex_oauth_token(+ request: pytest.FixtureRequest, monkeypatch: pytest.MonkeyPatch+) -> None:+ """Stub OAuth token reads for Codex VCR tests."""+ if "codex" not in request.module.__name__:+ return+ # Monkeypatch OAuth token provider with in-memory fake token+```## Best Practices@@ -730,8 +832,8 @@ This approach ensures that all LangChain partners maintain consistent test cover3. **Keep cassettes small**: Avoid recording huge responses (e.g., embeddings of long documents). If needed, use manual cassette creation with canned data.4. **Use markers correctly**:- - `@pytest.mark.vcr` for cassette-backed tests- - `@pytest.mark.scheduled` for live-only tests+ - `@pytest.mark.vcr` for cassette-backed tests (run in PR checks)+ - `@pytest.mark.scheduled` for live-only tests (run in scheduled workflows)- No marker for offline tests5. **Test against multiple models/versions**: Use `@pytest.mark.parametrize` to test multiple configurations and generate separate cassettes for each.@@ -741,3 +843,7 @@ This approach ensures that all LangChain partners maintain consistent test cover7. **Refresh cassettes when code changes**: If you modify the test (new prompt, new parameters), refresh the cassette with `--record-mode=new_episodes`.8. **Review cassette diffs**: When committing cassette updates, review the diff in your PR to ensure no secrets leaked.++9. **Inherit standard tests**: Use `ChatModelIntegrationTests` and similar base classes from `langchain_tests.integration_tests` to ensure consistent coverage across providers.++10. **Override properties, not methods**: Prefer declaring capabilities via properties (`supports_*`, `has_*`) rather than overriding test methods, unless provider-specific logic is needed.diff --git a/openwiki/mcp-integration.md b/openwiki/mcp-integration.mdindex 0cf0c84053..13e895ec9b 100644--- a/openwiki/mcp-integration.md+++ b/openwiki/mcp-integration.md@@ -5,7 +5,7 @@ description: "MCPAdapter bridges MCP servers to LangChain agents, discovering totags: [mcp, protocol, tools, adapter, integration, langgraph]verified:- by: openwiki/0.5.0- at: 2026-09-28T08:35:20.640Z+ at: 2026-10-20T08:25:57.412Zsources:- id: openwiki-source-6d1e3478d5b63988ee177552resource: repo://libs/langchain_v1/examples/mcp/auth_bearer.pydiff --git a/openwiki/messages.md b/openwiki/messages.mdindex f4f01fdb15..6c306b1861 100644--- a/openwiki/messages.md+++ b/openwiki/messages.md@@ -29,7 +29,7 @@ sources:generated: { by: "openwiki/0.5.0", at: "2026-09-08T08:27:09.597Z" }verified:- by: openwiki/0.5.0- at: 2026-09-28T08:35:20.640Z+ at: 2026-10-20T08:25:57.412Z---## Overviewdiff --git a/openwiki/middleware.md b/openwiki/middleware.mdindex 9f359fc386..a110d4545c 100644--- a/openwiki/middleware.md+++ b/openwiki/middleware.md@@ -1,8 +1,11 @@----type: "Reference"+type: Architecture Patterntitle: "Agent Middleware: Composable Request/Response Processing"-description: "Comprehensive guide to the middleware composition system: hook types, typing, payload transformations, and practical examples for hooking into model calls, tool calls, and agent lifecycle."-tags: [agent-middleware, request-interception, composition, error-handling, human-in-the-loop, lifecycle-hooks]+description: "Comprehensive guide to the middleware composition system: lifecycle hooks, handler interception, state transformation, payload types, error handling, and implementation patterns for common middleware."+tags: [agent-middleware, request-interception, composition, error-handling, human-in-the-loop, lifecycle-hooks, tool-error-handling]+verified:+ - by: openwiki/0.5.0+ at: 2026-10-20T08:25:57.412Zsources:- id: openwiki-source-71e882e1ac9757ea8e959a7cresource: repo://libs/langchain_v1/langchain/agents/factory.py@@ -10,77 +13,77 @@ sources:resource: repo://libs/langchain_v1/langchain/agents/middleware/human_in_the_loop.py- id: openwiki-source-c29f7722b0a4bcc0d760335eresource: repo://libs/langchain_v1/langchain/agents/middleware/model_retry.py+ - id: openwiki-source-50108ce202a6d5d98d232aba+ resource: repo://libs/langchain_v1/langchain/agents/middleware/tool_call_limit.py- id: openwiki-source-219798683681ccdced950f4dresource: repo://libs/langchain_v1/langchain/agents/middleware/tool_error.py+ - id: openwiki-source-ca5686c3f30a4e08bba10929+ resource: repo://libs/langchain_v1/langchain/agents/middleware/tool_retry.py- id: openwiki-source-03e8ca0eebe37feda8566793resource: repo://libs/langchain_v1/langchain/agents/middleware/types.py-generated: { by: "openwiki/0.5.0", at: "2026-09-28T08:35:20.640Z" }-verified:- - by: openwiki/0.5.0- at: 2026-10-16T08:25:55.096Z+generated: { by: "openwiki/0.5.0", at: "2026-10-20T08:25:57.412Z" }---## Overview-Middleware in LangChain agents provides a composable, layered approach to intercepting and modifying agent behavior without changing core agent logic. Middleware hooks into the agent execution loop to implement cross-cutting concerns: automatic retries, error handling, human-in-the-loop approval, tool argument validation, structured output transformation, and tool caching.+Middleware in LangChain agents provides a composable, layered approach to intercepting and modifying agent behavior at well-defined execution points without changing core agent logic. Each middleware instance registers handler pairs (sync/async) for lifecycle hooks: initialization (`before_agent`), per-iteration model invocation (`before_model`, `wrap_model_call`, `after_model`), tool execution (`wrap_tool_call`), and completion (`after_agent`). Middleware composes by wrapping handlers in registration order, enabling cross-cutting concerns: automatic retries with exponential backoff, error handling and recovery, human-in-the-loop approval, tool argument validation, request/response transformation, and structured output handling.### Core Architectural Principles-**Interception Model**: Each middleware instance registers sync/async handler pairs for lifecycle hooks. When the agent executes, hooks are invoked in registration order, with each middleware observing or transforming state before delegating to the next layer or the core execution logic.+**Interception Model**: Middleware hooks into the agent execution loop at discrete points. Lifecycle hooks (`before_agent`, `before_model`, `after_model`, `after_agent`) run synchronously with the graph, returning optional state updates. Interception hooks (`wrap_model_call`, `wrap_tool_call`) receive a handler callback that executes the wrapped operation and can call it zero or more times, modify the request/response, or short-circuit entirely.-**Composition Semantics**: Middleware registered first in the list becomes the outermost layer. When composing `wrap_model_call` or `wrap_tool_call` handlers, each middleware wraps the previous ones, establishing a chain where the first middleware intercepts first and last.+**Composition Semantics**: Middleware registered first becomes the outermost layer. In `wrap_model_call` chains, `[M1, M2, M3]` becomes `M1(M2(M3(model)))`: M1 receives control first and last, can observe or transform all inner results. Control flows inward through the stack when each middleware calls `handler(request)`, then flows outward as results propagate back.-- **Model call stack example**: `[Middleware1, Middleware2, Middleware3]` becomes `Middleware1(Middleware2(Middleware3(model)))`, so `Middleware1` receives control first, calls the next handler (which is Middleware2's wrapper), receives the result, and can transform it before returning.-- **Tool call stack**: Identical composition order — first middleware is outermost.+**State and Command Flow**: Lifecycle hooks return optional state updates (`dict[str, Any] | None`). State updates merge using LangGraph reducers—`messages` field accumulates via `add_messages`; non-reducer fields overwrite. Interception hooks can return `ExtendedModelResponse` with optional `Command` objects from LangGraph, allowing middleware to redirect execution flow, jump to different nodes, or accumulate state updates that apply after the current node completes.-**State and Command Flow**: Most hooks return optional state updates (`dict[str, Any]`). The `wrap_model_call` and `wrap_tool_call` interception points also support returning `Command` objects from LangGraph, allowing middleware to redirect execution or jump to different nodes (e.g., skip tool execution, loop back to model, or exit).+**Error Propagation**: Exceptions raised inside middleware (or by the wrapped operation) propagate up the stack unless explicitly handled. Control-flow signals (`interrupt`, `Command`) bypass error handling and always propagate. Middleware can convert exceptions to messages/errors or re-raise them.## AgentMiddleware Protocol-All middleware classes inherit from `AgentMiddleware`, a generic base that defines optional hooks and establishes the contract for interceptors.+All middleware classes inherit from `AgentMiddleware`, a generic base defining optional hooks.### Type Parameters```pythonclass AgentMiddleware(Generic[StateT, ContextT, ResponseT]):"""- StateT: Type of agent state (default: AgentState[Any]).- ContextT: Type of runtime context (default: None).- ResponseT: Type of structured response (default: Any).+ StateT: Agent state type (default: AgentState[Any]).+ ContextT: Runtime context type (default: None).+ ResponseT: Structured response type (default: Any)."""```### Lifecycle Hooks-Middleware can implement any or all of these lifecycle methods; unimplemented methods raise `NotImplementedError` if invoked in the wrong execution path (sync vs async):+Middleware can implement any subset of these hooks; unimplemented methods raise `NotImplementedError` if invoked in the wrong execution path (sync vs async).-#### Before/After Agent+#### Initialization Hooks```pythondef before_agent(self, state: StateT, runtime: Runtime[ContextT]) -> dict[str, Any] | None:- """Runs once at the very start of agent execution, before the first model call."""+ """Runs once at agent start, before first model call."""async def abefore_agent(self, state: StateT, runtime: Runtime[ContextT]) -> dict[str, Any] | None:"""Async version of before_agent."""def after_agent(self, state: StateT, runtime: Runtime[ContextT]) -> dict[str, Any] | None:- """Runs once after the agent loop terminates (no more tool calls or explicit exit)."""+ """Runs after agent loop terminates (no more tool calls or explicit exit)."""async def aafter_agent(self, state: StateT, runtime: Runtime[ContextT]) -> dict[str, Any] | None:"""Async version of after_agent."""```-#### Before/After Model+#### Model Invocation Hooks```pythondef before_model(self, state: StateT, runtime: Runtime[ContextT]) -> dict[str, Any] | None:- """Runs before each model invocation; allows state transformation before the call."""+ """Runs before each model invocation; can update state or set jump_to for control flow."""async def abefore_model(self, state: StateT, runtime: Runtime[ContextT]) -> dict[str, Any] | None:"""Async version of before_model."""def after_model(self, state: StateT, runtime: Runtime[ContextT]) -> dict[str, Any] | None:- """Runs after each model response; allows approval, modification, or rejection of tool calls."""+ """Runs after model response; can filter tool calls or update state."""async def aafter_model(self, state: StateT, runtime: Runtime[ContextT]) -> dict[str, Any] | None:"""Async version of after_model."""@@ -96,13 +99,13 @@ def wrap_model_call() -> ModelResponse[ResponseT] | AIMessage | ExtendedModelResponse[ResponseT]:"""Intercept and control model execution.- The handler callback executes the model call and returns ModelResponse.+ Handler callback executes the model and returns ModelResponse.Middleware can:- - Call handler once for normal execution.- - Call handler multiple times for retry logic.- - Skip calling handler to short-circuit (return a cached result).- - Modify request before calling handler.- - Transform response after handler returns.+ - Call handler once for normal execution+ - Call handler multiple times for retry logic+ - Skip handler to short-circuit (return cached or fallback result)+ - Modify request before calling handler+ - Transform response after handler returnsReturns ModelResponse, AIMessage (auto-wrapped), or ExtendedModelResponse (with Command)."""@@ -125,13 +128,13 @@ def wrap_tool_call() -> ToolMessage | Command[Any]:"""Intercept tool execution.- Called once per tool call with the full ToolCallRequest (tool name, args, call id, state, runtime).+ Called once per tool call with full ToolCallRequest (tool call dict, BaseTool instance, state, runtime).Middleware can:- - Call handler for normal execution.- - Call handler multiple times for retries.- - Skip handler to return a cached result or mock.- - Modify tool args before handler.- - Convert exceptions to error ToolMessages.+ - Call handler for normal execution+ - Call handler multiple times for retries+ - Skip handler to return cached result or mock+ - Modify tool args before handler+ - Convert exceptions to error ToolMessagesReturns ToolMessage or Command."""@@ -159,86 +162,81 @@ class AgentMiddleware(Generic[StateT, ContextT, ResponseT]):transformers: Sequence[TransformerFactory] = ()"""Stream transformer factories for streaming customization."""++ @property+ def name(self) -> str:+ """The name of the middleware instance. Defaults to the class name; override for custom naming."""```-## Core Middleware Types and Patterns+## Composition and Execution Order-### Model Execution Middleware+### Middleware Stack Architecture-**ModelRetryMiddleware**: Automatically retries failed model calls with exponential backoff when transient errors (rate limits, API timeouts) occur. Supports custom exception filtering, custom failure handlers, and jitter to avoid thundering herd.+When middleware is registered as `[M1, M2, M3]`, they compose into a stack where first becomes outermost:-```python-from langchain.agents.middleware import ModelRetryMiddleware+```mermaid+sequenceDiagram+ participant Agent+ participant M1 as Middleware1 (outermost)+ participant M2 as Middleware2+ participant M3 as Middleware3 (innermost)+ participant Model-retry = ModelRetryMiddleware(- max_retries=3,- retry_on=(RateLimitError, APITimeoutError),- backoff_factor=2.0,- initial_delay=1.0,- on_failure="continue", # or "error" to re-raise, or callable-)+ Agent->>M1: wrap_model_call(request, handler)+ M1->>M2: call handler (delegates to M2)+ M2->>M3: call handler (delegates to M3)+ M3->>Model: call handler (executes model)+ Model-->>M3: ModelResponse+ M3->>M2: return result (can transform)+ M2->>M1: return result (can transform)+ M1->>Agent: return result (final)```-**ModelFallbackMiddleware**: Wraps the primary model with a fallback model (typically smaller/faster/cheaper) when the primary fails or to diversify model selection strategies.+**Execution Flow**:+1. M1's `wrap_model_call` is entered first (outermost)+2. M1 calls `handler()` → M2's `wrap_model_call` is entered+3. M2 calls `handler()` → M3's `wrap_model_call` is entered+4. M3 calls `handler()` → actual model execution+5. Model returns to M3 first; M3 can transform result+6. M3 returns to M2; M2 can transform result+7. M2 returns to M1; M1 can transform result and returns to agent-**ModelCallLimitMiddleware**: Enforces a maximum number of model calls per agent invocation, preventing runaway loops.--### Tool Execution Middleware--**ToolErrorMiddleware**: Converts tool execution exceptions (e.g., API errors, validation failures) into error `ToolMessage` objects sent back to the model, allowing the model to recover or clarify. Opt-in by exception type.--```python-from langchain.agents.middleware import ToolErrorMiddleware+**Key Point**: Innermost middleware (M3, closest to model) sees the result first after model execution; outermost middleware (M1) sees and can override all inner transformations.-def on_error(exc: Exception, request: ToolCallRequest) -> str | None:- if isinstance(exc, ValueError):- return f"Invalid argument for {request.tool_call['name']}: {exc}"- return None # Propagate other exceptions+### State Updates and Command Accumulation-middleware = ToolErrorMiddleware(on_error=on_error)-```+Lifecycle hooks return state updates merged via LangGraph reducers. For the `messages` field (using `add_messages` reducer), updates accumulate. Non-reducer fields are overwritten by the most recent update.-**ToolRetryMiddleware**: Retries failed tool calls with configurable backoff and validation logic.+**Command Accumulation**: When middleware returns `ExtendedModelResponse` with `Command`, multiple commands are accumulated in a list (inner-to-outer order). The agent applies them sequentially after the model node completes through LangGraph state reducers.-**ToolCallLimitMiddleware**: Prevents infinite tool loops by enforcing a maximum number of tool calls.+**Reducer Semantics**:+- **Messages field**: Uses `add_messages` reducer, so messages in commands are **added** to existing messages, not replaced.+- **Non-reducer fields**: Later commands (from outer middleware) overwrite earlier ones (from inner middleware). This is "outermost-wins" semantics.-### Control Flow & Approval Middleware+Example: If M1 and M3 both return commands with `{"status": "processing"}`, M1's value is used because M1 is outer.-**HumanInTheLoopMiddleware**: Pauses after model-requested tool calls and sends an interrupt with action summaries to a human reviewer. Uses the `after_model` hook to intercept AIMessage tool calls and send a HITLRequest for review. Supports approval, editing, rejection, or human-answered "respond" decision types. Tool calls are modified based on human feedback before execution.+### Middleware Stack Example```python-from langchain.agents.middleware import HumanInTheLoopMiddleware+from langchain.agents import create_agent+from langchain.agents.middleware import (+ ModelRetryMiddleware,+ ToolErrorMiddleware,+ HumanInTheLoopMiddleware,+)-hitl = HumanInTheLoopMiddleware(- interrupt_on={- "delete_file": True, # All decision types allowed- "search": {- "allowed_decisions": ["approve", "reject"],- "description": "Searching online databases",- },- }+agent = create_agent(+ model=ChatOpenAI(),+ tools=[search, calculator],+ middleware=[+ ModelRetryMiddleware(max_retries=2), # M1: Outermost, retry model calls+ ToolErrorMiddleware(on_error=handle_error), # M2: Middle, handle tool errors+ HumanInTheLoopMiddleware(interrupt_on={"delete": True}), # M3: Innermost, approve risky tools+ ],)```-The middleware constructs `ActionRequest` objects (with name, args, and optional description) and `ReviewConfig` objects (with action name and allowed decision types), sends them as a `HITLRequest` via `langgraph.interrupt()`, receives decisions back, and processes them:-- **approve**: Tool call proceeds unchanged-- **edit**: Tool call arguments are revised by the human-- **reject**: Tool call is blocked; a ToolMessage with user feedback is sent to the model instead-- **respond**: Tool execution is skipped; a synthetic ToolMessage with the human's answer is returned to the model--### Data Transformation & Privacy Middleware--**PIIMiddleware**: Detects personally identifiable information (PII) in prompts, model responses, and tool outputs; optionally redacts or transforms it. Supports configurable detectors and redaction rules.--**ContextEditingMiddleware**: Allows dynamic modification of agent context (system message, available tools) during execution.--**FileSearchMiddleware**: Integrates file search capabilities into the agent, retrieving relevant documents before model calls.--### System Tools Middleware--**ShellToolMiddleware**: Provides controlled shell command execution with configurable resource limits, sandboxing (host, Docker, Codex), timeout enforcement, and output truncation.--**TodoListMiddleware**: Adds persistent todo list management capability.+**Control flow**: M1 catches and retries model errors → M2 wraps tool execution and converts exceptions → M3 checks if tool should be approved before execution.## Request and Response Types@@ -249,18 +247,29 @@ The middleware constructs `ActionRequest` objects (with name, args, and optionalclass ModelRequest(Generic[ContextT]):"""Request context for model execution."""- model: BaseChatModel # The model to invoke- messages: list[AnyMessage] # Messages (excluding system message)+ model: BaseChatModel # The model to invoke+ messages: list[AnyMessage] # Messages (excluding system message)system_message: SystemMessage | None # System instructions- tool_choice: Any # Tool selection strategy- tools: list[BaseTool | dict] # Available tools+ tool_choice: Any # Tool selection strategy+ tools: list[BaseTool | dict] # Available toolsresponse_format: ResponseFormat[Any] | None # Structured output format- state: AgentState[Any] # Full agent state- runtime: Runtime[ContextT] # Runtime context- model_settings: dict[str, Any] # Additional model parameters+ state: AgentState[Any] # Full agent state+ runtime: Runtime[ContextT] # Runtime context+ model_settings: dict[str, Any] # Additional model parameters```-**Immutable Pattern**: Middleware should not mutate `ModelRequest` directly. Use `request.override(**changes)` to create a new request with modifications. Direct attribute assignment is deprecated and raises `DeprecationWarning`.+**Immutable Pattern**: Middleware must not mutate `ModelRequest` directly. Use `request.override(**changes)` to create a new request with modifications. Direct attribute assignment is deprecated and raises `DeprecationWarning`.++```python+# ✅ Correct: use override()+new_request = request.override(+ system_message=SystemMessage(content="New instructions"),+ tools=[filtered_tools]+)++# ❌ Deprecated: direct assignment+request.system_message = ... # Raises DeprecationWarning+```### ModelResponse@@ -299,64 +308,177 @@ class ToolCallRequest:runtime: ToolRuntime # Runtime context with tool-specific info```-## Composition and Execution Order+## Core Middleware Types and Patterns-```mermaid-sequenceDiagram- participant Agent- participant M1 as Middleware1- participant M2 as Middleware2- participant M3 as Middleware3- participant Model+### Model Execution Middleware- Agent->>M1: wrap_model_call(request, handler)- M1->>M2: call handler (delegates to M2)- M2->>M3: call handler (delegates to M3)- M3->>Model: call handler (executes model)- Model->>M3: ModelResponse or ExtendedModelResponse- M3->>M3: Transform/collect commands (inner)- M3->>M2: Return result- M2->>M2: Transform/collect commands- M2->>M1: Return result- M1->>M1: Transform/collect commands (outer)- M1->>Agent: _ComposedExtendedModelResponse with all commands+#### ModelRetryMiddleware++Automatically retries failed model calls with exponential backoff when transient errors (rate limits, API timeouts) occur.++**Features**:+- Custom exception filtering: retry on tuple of exception types or callable predicate+- Configurable on_failure behavior: `"continue"` returns error message, `"error"` re-raises, or custom callable formats error+- Exponential backoff with configurable factor and delays+- Optional jitter to avoid thundering herd+- Skips non-retryable exceptions and lets them propagate immediately++```python+from langchain.agents.middleware import ModelRetryMiddleware++# Retry rate limits and timeouts with exponential backoff+retry = ModelRetryMiddleware(+ max_retries=3,+ retry_on=(RateLimitError, APITimeoutError),+ backoff_factor=2.0,+ initial_delay=1.0,+ jitter=True,+ on_failure="continue", # Return error message instead of raising+)+```++#### ModelFallbackMiddleware++Wraps primary model with a fallback model (typically smaller/faster/cheaper) when primary fails.++#### ModelCallLimitMiddleware++Enforces maximum number of model calls per agent invocation, preventing runaway loops.++### Tool Execution Middleware++#### ToolErrorMiddleware++Converts tool execution exceptions into error `ToolMessage` objects sent back to the model, allowing recovery.++**Features**:+- `on_error` handler (sync) and `aon_error` handler (async) receive exception and `ToolCallRequest`+- Handler returns content (str or list of ContentBlock) to create error message, or None to propagate exception+- Opt-in by tool name: apply to specific tools or all tools+- Handles only tool execution exceptions; argument-binding errors are handled upstream+- Control-flow signals (interrupts, parent commands) always propagate++```python+from langchain.agents.middleware import ToolErrorMiddleware++def on_error(exc: Exception, request: ToolCallRequest) -> str | None:+ if isinstance(exc, ValueError):+ return f"Invalid argument for {request.tool_call['name']}: {exc}"+ return None # Propagate other exceptions++middleware = ToolErrorMiddleware(on_error=on_error)+```++#### ToolRetryMiddleware++Retries failed tool calls with configurable backoff and validation logic. Similar configuration to `ModelRetryMiddleware` but operates on tool execution.++```python+from langchain.agents.middleware import ToolRetryMiddleware++# Retry network errors for search tool only+retry = ToolRetryMiddleware(+ max_retries=3,+ tools=["search"],+ retry_on=(ConnectionError, TimeoutError),+ backoff_factor=1.5,+)+```++#### ToolCallLimitMiddleware++Prevents infinite tool loops by enforcing maximum tool calls per thread or per run.++**Features**:+- Track calls per tool name or globally+- Separate thread-level (persistent) and run-level (per invocation) limits+- Exit behaviors: `"continue"` blocks exceeded tools, `"error"` raises exception, `"end"` stops immediately with explanatory messages++```python+from langchain.agents.middleware.tool_call_limit import ToolCallLimitMiddleware++limiter = ToolCallLimitMiddleware(+ thread_limit=20, # Max 20 calls per thread+ run_limit=10, # Max 10 calls per run+ exit_behavior="end", # Stop with messages when exceeded+)+```++### Control Flow & Approval Middleware++#### HumanInTheLoopMiddleware++Pauses after model-requested tool calls and sends an interrupt for human review.++**Modes**:+- **Batched** (default): One interrupt per model turn with all tool calls listed+- **Per-call**: Interrupt for each tool call individually++**Features**:+- Constructs `ActionRequest` objects for each tool call+- Supports approval, editing, rejection, or human-answered decisions+- Approval: tool call proceeds unchanged+- Edit: human-provided arguments override model's+- Reject: blocks tool execution; model receives error message+- Respond: skips execution; returns synthetic ToolMessage with human's answer++```python+from langchain.agents.middleware import HumanInTheLoopMiddleware++hitl = HumanInTheLoopMiddleware(+ mode="batched", # One interrupt per model turn+ interrupt_on={+ "delete_file": True, # Require approval for all decisions+ "search": {+ "allowed_decisions": ["approve", "reject"], # Limit options+ "description": "Searching online databases",+ },+ }+)```-This diagram shows hook execution order and how commands accumulate through the stack.+### Data Transformation & Privacy Middleware++#### PIIMiddleware++Detects personally identifiable information in prompts, model responses, and tool outputs; optionally redacts or transforms it.++**Features**:+- Configurable detectors and redaction rules+- Detects PII before model sees it (in prompts)+- Redacts PII in model responses to user+- Tracks sensitive data for audit trails-### Middleware Stack Execution+#### ContextEditingMiddleware-When middleware is registered as `[M1, M2, M3]`:+Allows dynamic modification of agent context (system message, available tools) during execution based on state or runtime conditions.-**Model Call Stack**:-1. M1's `wrap_model_call` is entered first-2. M1 calls handler → M2's `wrap_model_call` is entered-3. M2 calls handler → M3's `wrap_model_call` is entered-4. M3 calls handler → actual model execution-5. M3 returns result to M2-6. M2 can transform result and returns to M1-7. M1 can transform result and returns to agent+#### FileSearchMiddleware-**Result**: Innermost middleware (M3, closest to model) executes first; outermost (M1) sees and can override all inner results.+Integrates file search capabilities, retrieving relevant documents before model calls.++### System Tools Middleware-### State Updates and Commands+#### ShellToolMiddleware-State updates from hooks are merged using LangGraph reducers. For the `messages` field (which uses `add_messages` reducer), updates accumulate rather than replace.+Provides controlled shell command execution with configurable resource limits, sandboxing, timeout enforcement, and output truncation.-**Command Accumulation**: When middleware returns `ExtendedModelResponse` with `Command`, multiple commands are accumulated in a list (inner-to-outer order). The agent applies them sequentially after the model node completes through the LangGraph state reducer system.+**Features**:+- Multiple sandboxing modes: host, Docker, Codex+- Resource limits: timeouts, output line limits, memory constraints+- Environment variable configuration+- Workspace isolation-**Reducer Semantics**:-- **Messages field**: Uses `add_messages` reducer, so messages in commands are **added** to the existing message list rather than replacing it.-- **Non-reducer fields**: Later commands overwrite earlier ones (outermost middleware wins). This means if multiple middleware return commands with state updates to the same field (other than `messages`), the outermost middleware's value takes precedence.+#### TodoListMiddleware-Example: If M1 and M3 both return commands with `{"status": "value"}`, M1's value (outermost) is used.+Adds persistent todo list management capability for multi-step task tracking.## Writing Custom Middleware### Simple Example: Logging Middleware```python-from langchain.agents.middleware import AgentMiddleware, ModelRequest, ModelResponse+from langchain.agents.middleware import AgentMiddlewareclass LoggingMiddleware(AgentMiddleware):def before_model(self, state, runtime):@@ -375,7 +497,7 @@ class LoggingMiddleware(AgentMiddleware):```pythonimport time-from langchain.agents.middleware import AgentMiddleware, ModelRequest, ModelResponse+from langchain.agents.middleware import AgentMiddleware, ModelResponsefrom langchain_core.messages import AIMessageclass CustomRetryMiddleware(AgentMiddleware):@@ -395,14 +517,14 @@ class CustomRetryMiddleware(AgentMiddleware):else:# Return error message instead of raisingreturn ModelResponse(- result=[AIMessage(content=f"Model call failed after {self.max_retries} retries: {e}")]+ result=[AIMessage(content=f"Model call failed: {e}")])```### Tool Argument Validation and Modification```python-from langchain.agents.middleware import AgentMiddleware, ToolCallRequest+from langchain.agents.middleware import AgentMiddlewarefrom langchain_core.messages import ToolMessageclass ArgumentValidationMiddleware(AgentMiddleware):@@ -410,7 +532,7 @@ class ArgumentValidationMiddleware(AgentMiddleware):tool_call = request.tool_callargs = tool_call["args"]- # Example: ensure all string args are lowercase for a search tool+ # Example: normalize string args to lowercase for search toolif tool_call["name"] == "search":args = {k: v.lower() if isinstance(v, str) else v for k, v in args.items()}request = request.override(tool_call={**tool_call, "args": args})@@ -421,21 +543,23 @@ class ArgumentValidationMiddleware(AgentMiddleware):### Conditional Tool Interception Based on State```python-from langchain.agents.middleware import AgentMiddleware, ToolCallRequest+from langchain.agents.middleware import AgentMiddleware+from langchain_core.messages import ToolMessageclass ConditionalToolMiddleware(AgentMiddleware):def wrap_tool_call(self, request, handler):- # Inspect agent statestate = request.state++ # Find the latest user messageuser_message = next((m.content for m in reversed(state["messages"]) if hasattr(m, "content")),None)- # Only allow certain tools if user explicitly requests them+ # Only allow search if user explicitly requests itif "search" not in user_message.lower() and request.tool_call["name"] == "search":return ToolMessage(- content="Search tool requires explicit user approval.",+ content="Search requires explicit user approval.",tool_call_id=request.tool_call["id"],name=request.tool_call["name"],status="error",@@ -454,8 +578,7 @@ class CommandReturningMiddleware(AgentMiddleware):def wrap_model_call(self, request, handler):response = handler(request)- # Middleware can return ExtendedModelResponse with a Command- # This command will be applied after the model node completes+ # Return ExtendedModelResponse with Command for additional state updatesreturn ExtendedModelResponse(model_response=response,command=Command(update={"custom_field": "custom_value"})@@ -468,9 +591,22 @@ Middleware can provide sync-only, async-only, or both implementations. The agent- Call sync versions (`wrap_model_call`, `wrap_tool_call`) in sync contexts (`stream()`, `invoke()`).- Call async versions (`awrap_model_call`, `awrap_tool_call`) in async contexts (`astream()`, `ainvoke()`).-- Raise `NotImplementedError` if the required implementation is missing for the execution path, with guidance to implement both versions or use async execution.+- Raise `NotImplementedError` if the required implementation is missing for the execution path, with guidance to implement both versions or use the appropriate execution mode.++**Best Practice**: Implement both versions unless the middleware is inherently async-only (uses async I/O).++```python+from langchain.agents.middleware import AgentMiddleware, ModelResponse-**Best Practice**: Implement both versions unless the middleware is inherently async-only (e.g., uses async I/O).+class DualImplementationMiddleware(AgentMiddleware):+ def wrap_model_call(self, request, handler):+ print("Sync wrap_model_call")+ return handler(request)++ async def awrap_model_call(self, request, handler):+ print("Async wrap_model_call")+ return await handler(request)+```## Integration with Agent Factory@@ -478,20 +614,24 @@ Middleware is passed to `create_agent()` as a list:```pythonfrom langchain.agents import create_agent-from langchain.agents.middleware import ModelRetryMiddleware, ToolErrorMiddleware, HumanInTheLoopMiddleware+from langchain.agents.middleware import (+ ModelRetryMiddleware,+ ToolErrorMiddleware,+ HumanInTheLoopMiddleware,+)agent = create_agent(model=ChatOpenAI(),tools=[search, calculator],middleware=[ModelRetryMiddleware(max_retries=2), # Outermost: retry model calls- ToolErrorMiddleware(on_error=my_error_handler), # Middle: handle tool errors+ ToolErrorMiddleware(on_error=my_handler), # Middle: handle tool errorsHumanInTheLoopMiddleware(interrupt_on={"delete": True}), # Innermost: approve risky tools],)```-**Composition Rule**: First in the list = outermost (highest priority for interception and response transformation). The factory collects middleware with wrap_model_call and awrap_model_call hooks, composes them into a single middleware stack via internal composition functions, establishing an order where the first middleware becomes the outermost layer. Commands from each layer are accumulated in inner-to-outer order and applied sequentially after model execution through LangGraph's reducer-based state system.+**Composition Rule**: First in the list = outermost (highest priority for interception and response transformation). The factory collects middleware with `wrap_model_call` hooks, composes them into a single middleware stack, establishing an order where the first middleware becomes the outermost layer. Commands from each layer are accumulated in inner-to-outer order and applied sequentially after model execution through LangGraph's reducer-based state system.## Tracing and Observability@@ -504,7 +644,7 @@ from langchain.agents.middleware import TracePolicy, omit_payloadclass MyMiddleware(AgentMiddleware):trace_policy = TracePolicy(process_inputs=omit_payload)- # Omit input payloads from traces to reduce noise, keep spans and timing+ # Omit input payloads from traces, keep spans and timing```### Hook Naming in Traces@@ -516,7 +656,7 @@ Middleware hooks are automatically named in trace spans as `{middleware_name}.{h### ✅ Good Patterns1. **Immutable Requests**: Use `request.override()` instead of mutating fields.-2. **Opt-in Error Handling**: Return `None` from error handlers to propagate exceptions (don't silently swallow).+2. **Opt-in Error Handling**: Return `None` from error handlers to propagate exceptions; don't silently swallow errors.3. **State-Driven Decisions**: Use `request.state` and `runtime` to make decisions; avoid global state.4. **Clear Composition Order**: Document which middleware should run first, especially when order matters (e.g., retry before error handling).5. **Fallback Behavior**: Implement sync and async versions to support both execution paths.@@ -533,7 +673,7 @@ Middleware hooks are automatically named in trace spans as `{middleware_name}.{h## Key Invariants and Lifecycle-- **Immutability**: `ModelRequest` and `ToolCallRequest` follow an immutable pattern; use override/replace methods.+- **Immutability**: `ModelRequest` and `ToolCallRequest` follow an immutable pattern; use `override()` or `replace()` methods.- **Execution Order**: Middleware runs in registration order (first = outermost). Multiple calls within a middleware (retries) do not reorder subsequent middleware.- **State Reducer Semantics**: State updates via dict returns merge using reducer semantics. Messages accumulate via `add_messages`; non-reducer fields are overwritten by the most recent update.- **Command Flow**: `ExtendedModelResponse` commands are collected (inner-to-outer) and applied after the model node completes through LangGraph reducers.@@ -544,4 +684,4 @@ Middleware hooks are automatically named in trace spans as `{middleware_name}.{h- [Agent Execution Flow and Loop Control](/openwiki/agent-execution.md) – Detailed description of the agent loop, state management, and where middleware hooks are invoked.- [Agent Factory and Graph Construction](/openwiki/agent-factory.md) – How the agent graph is built, including middleware integration and handler composition.-- [Tools](/openwiki/tools.md) – Tool definition, registration, and execution context.+- [Composability: Building Complex Agents](/openwiki/composability.md) – Patterns for composing agents through middleware layers and subagent delegation.diff --git a/openwiki/model-initialization.md b/openwiki/model-initialization.mdindex b45e224c00..11c89513fb 100644--- a/openwiki/model-initialization.md+++ b/openwiki/model-initialization.md@@ -9,7 +9,7 @@ sources:generated: { by: "openwiki/0.5.0", at: "2026-09-28T08:35:20.640Z" }verified:- by: openwiki/0.5.0- at: 2026-09-28T08:35:20.640Z+ at: 2026-10-20T08:25:57.412Z---## Overviewdiff --git a/openwiki/openai-provider.md b/openwiki/openai-provider.mdindex 20a8ebed7c..c02f09c711 100644--- a/openwiki/openai-provider.md+++ b/openwiki/openai-provider.md@@ -19,7 +19,7 @@ sources:generated: { by: "openwiki/0.5.0", at: "2026-10-16T08:25:55.096Z" }verified:- by: openwiki/0.5.0- at: 2026-10-16T08:25:55.096Z+ at: 2026-10-20T08:25:57.412Z---## Overviewdiff --git a/openwiki/partner-pattern.md b/openwiki/partner-pattern.mdindex 9c4510c8b7..82ded79800 100644--- a/openwiki/partner-pattern.md+++ b/openwiki/partner-pattern.md@@ -3,6 +3,9 @@ type: Integration Patterntitle: Adding a New Chat Model Providerdescription: Step-by-step guide to integrate a new LLM provider into LangChain's monorepo, including package structure, ChatModel implementation, streaming, function calling, structured output, and standard tests. Covers message conversion, error handling, model profiles, and optional advanced API modes like Responses API.tags: [chat-models, provider-integration, llm, function-calling, structured-output, streaming]+verified:+ - by: openwiki/0.5.0+ at: 2026-10-20T08:25:57.412Zsources:- id: openwiki-source-c52037e7b642f7ac5a7642a8resource: repo://libs/core/langchain_core/language_models/chat_models.py@@ -36,10 +39,7 @@ sources:resource: repo://libs/partners/openai/tests/unit_tests/chat_models/test_responses_standard.py- id: openwiki-source-025cad4ae99967890152b7e0resource: repo://libs/standard-tests/README.md-generated: { by: "openwiki/0.5.0", at: "2026-09-22T08:27:06.345Z" }-verified:- - by: openwiki/0.5.0- at: 2026-10-16T08:25:55.096Z+generated: { by: "openwiki/0.5.0", at: "2026-10-20T08:25:57.412Z" }---## Overview@@ -94,7 +94,7 @@ Create a new directory under `/libs/partners/` with the provider name in lowerca### Package Metadata (pyproject.toml)-Key configuration for a provider package (reference: `/libs/partners/openai/pyproject.toml#L1-L76`):+Key configuration for a provider package (reference: `repo://libs/partners/openai/pyproject.toml`, `repo://libs/partners/anthropic/pyproject.toml`):```toml[build-system]@@ -108,7 +108,7 @@ requires-python = ">=3.10.0,<4.0.0"version = "0.1.0"dependencies = [- "langchain-core>=1.6.2,<2.0.0", # Required: base LangChain+ "langchain-core>=1.6.10,<2.0.0", # Required: base LangChain (current minimum)"provider-client-library>=2.45.0,<4.0.0", # Provider's own SDK (pinned version)"certifi>=2024.6.2", # SSL certificates]@@ -139,7 +139,7 @@ constraint-dependencies = ["urllib3>=2.6.3", "pygments>=2.20.0"]```**Key patterns:**-- **Lock provider SDK versions** to prevent breaking API changes (e.g., `openai>=2.45.0,<4.0.0`)+- **Lock provider SDK versions** to prevent breaking API changes (e.g., `openai>=2.45.0,<4.0.0`, `anthropic>=0.120.0,<2.0.0`)- **Add version constraints to all test dependencies** for reproducibility- **Use `[tool.uv.sources]`** to reference local LangChain packages in monorepo- **Separate integration test dependencies** in a dedicated group (only needed in CI)@@ -148,15 +148,16 @@ constraint-dependencies = ["urllib3>=2.6.3", "pygments>=2.20.0"]### BaseChatModel and Core Requirements-All provider implementations must inherit from **`BaseChatModel`** (`repo://libs/core/langchain_core/language_models/chat_models.py#L284-L2400`), which defines the contract for invoking and streaming chat models.+All provider implementations must inherit from **`BaseChatModel`** (defined in `repo://libs/core/langchain_core/language_models/chat_models.py#L284-L2400`), which defines the contract for invoking and streaming chat models.-**Core responsibilities** (location: `repo://libs/partners/anthropic/langchain_anthropic/chat_models.py#L1-L150`):+**Core responsibilities:**1. **Inherit `BaseChatModel`** with type parameter `[AIMessage]`-2. **Implement `_generate` method** (required sync): Transform messages into `ChatResult` with `ChatGeneration` objects wrapping `AIMessage` output+2. **Implement `_generate` method** (required): Transform messages into `ChatResult` with `ChatGeneration` objects wrapping `AIMessage` output3. **Implement `_stream` method** (optional for streaming support): Yield `ChatGenerationChunk` objects containing `AIMessageChunk` with incremental tokens-4. **Implement `_agenerate` method** (async variant of `_generate`) or `_astream` method (async variant of `_stream`)+4. **Implement `_agenerate` or `_astream` method** (async variants): Provide native async support using `async def`5. **Set `_llm_type` property**: Return the provider identifier string for identification+6. **Optional: Implement token counting methods** (`get_num_tokens`, `get_num_tokens_from_messages`) for accurate token accounting### Minimal ChatModel Template@@ -164,7 +165,7 @@ All provider implementations must inherit from **`BaseChatModel`** (`repo://libs"""Provider chat model integration."""from typing import Any, Iterator-from langchain_core.callbacks import CallbackManagerForLLMRun+from langchain_core.callbacks import AsyncCallbackManagerForLLMRun, CallbackManagerForLLMRunfrom langchain_core.language_models import LanguageModelInputfrom langchain_core.language_models.chat_models import BaseChatModelfrom langchain_core.messages import AIMessage, BaseMessage@@ -272,6 +273,7 @@ class ChatProviderModel(BaseChatModel):accumulated_content += delta.content# 4. Yield chunk with incremental token+ from langchain_core.messages import AIMessageChunkchunk_message = AIMessageChunk(content=delta.content)chunk = ChatGenerationChunk(message=chunk_message)@@ -281,6 +283,60 @@ class ChatProviderModel(BaseChatModel):yield chunk+ async def _agenerate(+ self,+ messages: list[BaseMessage],+ stop: list[str] | None = None,+ run_manager: AsyncCallbackManagerForLLMRun | None = None,+ **kwargs: Any,+ ) -> ChatResult:+ """Async variant of _generate using native async/await."""+ payload = self._build_payload(messages, stop=stop, **kwargs)+ response = await self._async_client.chat.completions.create(**payload)+ return self._create_chat_result(response)++ async def _astream(+ self,+ messages: list[BaseMessage],+ stop: list[str] | None = None,+ run_manager: AsyncCallbackManagerForLLMRun | None = None,+ **kwargs: Any,+ ):+ """Async streaming variant of _stream."""+ payload = self._build_payload(messages, stop=stop, stream=True, **kwargs)+ async for event in await self._async_client.chat.completions.create(**payload):+ delta = event.choices[0].delta+ if delta.content:+ from langchain_core.messages import AIMessageChunk+ chunk_message = AIMessageChunk(content=delta.content)+ chunk = ChatGenerationChunk(message=chunk_message)+ if run_manager:+ await run_manager.on_llm_new_token(delta.content, chunk=chunk)+ yield chunk++ def get_num_tokens(self, text: str) -> int:+ """Count tokens in text using provider-specific tokenizer (optional).++ Override this method if the provider has a specific tokenizer.+ Falls back to base implementation if not overridden.+ """+ # Example: Use tiktoken for OpenAI models+ # if self.model.startswith("gpt-"):+ # return len(encoding.encode(text))+ return super().get_num_tokens(text)++ def get_num_tokens_from_messages(+ self, messages: list[BaseMessage], tools: list[dict] | None = None+ ) -> int:+ """Count tokens in messages using provider-specific accounting (optional).++ This is more accurate than sum of individual token counts because+ providers add overhead per message, role markers, etc.+ """+ # Example: Custom token counting logic+ # return sum(self._count_tokens(m) for m in messages)+ return super().get_num_tokens_from_messages(messages, tools=tools)+def _convert_messages_to_provider_format(self, messages: list[BaseMessage]) -> list[dict[str, Any]]:@@ -297,7 +353,7 @@ class ChatProviderModel(BaseChatModel):### Message Conversion and Content Blocks-LangChain messages have a **unified, provider-agnostic content format** using **content blocks** (reference: `/openwiki/messages.md`). Each provider must translate between this format and its own API schema on both input and output.+LangChain messages have a **unified, provider-agnostic content format** using **content blocks**. Each provider must translate between this format and its own API schema on both input and output.**Key message fields:**@@ -330,9 +386,7 @@ LangChain messages have a **unified, provider-agnostic content format** using **- Populate `usage_metadata` (input/output token counts)- Store provider-specific metadata in `response_metadata`-**Example: Message conversion (Anthropic reference):**--The Anthropic provider converts both input and output (reference: `repo://libs/partners/anthropic/langchain_anthropic/chat_models.py#L1-L150`):+**Example: Message conversion input (Anthropic reference, from `repo://libs/partners/anthropic/langchain_anthropic/chat_models.py`):**```pythondef _convert_messages_to_provider_format(@@ -387,7 +441,7 @@ After receiving a response from the provider API, convert it back to LangChain's4. **Populate metadata** - Capture usage info and provider-specific response metadata5. **Create AIMessage** - Construct the output message with all components-**Example: OpenAI response conversion** (reference: `repo://libs/partners/openai/langchain_openai/chat_models/base.py#L217-L282`):+**Example: OpenAI response conversion (reference: `repo://libs/partners/openai/langchain_openai/chat_models/base.py#L217-L282`, `repo://libs/partners/openai/langchain_openai/chat_models/base.py#L404-L483`):**```pythonfrom langchain_core.messages import AIMessage, UsageMetadata@@ -461,7 +515,7 @@ Streaming returns `AIMessageChunk` objects incrementally as the model generates5. **Wrap in `ChatGenerationChunk`** for the generation abstraction6. **Notify run_manager** via `on_llm_new_token` callback for observability-**Key pattern** (Anthropic reference: `repo://libs/partners/anthropic/langchain_anthropic/chat_models.py#L1862-L1910`):+**Key pattern (from `repo://libs/partners/anthropic/langchain_anthropic/chat_models.py#L1862-L1910`):**```pythondef _stream(@@ -520,30 +574,82 @@ async def _astream(### Function Calling / Tool Use-Implement `bind_tools()` (inherited from `BaseChatModel`) to support tool calling. Tools are converted to the provider's schema (OpenAI, Anthropic, JSON Schema, etc.) before sending to the API. The model response includes tool calls, which are extracted and populated in `AIMessage.tool_calls`.+Implement `bind_tools()` to support tool calling. This is inherited from `BaseChatModel` but providers may override it to customize tool schema conversion. Tools are converted to the provider's schema before sending to the API, and the model response includes tool calls which are extracted and populated in `AIMessage.tool_calls`.-**Implementation approach:**+**Implementation approach (from `repo://libs/partners/openai/langchain_openai/chat_models/base.py#L2507-L2600`):**-1. **Accept `BaseTool` objects, Pydantic models, or dicts** via `bind_tools()`+1. **Accept `BaseTool` objects, Pydantic models, or dicts** via `bind_tools(tools, tool_choice=...)`2. **Convert to provider schema** using utility functions:- `convert_to_openai_tool()` - For OpenAI-compatible APIs- `convert_to_json_schema()` - For JSON Schema format- Provider-specific converters for custom formats-3. **Include tools in API request** as part of the payload-4. **Parse tool calls** from the response into `ToolCall` objects+3. **Include tools in API request** as part of the payload (with optional tool_choice constraint)+4. **Parse tool calls** from the response into `ToolCall` objects with `id`, `name`, `args` fields5. **Handle invalid/malformed tool calls** by storing them in `invalid_tool_calls`+**Example: bind_tools signature:**++```python+def bind_tools(+ self,+ tools: Sequence[dict[str, Any] | type | Callable | BaseTool],+ *,+ tool_choice: dict | str | bool | None = None,+ **kwargs: Any,+) -> Runnable[LanguageModelInput, AIMessage]:+ """Bind tool-like objects to this chat model.++ Args:+ tools: A list of tool definitions.+ tool_choice: Which tool to require (e.g., 'auto', 'required', tool name).+ **kwargs: Additional provider-specific parameters.++ Returns:+ A Runnable that includes tools in all invocations.+ """+ # Convert tools to provider format+ formatted_tools = [convert_to_openai_tool(tool) for tool in tools]++ # Return bound runnable with tools in kwargs+ return self.bind(tools=formatted_tools, tool_choice=tool_choice, **kwargs)+```+### Structured OutputImplement `with_structured_output()` to enforce the model to return responses matching a Pydantic model or JSON schema. This typically maps to the provider's structured output or JSON mode feature.-**Pattern:**+**Pattern (from `repo://libs/partners/anthropic/langchain_anthropic/chat_models.py#L2866-L2950`):**-1. Accept a Pydantic model or JSON schema-2. Convert to provider's structured output format-3. Include in API request-4. Parse response and validate against schema-5. Return parsed model instance or dict+```python+def with_structured_output(+ self,+ schema: dict | type,+ *,+ include_raw: bool = False,+ method: Literal["function_calling", "json_schema"] = "function_calling",+ **kwargs: Any,+) -> Runnable[LanguageModelInput, dict | BaseModel]:+ """Model wrapper that returns outputs formatted to match the given schema.++ Args:+ schema: The output schema (Pydantic model, dict, or JSON schema).+ include_raw: If True, return both raw and parsed output.+ method: Which structured output method to use.+ **kwargs: Additional parameters.++ Returns:+ A Runnable that outputs instances of the schema or dicts.+ """+ # Convert schema to provider format+ provider_schema = convert_to_provider_schema(schema, method=method)++ # Create a wrapper runnable that:+ # 1. Calls the model with the schema+ # 2. Parses the response+ # 3. Validates against the schema+ # 4. Returns parsed instance or dict+ return self._create_structured_output_runnable(provider_schema, schema)+```### Vision / Multimodal Input@@ -556,7 +662,7 @@ Translate these to provider-specific formats (e.g., OpenAI's `image_url`, Anthro## 5. Provider Registration in init_chat_model-Add your provider to the **built-in registry** to enable automatic factory instantiation (`repo://libs/langchain_v1/langchain/chat_models/base.py#L56-L97`):+Add your provider to the **built-in registry** to enable automatic factory instantiation (from `repo://libs/langchain_v1/langchain/chat_models/base.py#L56-L99`):```python_BUILTIN_PROVIDERS: dict[str, tuple[str, str, Callable[..., BaseChatModel]]] = {@@ -603,7 +709,7 @@ Add your provider's prefixes to the inference function to enable bare model nameProfiles are dictionaries stored in `data/_profiles.py` and generated from the open-source [models.dev](https://github.com/sst/models.dev) project via the `langchain-model-profiles` CLI tool.-**Sample profile** (reference: `repo://libs/partners/anthropic/langchain_anthropic/data/_profiles.py#L18-L52`):+**Sample profile (from `repo://libs/partners/anthropic/langchain_anthropic/data/_profiles.py#L18-L90`):**```python_PROFILES: dict[str, dict[str, Any]] = {@@ -642,7 +748,7 @@ This downloads the latest model data, merges provider-specific augmentations fro### Provider Augmentations-Create `data/profile_augmentations.toml` for LangChain-specific capability overrides (reference: `repo://libs/partners/anthropic/langchain_anthropic/data/profile_augmentations.toml`):+Create `data/profile_augmentations.toml` for LangChain-specific capability overrides (from `repo://libs/partners/anthropic/langchain_anthropic/data/profile_augmentations.toml`):```tomlprovider = "provider_name"@@ -664,7 +770,7 @@ LangChain provides a standard test suite for chat models via the `langchain-test### Unit Tests-Create `tests/unit_tests/chat_models/test_standard.py` (reference: `/libs/standard-tests/README.md`):+Create `tests/unit_tests/chat_models/test_standard.py` (from `repo://libs/standard-tests/README.md`):```python"""Standard LangChain interface tests for ChatProviderModel."""@@ -697,7 +803,7 @@ class TestProviderModelStandard(ChatModelUnitTests):}```-**Configurable test fixtures** (from `langchain-tests` README):+**Configurable test fixtures (from `repo://libs/standard-tests/README.md#L38-L93`):**- `chat_model_class` (required): The `BaseChatModel` subclass to test- `chat_model_params`: Kwargs for instantiation (defaults to empty dict)@@ -751,7 +857,7 @@ The standard test suite validates:If your provider supports advanced response modes (e.g., OpenAI's Responses API), create additional test classes for those modes:-**Example: Responses API unit tests** (reference: `repo://libs/partners/openai/tests/unit_tests/chat_models/test_responses_standard.py`):+**Example: Responses API unit tests (from `repo://libs/partners/openai/tests/unit_tests/chat_models/test_responses_standard.py`):**```python"""Standard tests with Responses API enabled."""@@ -791,7 +897,7 @@ Integration tests for advanced modes should verify:Some providers (e.g., OpenAI) offer advanced response APIs alongside standard chat completions. These APIs typically support enhanced features like streaming tool execution, reasoning outputs, and structured response formats.-**Example: OpenAI Responses API** (reference: `/openwiki/openai-provider.md`, `repo://libs/partners/openai/tests/integration_tests/chat_models/test_responses_api.py`):+**Example: OpenAI Responses API (from `repo://libs/partners/openai/tests/integration_tests/chat_models/test_responses_api.py`):**The `ChatOpenAI` provider supports an optional `use_responses_api` parameter to switch between the Chat Completions API and the Responses API:@@ -824,7 +930,7 @@ response = model.invoke("What is the capital of France?")**Message conversion for Responses API:**-Provider implementations must convert Responses API output (which includes tool execution results, reasoning, and other structured items) back to unified `AIMessage` format. The OpenAI provider uses `_convert_from_v1_to_responses()` (reference: `repo://libs/partners/openai/langchain_openai/chat_models/_compat.py#L420-L514`) to translate content blocks:+Provider implementations must convert Responses API output (which includes tool execution results, reasoning, and other structured items) back to unified `AIMessage` format. The OpenAI provider uses `_convert_from_v1_to_responses()` (from `repo://libs/partners/openai/langchain_openai/chat_models/_compat.py#L431-L515`) to translate content blocks:```python# Responses API returns:@@ -847,7 +953,7 @@ Provider implementations must convert Responses API output (which includes tool## 9. Error Handling-Map provider-specific exceptions to LangChain's unified exception hierarchy (reference: `repo://libs/partners/openai/langchain_openai/chat_models/base.py#L54-L64`):+Map provider-specific exceptions to LangChain's unified exception hierarchy (from `repo://libs/partners/openai/langchain_openai/chat_models/base.py#L54-L64`):| Provider Exception | LangChain Exception ||---|---|@@ -874,7 +980,7 @@ def _generate(self, messages, **kwargs):## 10. Example: OpenAI Provider Reference-The OpenAI provider (`repo://libs/partners/openai/langchain_openai/chat_models/base.py`) is a comprehensive reference implementation demonstrating:+The OpenAI provider (from `repo://libs/partners/openai/langchain_openai/chat_models/base.py`) is a comprehensive reference implementation demonstrating:- **Message conversion**: Support for images, function calling, reasoning content- **Streaming**: Proper delta extraction and token counting@@ -920,6 +1026,7 @@ pytest tests/integration_tests/- [ ] Parse and convert provider responses to `AIMessage`/`AIMessageChunk`- [ ] Implement `bind_tools()` for function calling (if supported)- [ ] Implement `with_structured_output()` for structured output (if supported)+- [ ] Implement token counting methods (optional but recommended)- [ ] Map provider exceptions to LangChain exception hierarchy- [ ] Fetch and store model profiles via `langchain-model-profiles` CLI- [ ] Add provider to `_BUILTIN_PROVIDERS` registry in `init_chat_model`@@ -933,6 +1040,6 @@ pytest tests/integration_tests/- [Chat Models Interface](/openwiki/chat-models.md) - Core chat model protocol- [Message Types](/openwiki/messages.md) - Message abstraction and content blocks-- [Model Initialization](/openwiki/model-initialization.md) - `init_chat_model` factory details+- [Integration Tests](/openwiki/integration-tests.md) - Standard test suite details- [OpenAI Provider](/openwiki/openai-provider.md) - Reference implementation- [LangChain Integrations Documentation](https://docs.langchain.com/oss/python/integrations/providers/overview) - User-facing guidediff --git a/openwiki/prompts.md b/openwiki/prompts.mdindex 8361c5eb5d..42b67b3dbf 100644--- a/openwiki/prompts.md+++ b/openwiki/prompts.md@@ -1,8 +1,8 @@---type: "Concept"-title: "Prompt Templates and Few-Shot Learning"-description: "Prompt templates define message sequences and variable substitution patterns for chat models. Few-shot learning selects examples dynamically to teach models by example."-tags: [prompt, template, few-shot, example-selection, variable-substitution, structured-output]+title: "Prompts: Templates & Composition"+description: "Prompt templates define message sequences and variable substitution patterns for language models. Covers template syntax, PromptValue routing, runnable integration, and few-shot learning with dynamic example selection."+tags: [prompt, template, few-shot, variable-substitution, runnable, composition, chat-model]sources:- id: openwiki-source-1f4e0a5b877db4f050f2a34cresource: repo://libs/core/langchain_core/example_selectors/base.py@@ -10,6 +10,8 @@ sources:resource: repo://libs/core/langchain_core/example_selectors/length_based.py- id: openwiki-source-5e027af8cc764d2750129cf1resource: repo://libs/core/langchain_core/example_selectors/semantic_similarity.py+ - id: openwiki-source-269af2bb49a21bd6c548b3f0+ resource: repo://libs/core/langchain_core/prompt_values.py- id: openwiki-source-03d7415879ed05a392edd62dresource: repo://libs/core/langchain_core/prompts/base.py- id: openwiki-source-15fdd645c1ee76ae559799c1@@ -22,10 +24,10 @@ sources:resource: repo://libs/core/langchain_core/prompts/string.py- id: openwiki-source-204b5e61a019044332bd2dd4resource: repo://libs/core/langchain_core/prompts/structured.py-generated: { by: "openwiki/0.5.0", at: "2026-09-03T15:18:34.589Z" }+generated: { by: "openwiki/0.5.0", at: "2026-10-20T08:25:57.412Z" }verified:- by: openwiki/0.5.0- at: 2026-09-28T08:35:20.640Z+ at: 2026-10-20T08:25:57.412Z---## Overview@@ -34,11 +36,38 @@ LangChain's **prompt templating system** provides a flexible, composable way to## Fundamental Concepts-### Prompt Types+### Prompt Types and PromptValue Output-LangChain provides two main categories of prompts:+All prompts inherit from `BasePromptTemplate`, which extends `RunnableSerializable[dict[str, Any], PromptValue]`. When a prompt is invoked (via `invoke()` or `format_prompt()`), it returns a **PromptValue**—an abstract base type that encodes the formatted output in either string or message form:-#### PromptTemplate (StringPromptTemplate)+- **`StringPromptValue`**: Wraps a single formatted string. Has `to_string()` and `to_messages()` (which wraps the string as a HumanMessage).+- **`ChatPromptValue`**: Wraps a sequence of `BaseMessage` objects. Has `to_string()` (concatenates messages as a buffer) and `to_messages()` (returns messages as-is).+- **`ChatPromptValueConcrete`**: Explicit variant of `ChatPromptValue` for external schemas and serialization.++This dual representation enables **prompt routing**: a string template can be converted to a chat format by calling `to_messages()`, and vice versa. This allows downstream components (models, chains) to accept either representation flexibly.++```python+from langchain_core.prompts import PromptTemplate, ChatPromptTemplate+from langchain_core.prompt_values import StringPromptValue, ChatPromptValue++# String prompt returns StringPromptValue+string_prompt = PromptTemplate.from_template("Say {text}")+result = string_prompt.invoke({"text": "hello"})+assert isinstance(result, StringPromptValue)+assert result.to_string() == "Say hello"+assert result.to_messages()[0].content == "Say hello"++# Chat prompt returns ChatPromptValue+chat_prompt = ChatPromptTemplate.from_messages([+ ("system", "You are helpful"),+ ("human", "{input}"),+])+result = chat_prompt.invoke({"input": "hello"})+assert isinstance(result, ChatPromptValue)+assert len(result.to_messages()) == 2+```++### PromptTemplate (StringPromptTemplate)A `PromptTemplate` wraps a single string template with variable placeholders. The template is formatted using one of three engines:@@ -76,7 +105,7 @@ prompt = PromptTemplate(result = prompt.format(topic="AI") # name is already set```-#### ChatPromptTemplate+### ChatPromptTemplateA `ChatPromptTemplate` sequences message prompt templates into a conversation structure. Each message has a role (system, human, ai, tool, etc.) and content. This aligns with the message-based API of chat models like GPT-4 and Claude.@@ -114,6 +143,19 @@ Supported message types in the shorthand syntax:- `invoke(dict)`: Runnable interface, returns `ChatPromptValue` containing formatted messages.- `format(**kwargs)`: Converts message list to a single string (useful for debugging or non-chat APIs).+**Input Variables and Composition:**+`ChatPromptTemplate` automatically infers `input_variables` and `optional_variables` from its messages during initialization. When a `ChatPromptTemplate` has exactly **one** input variable, the `invoke()` method accepts a non-dict argument directly, auto-wrapping it:++```python+template = ChatPromptTemplate.from_messages([+ ("system", "You are a bot."),+ ("human", "{input}"),+])+# Both are equivalent:+result1 = template.invoke({"input": "Hello!"})+result2 = template.invoke("Hello!") # Auto-wraps as {"input": "Hello!"}+```+#### MessagesPlaceholderA `MessagesPlaceholder` injects a pre-formatted list of messages at a specific point in the prompt. This is essential for maintaining conversation history.@@ -138,9 +180,14 @@ result = template.invoke({# Messages: [system, human, ai, human]```-The `optional=True` flag allows the placeholder to be omitted from inputs; if not provided, an empty list is substituted. The `n_messages` parameter limits how many recent messages are included (useful for token budgets).+The `optional=True` flag allows the placeholder to be omitted from inputs; if not provided, an empty list is substituted. Optional placeholders are tracked in `optional_variables` and automatically populated with `[]` as partial defaults. The `n_messages` parameter limits how many recent messages are included (useful for token budgets):-### Template Variable Substitution+```python+# Keep only the last 2 messages+placeholder = MessagesPlaceholder("history", n_messages=2)+```++### Template Variable Substitution and Partial ApplicationPrompts automatically detect variable names from template syntax and require them at format time.@@ -166,16 +213,61 @@ output = partial_prompt.format(question="How are you?")# Only 'question' is required now```-When a prompt has exactly **one** input variable, the template can accept a non-dict argument directly:+The `partial()` method returns a **new immutable instance** without mutating the original:```python-template = ChatPromptTemplate.from_messages([- ("system", "You are a bot."),- ("human", "{input}"),+original = PromptTemplate.from_template("Say {text}")+partial = original.partial(text="hello")++# original is unchanged+print(original.input_variables) # ['text']+print(partial.input_variables) # []+```++Partial variables support **lazy evaluation**: if a partial value is callable, it is invoked at format time:++```python+import time+prompt = PromptTemplate(+ template="Time: {timestamp}",+ partial_variables={"timestamp": lambda: time.time()}+)+# timestamp is evaluated fresh each time+print(prompt.format())+print(prompt.format()) # Different timestamps+```++## Prompt Composition++Prompts compose via the `+` operator, merging messages and variables.++```python+from langchain_core.prompts import ChatPromptTemplate++system = ChatPromptTemplate.from_messages([+ ("system", "You are a helpful assistant. Your name is {bot_name}."),])-result = template.invoke("Hello!") # Auto-wraps as {"input": "Hello!"}++conversation = ChatPromptTemplate.from_messages([+ ("human", "{user_input}"),+])++combined = system + conversation+# Equivalent to:+# ChatPromptTemplate([+# ("system", "You are a helpful assistant. Your name is {bot_name}."),+# ("human", "{user_input}"),+# ])++result = combined.invoke({"bot_name": "Alice", "user_input": "Hello!"})```+**Rules:**+- When combining `ChatPromptTemplate` instances, messages are concatenated.+- Input variables from both templates are merged.+- Partial variables are merged; conflicting keys raise an error.+- For `PromptTemplate`, both must have compatible formats (both f-string, both mustache, etc.); templates are concatenated with input variables merged.+## Few-Shot Prompt TemplatesFew-shot learning teaches models by providing input-output examples before the user's actual query. LangChain provides two patterns: one for string prompts and one for chat-based prompts.@@ -286,6 +378,12 @@ class BaseExampleSelector:def select_examples(self, input_variables: dict[str, str]) -> list[dict[str, Any]]:"""Select which examples to use based on inputs."""++ async def aadd_example(self, example: dict[str, str]) -> Any:+ """Async variant of add_example."""++ async def aselect_examples(self, input_variables: dict[str, str]) -> list[dict[str, Any]]:+ """Async variant of select_examples."""```### SemanticSimilarityExampleSelector@@ -439,90 +537,54 @@ print(result)- `stream(dict)`: Streaming mode (rarely used for prompts, more common downstream).- `batch(list[dict])`: Batch formatting multiple inputs.-## Prompt Composition--Prompts compose via the `+` operator, merging messages and variables.+**Metadata and Configuration:**+Prompts support tracing and observability via configuration:```python-from langchain_core.prompts import ChatPromptTemplate--system = ChatPromptTemplate.from_messages([- ("system", "You are a helpful assistant. Your name is {bot_name}."),-])--conversation = ChatPromptTemplate.from_messages([- ("human", "{user_input}"),+template = ChatPromptTemplate.from_messages([+ ("system", "You are helpful."),+ ("human", "{input}"),])-combined = system + conversation-# Equivalent to:-# ChatPromptTemplate([-# ("system", "You are a helpful assistant. Your name is {bot_name}."),-# ("human", "{user_input}"),-# ])+# Add metadata for tracing+template_with_metadata = template.with_config({+ "metadata": {"version": "1.0"},+ "tags": ["important"],+})-result = combined.invoke({"bot_name": "Alice", "user_input": "Hello!"})+result = template_with_metadata.invoke({"input": "hello"})+# The invoke is traced with the given metadata```-**Rules:**-- When combining `ChatPromptTemplate` instances, messages are concatenated.-- Input variables from both templates are merged.-- Partial variables are merged; conflicting keys raise an error.-- Templates must have compatible formats (both f-string, both mustache, etc.).--## Prompt Loading from Files+Metadata and tags are propagated to LangSmith and other observability backends, enabling debugging and performance analysis.-**Note:** Prompt serialization and loading via the old `save()` / `load_prompt_from_config()` API is deprecated in favor of using `dumpd()` / `loads()` from `langchain_core.load`.+## Prompt Loading and Serialization-To load a prompt from a JSON or YAML file, use the modern LangChain serialization API:+Prompts support serialization and deserialization via LangChain's modern `langchain_core.load` API.```python-from langchain_core.load import loads+from langchain_core.load import loads, dumpdimport json-with open("prompt.json") as f:- prompt_dict = json.load(f)--prompt = loads(prompt_dict)-# Returns a deserialized PromptTemplate or ChatPromptTemplate-```--Prompts can be serialized to JSON using `dumpd()` from `langchain_core.load`, enabling version control and sharing:--```python-from langchain_core.load import dumpd+# Serialize a prompt to a dictionaryfrom langchain_core.prompts import ChatPromptTemplate-prompt = ChatPromptTemplate.from_messages([("system", "You are helpful."),("human", "{input}"),])-prompt_dict = dumpd(prompt)-# Contains nested structure compatible with loads()-```--## Integration with Agent Factory-Prompts are a core input to the **Agent Factory** (`create_agent`), providing the conversational context for agent reasoning and tool use.+# Save to JSON+with open("prompt.json", "w") as f:+ json.dump(prompt_dict, f)-```python-from langchain.agents import create_agent-from langchain_core.prompts import ChatPromptTemplate--system_template = ChatPromptTemplate.from_messages([- ("system", "You are a helpful weather assistant."),-])--# Or use a simple string-agent = create_agent(- model="openai:gpt-4o",- tools=[weather_tool],- system_prompt="You are a helpful weather assistant."-)+# Load from JSON+with open("prompt.json") as f:+ prompt_dict = json.load(f)+prompt = loads(prompt_dict)```-The agent factory internally compiles prompts with the model and tool bindings, managing message flow through the state machine. Middleware can intercept and modify prompts before model invocation via the `wrap_model_call` hook, enabling use cases like prompt optimization or safety filters.+**Note:** The older `save()` / `load_prompt_from_config()` API is deprecated. Use `dumpd()` / `loads()` for new code.## Security Considerations@@ -573,24 +635,24 @@ print(partial.input_variables) # []This immutability enables safe composition and caching in pipelines.-## Observability and Tracing+## Integration with Agents-All prompts support LangChain's standard tracing and observability hooks:+Prompts are a core input to the **Agent Factory** (`create_agent`), providing the conversational context for agent reasoning and tool use.```python-template = ChatPromptTemplate.from_messages([- ("system", "You are helpful."),- ("human", "{input}"),-])+from langchain.agents import create_agent+from langchain_core.prompts import ChatPromptTemplate-# Add metadata for tracing-template_with_metadata = template.with_config({- "metadata": {"version": "1.0"},- "tags": ["important"],-})+system_template = ChatPromptTemplate.from_messages([+ ("system", "You are a helpful weather assistant."),+])-result = template_with_metadata.invoke({"input": "hello"})-# The invoke is traced with the given metadata+# Or use a simple string+agent = create_agent(+ model="openai:gpt-4o",+ tools=[weather_tool],+ system_prompt="You are a helpful weather assistant."+)```-Metadata and tags are propagated to LangSmith and other observability backends, enabling debugging and performance analysis.+The agent factory internally compiles prompts with the model and tool bindings, managing message flow through the state machine. Middleware can intercept and modify prompts before model invocation via the `wrap_model_call` hook, enabling use cases like prompt optimization or safety filters.diff --git a/openwiki/quickstart.md b/openwiki/quickstart.mdindex 27ef4e0a8b..3f3dd489e7 100644--- a/openwiki/quickstart.md+++ b/openwiki/quickstart.md@@ -43,7 +43,7 @@ sources:generated: { by: "openwiki/0.5.0", at: "2026-10-19T08:31:23.057Z" }verified:- by: openwiki/0.5.0- at: 2026-10-19T08:31:23.057Z+ at: 2026-10-20T08:25:57.412Z---## Welcome to LangChain Developmentdiff --git a/openwiki/runnables.md b/openwiki/runnables.mdindex 35b3cec3b7..eeed81ff02 100644--- a/openwiki/runnables.md+++ b/openwiki/runnables.md@@ -1,8 +1,8 @@---type: "Concept"-title: "Runnable: Core Composition Layer"-description: "Explain the Runnable protocol and how it enables composable chaining of LLM components through the LangChain Expression Language (LCEL)."-tags: [runnable, lcel, composition, invoke, stream, batch, async, chaining]+title: "Runnables: The Composition Protocol"+description: "The Runnable protocol provides a unified, composable interface for every LangChain component. Runnable enables declarative composition through the pipe operator, orchestrates streaming, batch, and async execution, and carries configuration and callbacks through entire chains."+tags: [runnable, lcel, composition, invoke, stream, batch, async, chaining, protocol]sources:- id: openwiki-source-a1981e868973f6fd7f71e12eresource: repo://libs/core/langchain_core/runnables/base.py@@ -14,29 +14,29 @@ sources:resource: repo://libs/core/langchain_core/runnables/fallbacks.py- id: openwiki-source-ebe3f825462d0b4a14ee3717resource: repo://libs/core/langchain_core/runnables/retry.py-generated: { by: "openwiki/0.5.0", at: "2026-10-16T08:25:55.096Z" }verified:- by: openwiki/0.5.0- at: 2026-10-16T08:25:55.096Z+ at: 2026-10-20T08:25:57.412Z+generated: { by: "openwiki/0.5.0", at: "2026-10-20T08:25:57.412Z" }---## Overview-**Runnable** is the fundamental abstraction in LangChain's core layer. It defines a serializable, composable interface that every LLM component—prompts, models, tools, chains, output parsers—must implement. A `Runnable` is a unit of work that transforms input into output through five core operations: synchronous invoke, asynchronous invoke, batch processing, streaming, and introspection of input/output schemas.+**Runnable** is the foundational protocol in LangChain's core layer. It defines a serializable, composable interface that every LLM component—prompts, models, tools, chains, output parsers—must implement. A `Runnable` is a unit of work that transforms input into output through a unified set of operations: synchronous and asynchronous invoke, batch processing, streaming, and schema introspection.-The **LangChain Expression Language (LCEL)** leverages Runnables to build chains declaratively using composition operators. Any chain built from Runnables automatically inherits sync, async, batch, and streaming support without additional implementation. This unifies execution patterns and enables sophisticated control flows—sequential piping (`|`), parallel forking (`+`), branching, fallback handling, and retry logic—all composable as first-class operations.+The **LangChain Expression Language (LCEL)** leverages Runnables to build chains declaratively using composition operators. Any chain built from Runnables automatically inherits sync, async, batch, and streaming support without additional implementation. This unifies execution patterns and enables sophisticated control flows—sequential piping (`|`), parallel forking (dict literals), branching, fallback handling, and retry logic—all composable as first-class operations.-## Core Runnable Protocol+## The Runnable Protocol-**Location**: `repo://libs/core/langchain_core/runnables/base.py#L133-L265`+**Location**: `repo://libs/core/langchain_core/runnables/base.py#L134-L265`The `Runnable` abstract base class defines the contract for all components. A Runnable is generic over input and output types (`Runnable[Input, Output]`) and must implement the abstract `invoke` method. All other execution methods have default implementations that subclasses can override for optimization.-### Key Responsibilities+### Core Responsibilities-1. **Invoke**: Execute a single input synchronously and return a single output.-2. **Batch**: Process multiple inputs in parallel (default uses thread pool, subclasses can optimize).-3. **Stream**: Yield partial outputs as they are produced (default calls invoke once; specialized for streaming models).+1. **Single invoke**: Execute a single input synchronously and return a single output.+2. **Batch processing**: Process multiple inputs in parallel (default uses thread pool; subclasses can optimize).+3. **Streaming**: Yield partial outputs as they are produced (default calls invoke once; specialized for streaming models).4. **Async variants**: Asynchronous versions of invoke, batch, and stream (default delegates to sync via executor; subclasses implement natively).5. **Schema introspection**: Expose input type, output type, and configuration schema as Pydantic models for validation and tooling.6. **Composition**: Support chaining with other Runnables via operators and methods.@@ -79,9 +79,9 @@ def batch(- If `return_exceptions=True`, exceptions are returned as-is in the output list; otherwise, they are raised.- Subclasses override for batching-aware backends (e.g., LLMs with batch API support).-**`batch_as_completed(inputs, config=None, return_exceptions=False)`** yields results as they complete, useful for streaming partial results while processing.+**`batch_as_completed(inputs, config=None, return_exceptions=False)`** yields results as they complete, useful for streaming partial results while processing batches.-**`stream(input, config=None)`** (`repo://libs/core/langchain_core/runnables/base.py#L1194-L1213`) yields partial outputs:+**`stream(input, config=None)`** (`repo://libs/core/langchain_core/runnables/base.py#L1195-L1213`) yields partial outputs:```pythondef stream(@@ -91,10 +91,12 @@ def stream(**kwargs: Any | None,) -> Iterator[Output]:"""Default implementation of stream, which calls invoke."""+ yield self.invoke(input, config, **kwargs)```- **Default**: Yields one full output from `invoke`.- **Specialized implementations** (e.g., chat models, token-streaming parsers) yield chunks as they arrive.+- **Transform methods**: Components implementing `transform(input_iterator)` can stream input to output without blocking. `RunnableSequence` optimizes streaming by chaining transform methods end-to-end; if any step lacks transform, streaming begins after that step.- Enables responsive UX by progressive output display.### Asynchronous Methods@@ -108,7 +110,7 @@ async def ainvoke(config: RunnableConfig | None = None,**kwargs: Any,) -> Output:- """Transform a single input into an output."""+ """Transform a single input into an output asynchronously."""```- **Default**: Delegates to sync `invoke` via `run_in_executor`.@@ -129,11 +131,11 @@ async def abatch(```- Calls `ainvoke` for each input concurrently.-- Respects `max_concurrency` from config to limit parallelism.+- Respects `max_concurrency` from config to limit parallelism via `gather_with_concurrency`.**`abatch_as_completed(inputs, config=None, return_exceptions=False)`** yields completed async results as they finish.-**`astream(input, config=None)`** (`repo://libs/core/langchain_core/runnables/base.py#L1215-L1234`) is the async streaming variant:+**`astream(input, config=None)`** (`repo://libs/core/langchain_core/runnables/base.py#L1216-L1235`) is the async streaming variant:```pythonasync def astream(@@ -171,7 +173,7 @@ def output_schema(self) -> TypeBaseModel:## Composition Operators and Methods-The heart of LCEL is declarative composition. Runnables are chained together using operators and methods that create new composite Runnables.+The heart of LCEL is declarative composition. Runnables are chained together using operators and methods that create new composite Runnables without mutating the original.### Sequential Composition: Pipe Operator `|`@@ -188,6 +190,7 @@ def __or__(self, other):from langchain_core.runnables import RunnableLambdafrom langchain_core.prompts import PromptTemplatefrom langchain_core.output_parsers import StrOutputParser+from langchain_openai import ChatOpenAIprompt = PromptTemplate.from_template("Tell me about {topic}")model = ChatOpenAI()@@ -253,9 +256,11 @@ sequence = RunnableSequence(```**Key behavior**:+- **Batching**: Each step in the sequence is called with the batch of inputs from the previous step. If a step's batch is optimized (e.g., for an LLM API), the entire chain benefits.- **Streaming**: If all steps implement `transform` (streaming input → streaming output), the sequence streams end-to-end. Otherwise, streaming begins after the last blocking step.- **Async**: Async variants call each step's async method in order via `asyncio.gather` for parallelizable steps within the chain.+- **Flattening**: Nested sequences are flattened to avoid redundant nesting.### Branching: RunnableBranch@@ -329,7 +334,7 @@ result = model.invoke("Hello") # Returns first successful result- **Streaming**: Delegates to the first successful runnable's `stream()` or `astream()`.- **Fallback exhaustion**: If all runnables fail, raises the first error encountered.-**Retry**: `RunnableRetry` (`repo://libs/core/langchain_core/runnables/retry.py#L50-L386`)+**Retry**: Retry logic is available via `with_retry()` method on any Runnable:```pythonrunnable = ChatOpenAI().with_retry(@@ -340,11 +345,11 @@ runnable = ChatOpenAI().with_retry(# Retries on APIError up to 3 times with exponential backoff + jitter.```-- Wraps a `Runnable` via `RunnableBindingBase` to add retry logic powered by `tenacity`.+- Wraps a `Runnable` to add retry logic powered by `tenacity`.- **Exception filtering**: `retry_exception_types` is either a tuple of exception types or a callable that returns `True` for exceptions to retry.-- **Retry strategy**: Configurable via `max_attempt_number` (default 3) and `wait_exponential_jitter` (default `True`) for exponential backoff with random jitter.-- **Jitter parameters**: Fine-tunable via `exponential_jitter_params` (initial, max, exp_base, jitter).-- **Retry propagation**: Tracks per-attempt state via `_patch_config` to tag callback runs as `retry:attempt:N` for observability.+- **Retry strategy**: Configurable via `stop_after_attempt` (default 3) and `wait_exponential_jitter` (default `True`) for exponential backoff with random jitter.+- **Jitter parameters**: Fine-tunable via exponential jitter configuration (initial, max, exp_base, jitter).+- **Retry propagation**: Tracks per-attempt state to tag callback runs as `retry:attempt:N` for observability.- **Batch retries**: Retries only failed inputs in a batch, re-invoking just the subset that did not succeed.- **Stream limitation**: `stream()` and `transform()` are not retried because stream retry semantics are ambiguous.- Best applied to individual runnables (e.g., LLM calls) rather than entire chains.@@ -367,16 +372,49 @@ class RunnableConfig(TypedDict, total=False):run_id: uuid.UUID | None # Unique execution ID```-- **Propagation**: Config is threaded through child runnables via context variables (`var_child_runnable_config`) and explicit parameter passing.-- **Merging**: Configs are merged when passed down (e.g., tags accumulate: parent tags + child tags).+- **Propagation**: Config is threaded through child runnables via context variables (`var_child_runnable_config`) and explicit parameter passing. When a Runnable invokes child runnables, configs are merged (tags and metadata accumulate).+- **Merging**: `merge_configs()` combines parent and child configs, with child values taking precedence. Lists like `tags` are concatenated.- **Callbacks**: Attached callbacks receive hooks for all intermediate steps, enabling observability and custom logic.-- **Configurable fields**: The `configurable` dict supplies runtime values for fields marked with `configurable_fields()` or `configurable_alternatives()`, enabling dynamic behavior.+- **Configurable fields**: The `configurable` dict supplies runtime values for fields marked with `configurable_fields()` or `configurable_alternatives()`, enabling dynamic behavior without reconstruction.+- **Context variables**: `var_child_runnable_config` is an `asyncio.ContextVar` that automatically passes config down the call stack for child runnables without explicit parameter passing.++## Streaming and Event Flow++Streaming is not an afterthought in Runnables; it is a first-class execution mode. The streaming protocol enables responsive, incremental output generation.++### Streaming Semantics++When `stream(input)` is called:++1. **Default behavior**: If a Runnable does not override `stream()`, it yields a single output from `invoke()`.+2. **Streaming models**: Chat models and other components override `stream()` to yield partial outputs (e.g., tokens) as they arrive.+3. **Transform method**: Advanced streaming is implemented via `transform(input_iterator)`, which maps a stream of inputs to a stream of outputs without blocking. This enables progressive end-to-end streaming through entire chains.++### RunnableSequence Streaming Optimization++`RunnableSequence` optimizes streaming by analyzing each step:++- If all steps implement `transform`, the sequence chains them: input flows through each step's transform, yielding outputs progressively.+- If any step lacks `transform`, streaming begins after that step. Inputs before it are processed in full, then partial outputs flow through remaining steps.+- This ensures end-to-end streaming when possible and graceful degradation when not.++**Example**:+```python+# All steps stream-compatible: progressive token output+chain = prompt | streaming_model | streaming_parser+for chunk in chain.stream({"topic": "AI"}):+ print(chunk, end="", flush=True)++# Parser lacks transform: tokens blocked until parsing+chain = prompt | streaming_model | slow_parser+# Streaming begins after model completes and parser starts+```## Core Runnable Types### RunnableLambda-**Location**: `repo://libs/core/langchain_core/runnables/base.py#L4703-L4850`+**Location**: `repo://libs/core/langchain_core/runnables/base.py#L4707-L4850``RunnableLambda` wraps a Python callable into a `Runnable`:@@ -404,7 +442,7 @@ await runnable.ainvoke(1) # 2### RunnableGenerator-Wraps generator functions (sync or async) to create streaming runnables.+Wraps generator functions (sync or async) to create streaming runnables. Useful for implementing custom streaming logic.### RunnableParallel@@ -448,7 +486,7 @@ chain.assign(new_field=some_runnable)# Output now includes original fields + new_field```-## Runnable Hierarchy+## Runnable Type HierarchyThe following diagram shows the core Runnable class hierarchy:@@ -505,11 +543,6 @@ classDiagram+fallbacks Sequence[Runnable]}- class RunnableRetry {- +bound Runnable- +max_attempt_number int- }-Runnable <|-- RunnableSerializableRunnableSerializable <|-- RunnableSequenceRunnableSerializable <|-- RunnableParallel@@ -517,7 +550,6 @@ classDiagramRunnableSerializable <|-- RunnableBranchRunnableSerializable <|-- RouterRunnableRunnableSerializable <|-- RunnableWithFallbacks- RunnableSerializable <|-- RunnableRetry```Class hierarchy of core Runnable types and their relationships.@@ -553,7 +585,7 @@ Execution flow through a sequential composition with config propagation.## RunnableLike and Type Coercion-**Location**: `repo://libs/core/langchain_core/runnables/base.py#L6608-L6664`+**Location**: `repo://libs/core/langchain_core/runnables/base.py#L6612-L6668``RunnableLike` is a union type that accepts anything composable:@@ -655,14 +687,15 @@ A key design principle: **everything is a Runnable**. This includes:Because all are Runnables, any can be composed with any other via `|`, parallelized, retried, and monitored uniformly.-## Simple Example: Prompt → Model → Parser Chain+## Example: Prompt → Model → Parser Chain```pythonfrom langchain_core.prompts import PromptTemplate-from langchain_core.chat_models import ChatOpenAI+from langchain_openai import ChatOpenAIfrom langchain_core.output_parsers import JsonOutputParser+from pydantic import BaseModel-# Define input schema+# Define output schemaclass TopicInfo(BaseModel):topic: strexamples: list[str]@@ -686,14 +719,14 @@ result = chain.invoke({# Batchresults = chain.batch([- {"topic": "AI", ...},- {"topic": "NLP", ...},- {"topic": "Vision", ...},+ {"topic": "AI", "format_instructions": parser.get_format_instructions()},+ {"topic": "NLP", "format_instructions": parser.get_format_instructions()},+ {"topic": "Vision", "format_instructions": parser.get_format_instructions()},])# results is a list of TopicInfo instances, processed in parallel# Stream-for chunk in chain.stream({"topic": "Reinforcement Learning", ...}):+for chunk in chain.stream({"topic": "Reinforcement Learning", "format_instructions": parser.get_format_instructions()}):print(chunk) # Yields intermediate outputs as they arrive```diff --git a/openwiki/source-map.md b/openwiki/source-map.mdindex 8669b96015..cc4d9b02e5 100644--- a/openwiki/source-map.md+++ b/openwiki/source-map.md@@ -46,49 +46,69 @@ sources:resource: repo://libs/partners/openai/langchain_openai/decisions/base.py- id: openwiki-source-bd29e79613d5f366a00068f5resource: repo://libs/standard-tests/langchain_tests/base.py-generated: { by: "openwiki/0.5.0", at: "2026-10-19T08:31:23.057Z" }verified:- by: openwiki/0.5.0- at: 2026-10-19T08:31:23.057Z+ at: 2026-10-20T08:25:57.412Z+generated: { by: "openwiki/0.5.0", at: "2026-10-20T08:25:57.412Z" }---## Overview-This page provides a quick reference for locating code by topic in the LangChain monorepo. The repository is organized as a multi-package workspace with a three-layer architecture: **langchain-core** (base abstractions), **langchain** (orchestration and agents), and **partners** (provider integrations). Use this map to navigate directly to the code responsible for a given concept.+This page provides a quick reference for locating code by topic in the LangChain monorepo. The repository is organized as a multi-package workspace with a three-layer architecture:-**Current Versions**: langchain-core v1.6.12, langchain v1.4.6+- **langchain-core** (v1.6.12): Base abstractions for messages, runnables, tools, prompts, language models, and callbacks+- **langchain** (v1.4.6): Orchestration, agent factory, middleware composition, and model initialization+- **langchain-classic** (v1.0.8): Legacy chains, memory, retrieval abstractions, and backward compatibility+- **partners** (`langchain-*` packages): Provider-specific implementations (OpenAI, Anthropic, Ollama, etc.)+- **text-splitters** (v1.x): Text splitting and chunking utilities+- **model-profiles** (v0.0.6): LLM metadata and capability profiles+- **standard-tests** (shared): Ecosystem test contracts and conformance suites++Use this map to navigate directly to the code responsible for a given concept, understand architectural layering, and locate integration points.## Concept-to-Path Mapping| Concept | Primary Path | Purpose ||---------|--------------|---------|| **Agent Factory** | `repo://libs/langchain_v1/langchain/agents/factory.py` | Constructs compiled LangGraph state machines for agentic loops with model binding, tool execution, and middleware composition |-| **Agent Middleware** | `repo://libs/langchain_v1/langchain/agents/middleware/` | Pluggable hooks for model calls, tool invocation, and lifecycle events (retries, human-in-loop, redaction, etc.) |-| **Chat Models** | `repo://libs/core/langchain_core/language_models/chat_models.py` | `BaseChatModel` abstract base and unified provider interface for streaming, batching, and token counting |-| **Chat Models (Core Interfaces)** | `repo://libs/core/langchain_core/language_models/` | Base language model classes, fake models for testing, and compatibility bridges |-| **Chat Models (Partner Implementations)** | `repo://libs/partners/*/` (e.g., `openai/`, `anthropic/`, `ollama/`) | Provider-specific implementations: ChatOpenAI, ChatAnthropic, ChatOllama, etc. |+| **Agent Middleware** | `repo://libs/langchain_v1/langchain/agents/middleware/` | Pluggable hooks for model calls, tool invocation, and lifecycle events (retries, human-in-loop, redaction, etc.); 20+ middleware implementations |+| **Caches & Prompt Caching** | `repo://libs/core/langchain_core/caches.py` | Optional caching layer for LLM results (distinct from provider prompt caching); in-memory and custom cache backends |+| **Chat Models (Core)** | `repo://libs/core/langchain_core/language_models/chat_models.py` | `BaseChatModel` abstract base and unified provider interface for streaming, batching, token counting, and structured outputs |+| **Chat Models (Discovery)** | `repo://libs/langchain_v1/langchain/chat_models/base.py` | `init_chat_model()` factory for dynamic model discovery and loading by provider:model identifier |+| **Chat Models (Implementations)** | `repo://libs/partners/*/langchain_*/chat_models/` (e.g., `openai/`) | Provider-specific implementations: ChatOpenAI, ChatAnthropic, ChatOllama, ChatGroq, etc. |+| **Callbacks & Tracing** | `repo://libs/core/langchain_core/callbacks/` | Callback manager, base handlers, streaming output, LangSmith integration, and event instrumentation || **Decisions (OpenAI)** | `repo://libs/partners/openai/langchain_openai/decisions/` | OpenAI structured outputs API integration for deterministic response marshaling and routing |-| **Callbacks & Tracing** | `repo://libs/core/langchain_core/callbacks/` | Callback manager, base handlers, streaming output, and LangSmith integration |-| **Messages** | `repo://libs/core/langchain_core/messages/` | Message types (AIMessage, HumanMessage, SystemMessage, ToolMessage) and content blocks |-| **Model Initialization** | `repo://libs/langchain_v1/langchain/chat_models/base.py` | `init_chat_model()` factory for dynamic model discovery and loading by provider:model identifier |-| **Model Profiles** | `repo://libs/model-profiles/langchain_model_profiles/` | Metadata and profiles for LLM behavior, capabilities, and configuration |-| **MCP (Model Context Protocol)** | `repo://libs/langchain_v1/langchain/mcp/` | Adapter, tools, and elicitation for MCP-based model integrations |-| **Output Parsers** | `repo://libs/core/langchain_core/output_parsers/` | Structured output parsing, Pydantic model marshaling, and output validation |-| **Prompts** | `repo://libs/core/langchain_core/prompts/` | Chat and string prompt templates, few-shot examples, and image prompts |-| **Runnables (LCEL)** | `repo://libs/core/langchain_core/runnables/` | Foundational `Runnable[Input, Output]` protocol, composition operators, and control flow (piping, branching, fallback, retry) |-| **Structured Output** | `repo://libs/langchain_v1/langchain/agents/structured_output.py` | Schema definition and response marshaling for typed agent outputs |-| **Tools** | `repo://libs/core/langchain_core/tools/` | `BaseTool` abstraction, tool conversion from functions/Pydantic, and tool rendering |-| **Tests (Core Unit)** | `repo://libs/core/tests/unit_tests/` | Unit tests for abstractions: runnables, messages, prompts, tools, callbacks |+| **Document Loaders** | `repo://libs/core/langchain_core/document_loaders/` | Base loaders for ingesting documents from files, URLs, LangSmith, and blob storage |+| **Documents & Metadata** | `repo://libs/core/langchain_core/documents/base.py` | Document type, compression, and transformation utilities |+| **Embeddings** | `repo://libs/core/langchain_core/embeddings/embeddings.py` | Base embedding interface and fake embeddings for testing |+| **Example Selectors** | `repo://libs/core/langchain_core/example_selectors/` | Selection strategies for few-shot examples (LLM, max marginal relevance, etc.) |+| **Messages** | `repo://libs/core/langchain_core/messages/` | Message types (AIMessage, HumanMessage, SystemMessage, ToolMessage) and content blocks (text, images, tool use, etc.) |+| **Model Profiles** | `repo://libs/model-profiles/langchain_model_profiles/` | Metadata registry and CLI tools for LLM behavior, capabilities, and configuration |+| **MCP (Model Context Protocol)** | `repo://libs/langchain_v1/langchain/mcp/` | Adapter and tools for MCP-based model integrations and protocol compatibility |+| **Output Parsers** | `repo://libs/core/langchain_core/output_parsers/` | Structured output parsing (JSON, XML, Pydantic, OpenAI tools), format instructions, and validation |+| **Prompts** | `repo://libs/core/langchain_core/prompts/` | Chat and string prompt templates, few-shot examples, image prompts, and prompt composition |+| **Rate Limiters** | `repo://libs/core/langchain_core/rate_limiters.py` | Base rate limiter interface and in-memory rate limiting implementations |+| **Retrievers** | `repo://libs/core/langchain_core/retrievers.py` | Retriever abstraction for document retrieval, vector store integration, and composition |+| **Runnables (LCEL)** | `repo://libs/core/langchain_core/runnables/` | Foundational `Runnable[Input, Output]` protocol, composition operators (piping, branching, fallback, retry), and execution utilities |+| **Structured Output** | `repo://libs/langchain_v1/langchain/agents/structured_output.py` | Schema definition and response marshaling for typed agent outputs (Pydantic, dataclass, TypedDict, JSON schema) |+| **Tools** | `repo://libs/core/langchain_core/tools/` | `BaseTool` abstraction, tool conversion from functions/Pydantic, schema generation, and tool rendering |+| **Vector Stores** | `repo://libs/core/langchain_core/vectorstores/base.py` | Base vector store interface with in-memory implementation; persistence and async support |+| **Legacy Chains** | `repo://libs/langchain/langchain_classic/chains/` | Legacy chain abstractions (LLMChain, SequentialChain, etc.) for backward compatibility |+| **Legacy Memory** | `repo://libs/langchain/langchain_classic/memory/` | Conversation memory implementations (BufferMemory, EntityMemory, summary-based) |+| **Text Splitters** | `repo://libs/text-splitters/langchain_text_splitters/` | Character, token, semantic, and language-specific text chunking algorithms |+| **Tests (Core Unit)** | `repo://libs/core/tests/unit_tests/` | Unit tests for abstractions: runnables, messages, prompts, tools, callbacks, output parsers || **Tests (Core Integration)** | `repo://libs/core/tests/integration_tests/` | Integration tests with live providers and external services |-| **Tests (LangChain Unit)** | `repo://libs/langchain_v1/tests/unit_tests/` | Unit tests for agent factory, middleware, chat models, and orchestration |+| **Tests (LangChain Unit)** | `repo://libs/langchain_v1/tests/unit_tests/` | Unit tests for agent factory, middleware, chat models, orchestration, and initialization || **Tests (LangChain Integration)** | `repo://libs/langchain_v1/tests/integration_tests/` | Integration tests for agent execution, tool binding, and provider fallback |-| **Tests (Partner Unit)** | `repo://libs/partners/*/tests/unit_tests/` | Provider-specific unit tests |-| **Tests (Partner Integration)** | `repo://libs/partners/*/tests/integration_tests/` | Provider-specific integration tests |+| **Tests (Partner Unit)** | `repo://libs/partners/*/tests/unit_tests/` | Provider-specific unit tests for chat models and integrations |+| **Tests (Partner Integration)** | `repo://libs/partners/*/tests/integration_tests/` | Provider-specific integration tests using live APIs (with cassettes for replay) || **Standard Tests** | `repo://libs/standard-tests/langchain_tests/` | Shared test suites and contracts for component conformance across the ecosystem || **Configuration (Core)** | `repo://libs/core/pyproject.toml` | langchain-core package metadata, dependencies (langsmith, httpx, tenacity, pydantic), and build config |-| **Configuration (LangChain)** | `repo://libs/langchain_v1/pyproject.toml` | langchain package metadata, core dependencies, and optional provider groups |-| **Configuration (Repo-Wide)** | `repo:///.pre-commit-config.yaml` | Git hooks for formatting, linting, and validation across all packages |-| **Build System (Libs)** | `repo://libs/Makefile` | Monorepo-level build targets, dependency locking, and cross-package tasks |+| **Configuration (LangChain v1)** | `repo://libs/langchain_v1/pyproject.toml` | langchain v1 package metadata, core dependencies, and optional provider groups |+| **Configuration (Classic)** | `repo://libs/langchain/pyproject.toml` | langchain-classic package metadata (legacy chains, memory, retrieval) |+| **Configuration (Text Splitters)** | `repo://libs/text-splitters/pyproject.toml` | langchain-text-splitters package metadata and dependencies |+| **Configuration (Repo-Wide)** | `repo://.pre-commit-config.yaml` | Git hooks for formatting, linting, and validation across all packages |+| **Build System (Libs)** | `repo://libs/Makefile` | Multi-package lockfile coordination, build targets, and cross-package tasks |## Key Directory Structure@@ -97,29 +117,82 @@ This page provides a quick reference for locating code by topic in the LangChain├── core/ # langchain-core: Base abstractions (v1.6.12)│ ├── langchain_core/│ │ ├── language_models/ # BaseChatModel and language model abstractions+│ │ │ ├── chat_models.py # Core chat model interface+│ │ │ ├── base.py # BaseLanguageModel and registry+│ │ │ └── model_profile.py # Profile metadata integration│ │ ├── messages/ # Message types and content blocks+│ │ │ ├── base.py # BaseMessage and AIMessage+│ │ │ ├── content.py # Content block types (text, images, tool use)+│ │ │ ├── ai.py # AIMessage, AIMessageChunk+│ │ │ ├── tool.py # ToolMessage, ToolCall handling+│ │ │ └── utils.py # Message utilities and converters│ │ ├── runnables/ # Runnable protocol and composition+│ │ │ ├── base.py # Runnable[Input, Output] protocol+│ │ │ ├── config.py # RunnableConfig and context management+│ │ │ ├── router.py # Routing and branching logic+│ │ │ └── utils.py # Composition utilities│ │ ├── tools/ # BaseTool and tool conversion-│ │ ├── prompts/ # Prompt templates and few-shot+│ │ │ ├── base.py # BaseTool abstract base+│ │ │ ├── convert.py # Function/Pydantic to tool conversion+│ │ │ ├── structured.py # StructuredTool with schema+│ │ │ └── render.py # Tool rendering for models+│ │ ├── prompts/ # Prompt templates and composition+│ │ │ ├── base.py # BasePrompt and PromptTemplate+│ │ │ ├── chat.py # ChatPromptTemplate, message composition+│ │ │ ├── few_shot.py # Few-shot example selection+│ │ │ └── image.py # Image prompt support│ │ ├── output_parsers/ # Output parsing and validation+│ │ │ ├── base.py # BaseOutputParser interface+│ │ │ ├── pydantic.py # Pydantic model parsing+│ │ │ ├── openai_tools.py # OpenAI tool/function call parsing+│ │ │ ├── json.py # JSON output parsing+│ │ │ └── xml.py # XML structured output parsing│ │ ├── callbacks/ # Callback manager and handlers+│ │ │ ├── manager.py # CallbackManager, async variants, event coordination+│ │ │ ├── base.py # BaseCallbackHandler interface+│ │ │ ├── streaming_stdout.py # Streaming output callback+│ │ │ └── file.py # File-based logging+│ │ ├── language_models/ # Additional model utilities+│ │ ├── caches.py # Cache interface for LLM results+│ │ ├── rate_limiters.py # Rate limiter base and in-memory impl│ │ ├── retrievers.py # Retriever abstraction-│ │ └── ... (other modules)+│ │ ├── vectorstores/ # Vector store interface and in-memory impl+│ │ ├── documents/ # Document type and utilities+│ │ ├── embeddings/ # Embedding interface and fake impl+│ │ ├── document_loaders/ # Document loader abstractions+│ │ ├── example_selectors/ # Few-shot example selector strategies+│ │ └── ... (other utilities)│ ├── tests/│ │ ├── unit_tests/-│ │ └── integration_tests/+│ │ ├── integration_tests/+│ │ └── benchmarks/│ ├── Makefile│ └── pyproject.toml│├── langchain_v1/ # langchain: Orchestration and agents (v1.4.6)│ ├── langchain/│ │ ├── agents/-│ │ │ ├── factory.py # Agent factory and graph construction-│ │ │ ├── middleware/ # Pluggable middleware system-│ │ │ ├── structured_output.py # Response schema and marshaling-│ │ │ └── _subagent_transformer.py # Sub-agent utilities+│ │ │ ├── factory.py # Agent factory: graph construction, node orchestration+│ │ │ ├── middleware/ # Pluggable middleware system (20+ impls)+│ │ │ │ ├── types.py # AgentMiddleware, AgentState, callbacks+│ │ │ │ ├── _retry.py # Retry coordination+│ │ │ │ ├── _execution.py # Execution lifecycle+│ │ │ │ ├── model_retry.py # Model invocation retry+│ │ │ │ ├── tool_retry.py # Tool call retry+│ │ │ │ ├── tool_call_limit.py # Tool invocation limits+│ │ │ │ ├── model_fallback.py # Model fallback chains+│ │ │ │ ├── human_in_the_loop.py # Human approval loops+│ │ │ │ ├── pii.py # PII detection and redaction+│ │ │ │ ├── shell_tool.py # Shell command execution+│ │ │ │ ├── file_search.py # File system search and indexing+│ │ │ │ ├── tool_selection.py # LLM-based tool selection+│ │ │ │ ├── context_editing.py # Message context manipulation+│ │ │ │ ├── summarization.py # Conversation summarization+│ │ │ │ └── ... (other middleware)+│ │ │ ├── structured_output.py # Response schema marshaling+│ │ │ └── _subagent_transformer.py # Sub-agent graph composition│ │ ├── chat_models/-│ │ │ └── base.py # init_chat_model factory+│ │ │ └── base.py # init_chat_model factory and registry│ │ ├── mcp/ # Model Context Protocol adapter│ │ ├── messages/ # v1-specific message utilities│ │ ├── embeddings/ # Embedding utilities@@ -133,8 +206,32 @@ This page provides a quick reference for locating code by topic in the LangChain│ ├── Makefile│ └── pyproject.toml│+├── langchain/ # langchain-classic: Legacy code (v1.0.8)+│ ├── langchain_classic/+│ │ ├── chains/ # Legacy chain abstractions+│ │ ├── memory/ # Conversation memory implementations+│ │ ├── llms/ # Legacy LLM abstractions+│ │ ├── retrievers/ # Legacy retrieval abstractions+│ │ ├── document_loaders/ # Legacy document loading+│ │ └── ... (other legacy modules)+│ ├── tests/+│ ├── Makefile+│ └── pyproject.toml+│├── partners/ # Provider-specific integrations-│ ├── openai/ # ChatOpenAI, embeddings, etc.+│ ├── openai/ # ChatOpenAI, embeddings, decisions API+│ │ ├── langchain_openai/+│ │ │ ├── chat_models/base.py # ChatOpenAI implementation+│ │ │ ├── decisions/ # Structured outputs integration+│ │ │ ├── embeddings/ # OpenAI embedding models+│ │ │ ├── llms/ # Legacy LLM compatibility+│ │ │ ├── output_parsers/ # Tool/function call parsing+│ │ │ ├── middleware/ # OpenAI-specific middleware+│ │ │ └── tools/ # OpenAI-specific tool integrations+│ │ ├── tests/+│ │ ├── Makefile+│ │ └── pyproject.toml+│ ││ ├── anthropic/ # ChatAnthropic (Claude)│ ├── ollama/ # ChatOllama (local models)│ ├── groq/ # ChatGroq@@ -145,62 +242,142 @@ This page provides a quick reference for locating code by topic in the LangChain│ ├── perplexity/ # Perplexity models│ ├── fireworks/ # Fireworks inference│ ├── openrouter/ # OpenRouter aggregator-│ ├── typesafe/ # Typesafe schema generation+│ ├── together/ # Together AI models+│ ├── google-vertexai/ # Google Vertex AI+│ ├── google-genai/ # Google Generative AI+│ ├── azure-ai/ # Azure OpenAI and AI services+│ ├── aws/ # AWS Bedrock and SageMaker│ ├── chroma/ # Chroma vector store│ ├── qdrant/ # Qdrant vector store│ ├── exa/ # Exa search│ ├── nomic/ # Nomic embeddings+│ ├── typesafe/ # Typesafe schema generation+│ ├── cohere/ # Cohere models│ └── Makefile│-├── model-profiles/ # LLM behavior and capability profiles+├── text-splitters/ # Text splitting utilities (v1.x)+│ ├── langchain_text_splitters/+│ │ ├── base.py # TextSplitter base class+│ │ ├── character.py # Character-based splitting+│ │ ├── token_based.py # Token count aware splitting+│ │ ├── semantic.py # Semantic (embedding-based) splitting+│ │ └── language_specific.py # Language-specific algorithms+│ ├── tests/+│ ├── Makefile+│ └── pyproject.toml+│+├── model-profiles/ # LLM behavior and capability profiles (v0.0.6)│ ├── langchain_model_profiles/+│ │ ├── cli.py # CLI for updating profiles+│ │ └── _summary.py # Profile metadata aggregation+│ ├── tests/│ ├── Makefile│ └── pyproject.toml│├── standard-tests/ # Cross-ecosystem test contracts│ ├── langchain_tests/+│ │ ├── base.py # BaseStandardTests class+│ │ ├── unit_tests/ # Standard unit test suites+│ │ ├── integration_tests/ # Standard integration test suites+│ │ ├── conftest.py # Pytest configuration+│ │ └── utils/ # Test utilities│ ├── tests/│ ├── Makefile│ └── pyproject.toml│-├── text-splitters/ # Text splitting utilities-│├── Makefile # Multi-package build coordination└── README.md```+## Architecture Layers++### Layer 1: langchain-core (Base Abstractions)+Core interfaces and implementations used by all other packages:+- **Message protocol**: AIMessage, HumanMessage, SystemMessage, ToolMessage with rich content blocks+- **Runnable protocol**: Composable units with `invoke()`, `stream()`, `batch()` and async variants+- **LLM interface**: BaseChatModel for unified provider integration+- **Tool system**: BaseTool with schema generation and conversion utilities+- **Prompt templates**: ChatPromptTemplate and PromptTemplate for composition+- **Output parsing**: Structured output extraction (JSON, XML, Pydantic, OpenAI tools)+- **Callbacks**: Event instrumentation and LangSmith integration+- **Retrieval**: Document loaders, vectorstores, retrievers+- **Utilities**: Embeddings, caches, rate limiters, example selectors++### Layer 2: langchain (Orchestration & Agents)+High-level abstractions for agentic loops and orchestration:+- **Agent Factory** (`factory.py`): Constructs LangGraph state machines with 7 node types (entry, loop entry, model, after-model, tools, exit) orchestrated by middleware+- **Middleware System**: Pluggable hooks for model boundaries, tool boundaries, and lifecycle events (before_agent, before_model, after_model, after_tool, after_agent)+- **Model Initialization**: `init_chat_model()` factory for provider:model discovery and dynamic loading+- **Structured Output**: Schema marshaling for typed agent responses (Pydantic, dataclass, TypedDict, JSON schema)+- **MCP Integration**: Model Context Protocol adapter for tool discovery++### Layer 3: langchain-classic (Legacy Code)+Backward-compatible implementations for v0.x users:+- **Chains**: LLMChain, SequentialChain, and other legacy composition patterns+- **Memory**: BufferMemory, EntityMemory, summary-based memory implementations+- **Retrievers**: Legacy retriever abstractions+- **Loaders**: Legacy document loader patterns++### Layer 4: Partners (Provider Integrations)+Provider-specific implementations as independent packages:+- Each partner follows the **partner pattern**: extends core abstractions, released independently, dependencies pinned to core versions+- **ChatOpenAI, ChatAnthropic, ChatOllama, etc.**: Each implements BaseChatModel+- **Decisions API**: OpenAI-specific structured outputs integration+- **Vector Stores**: Chroma, Qdrant implementations of BaseVectorStore+- **Embeddings**: Provider-specific embedding models+## Common Workflows### Finding Agent-Related Code-- **Agent construction**: `repo://libs/langchain_v1/langchain/agents/factory.py`-- **Middleware hooks**: `repo://libs/langchain_v1/langchain/agents/middleware/types.py` for type definitions; individual middleware in `repo://libs/langchain_v1/langchain/agents/middleware/` subdirectory-- **Structured output**: `repo://libs/langchain_v1/langchain/agents/structured_output.py`+- **Agent construction**: `repo://libs/langchain_v1/langchain/agents/factory.py` (graph nodes, middleware orchestration)+- **Middleware hooks**: `repo://libs/langchain_v1/langchain/agents/middleware/types.py` (type definitions); individual middleware in `repo://libs/langchain_v1/langchain/agents/middleware/` subdirectory (20+ implementations)+- **Structured output**: `repo://libs/langchain_v1/langchain/agents/structured_output.py` (schema marshaling, response validation)- **Tests**: `repo://libs/langchain_v1/tests/unit_tests/` and `repo://libs/langchain_v1/tests/integration_tests/`### Finding LLM Integration Code- **Provider implementations**: `repo://libs/partners/<provider>/` (e.g., `repo://libs/partners/openai/`)-- **Model discovery**: `repo://libs/langchain_v1/langchain/chat_models/base.py` (init_chat_model)-- **Base interface**: `repo://libs/core/langchain_core/language_models/chat_models.py`-- **Model profiles**: `repo://libs/model-profiles/langchain_model_profiles/`+ - Chat models: `langchain_*/chat_models/base.py`+ - Embeddings: `langchain_*/embeddings/`+ - Provider-specific middleware: `langchain_*/middleware/`+- **Model discovery**: `repo://libs/langchain_v1/langchain/chat_models/base.py` (`init_chat_model()` factory, registry)+- **Base interface**: `repo://libs/core/langchain_core/language_models/chat_models.py` (BaseChatModel protocol)+- **Model profiles**: `repo://libs/model-profiles/langchain_model_profiles/` (metadata registry and CLI)### Finding Core Abstractions-- **Runnable protocol**: `repo://libs/core/langchain_core/runnables/base.py`-- **Messages**: `repo://libs/core/langchain_core/messages/`-- **Tools**: `repo://libs/core/langchain_core/tools/base.py`-- **Prompts**: `repo://libs/core/langchain_core/prompts/`-- **Callbacks**: `repo://libs/core/langchain_core/callbacks/`+- **Runnable protocol**: `repo://libs/core/langchain_core/runnables/base.py` (composition, streaming, batching)+- **Messages**: `repo://libs/core/langchain_core/messages/` (types, content blocks, utilities)+- **Tools**: `repo://libs/core/langchain_core/tools/base.py` (tool definition, schema, rendering)+- **Prompts**: `repo://libs/core/langchain_core/prompts/` (templates, composition, few-shot)+- **Callbacks**: `repo://libs/core/langchain_core/callbacks/` (event system, LangSmith integration)+- **Output parsing**: `repo://libs/core/langchain_core/output_parsers/` (structured extraction, validation)+- **Vector stores**: `repo://libs/core/langchain_core/vectorstores/base.py` (interface and in-memory impl)+- **Retrievers**: `repo://libs/core/langchain_core/retrievers.py` (document retrieval abstraction)### Finding Tests-- **Core abstractions**: `repo://libs/core/tests/`-- **Agent and orchestration**: `repo://libs/langchain_v1/tests/`-- **Provider-specific**: `repo://libs/partners/<provider>/tests/`-- **Shared test contracts**: `repo://libs/standard-tests/`+- **Core abstractions**: `repo://libs/core/tests/` (unit and integration tests for runnables, messages, tools, etc.)+- **Agent and orchestration**: `repo://libs/langchain_v1/tests/` (agent factory, middleware, initialization tests)+- **Provider-specific**: `repo://libs/partners/<provider>/tests/` (provider-specific unit and integration tests)+- **Shared test contracts**: `repo://libs/standard-tests/` (conformance tests for components across ecosystem)+- **Integration test data**: `repo://libs/langchain_v1/tests/cassettes/` (VCR cassettes for replaying HTTP interactions)### Configuration and Build-- **Lint and format**: `.pre-commit-config.yaml` at repo root-- **Core dependencies**: `repo://libs/core/pyproject.toml`-- **LangChain dependencies**: `repo://libs/langchain_v1/pyproject.toml`-- **Build tasks**: `repo://libs/Makefile` for multi-package commands+- **Lint and format**: `.pre-commit-config.yaml` at repo root (ruff, black, mypy config)+- **Core dependencies**: `repo://libs/core/pyproject.toml` (langsmith, httpx, tenacity, pydantic)+- **LangChain dependencies**: `repo://libs/langchain_v1/pyproject.toml` (core, langgraph, optional provider groups)+- **Multi-package tasks**: `repo://libs/Makefile` (lock, check-lock targets for all packages)++### Adding a New Provider Integration+1. Create `repo://libs/partners/<provider>/` directory+2. Implement `langchain_<provider>/chat_models/base.py` extending `BaseChatModel`+3. Follow **partner pattern**: independent dependencies, core pinning, standard test suite+4. Add to `repo://libs/langchain_v1/langchain/chat_models/base.py` registry in `_BUILTIN_PROVIDERS`+5. Organize tests in `tests/unit_tests/` and `tests/integration_tests/`++### Adding a Middleware Implementation+1. Create new file in `repo://libs/langchain_v1/langchain/agents/middleware/`+2. Extend `AgentMiddleware` from `repo://libs/langchain_v1/langchain/agents/middleware/types.py`+3. Implement hook methods: `before_agent()`, `before_model()`, `after_model()`, `after_tool_call()`, `after_agent()`+4. Register in middleware composition chain via `factory.py` builder## Build and Development Commands@@ -213,14 +390,23 @@ make -C <package> format# Lint code (ruff)make -C libs/core lint+# Type check (mypy)+make -C libs/core type+# Run all testsmake -C libs/langchain_v1 test+# Run specific test file+make -C libs/core TEST_FILE=tests/unit_tests/test_runnables.py test+# Lock dependenciesmake -C libs/core lock# Check lockfile consistencymake -C libs/core check-lock++# Extended tests (marked with @pytest.mark.extended)+make -C libs/core extended_tests```The root `repo://libs/Makefile` coordinates multi-package operations:@@ -233,66 +419,143 @@ make -C libs lockmake -C libs check-lock```-## Key Implementation Artifacts+## Key Implementation Details-### Agent Factory Graph-The agent construction pipeline in `repo://libs/langchain_v1/langchain/agents/factory.py` builds a LangGraph state machine with these nodes:-- **Entry**: Runs `before_agent` middleware once+### Agent Factory & Middleware Orchestration+The agent construction pipeline in `repo://libs/langchain_v1/langchain/agents/factory.py` builds a LangGraph state machine with these node types:+- **Entry**: Runs `before_agent` middleware once at start- **Loop Entry**: Begins each model iteration, runs `before_model` hooks-- **Model**: Invokes language model with message history-- **After Model**: Runs `after_model` hooks for response processing-- **Tools**: Executes tool calls (if any)+- **Model**: Invokes language model with accumulated message history and tool bindings+- **After Model**: Runs `after_model` hooks for response processing, tool call extraction+- **Tools**: Executes tool calls in parallel when present- **Exit**: Runs `after_agent` hooks once at completion-Middleware can inject hooks at model boundaries, tool boundaries, and lifecycle hooks (`before_agent`, `before_model`, `after_model`, `after_tool_call`, `after_agent`).+Middleware hooks are composable and execute in order:+- `before_agent(state, config)` → single entry point+- `before_model(state, config)` → per-iteration, before model call+- `after_model(response, state, config)` → after model call, can transform response+- `after_tool_call(tool_call, tool_result, state, config)` → per tool execution+- `after_agent(state, config)` → single exit point-### Agent Middleware Implementations-The middleware directory contains 17+ middleware implementations covering:+Each middleware can inject commands to jump to different nodes, modify state, or abort execution.++### Middleware Implementations (20+ in `/agents/middleware/`)- **Model-level**: `ModelRetryMiddleware`, `ModelCallLimitMiddleware`, `ModelFallbackMiddleware`- **Tool-level**: `ToolRetryMiddleware`, `ToolCallLimitMiddleware`, `ToolErrorMiddleware`, `ToolEmulator`- **Context**: `HumanInTheLoopMiddleware`, `ContextEditingMiddleware`, `FilesystemFileSearchMiddleware`-- **Safety/Redaction**: `PIIMiddleware`, `RedactionMiddleware` (internal)-- **Execution Control**: `ShellToolMiddleware`, `ProviderToolSearchMiddleware`+- **Safety/Redaction**: `PIIMiddleware`, `RedactionMiddleware`, `ShellToolMiddleware`+- **Execution Control**: `ProviderToolSearchMiddleware`- **Optimization**: `SummarizationMiddleware`, `TodoListMiddleware`- **Selection**: `LLMToolSelectorMiddleware`- **Lifecycle**: `TracePolicy` configuration and execution tracingEach middleware is independently configurable and composable into agent construction chains.-### Runnable Composition+### Runnable Composition ProtocolThe Runnable protocol in `repo://libs/core/langchain_core/runnables/base.py` enables declarative chaining via operators:-- **Piping** (`|`): Sequential composition-- **Parallel** (`+`): Parallel execution branches-- **Branching** (`.pipe()` with routing): Conditional execution paths-- **Fallback** (`.with_fallback()`): Error recovery with alternatives-- **Retry** (`.with_retry()`): Automatic retry with backoff--All compositions automatically support `invoke()`, `ainvoke()`, `batch()`, `stream()`, and async variants.--### Message Protocol+- **Piping** (`|`): Sequential composition, threads output to next input+- **Parallel** (`+`): Parallel execution of branches, collects results+- **Branching** (`.pipe()` with routing): Conditional execution paths based on state+- **Fallback** (`.with_fallback()`): Error recovery with alternative runnables+- **Retry** (`.with_retry()`): Automatic retry with exponential backoff++All compositions automatically support:+- `invoke(input, config=None)` → sync execution+- `ainvoke(input, config=None)` → async execution+- `batch(inputs, config=None, ...)` → parallel batch processing+- `stream(input, config=None)` → streaming output chunks+- `astream()`, `batch_as_completed()`, and other variants++### Message Protocol & Content BlocksThe message abstraction in `repo://libs/core/langchain_core/messages/` defines:- **Message types**: `AIMessage`, `HumanMessage`, `SystemMessage`, `ToolMessage`, `FunctionMessage`+- **Content representation**: Messages store `content` as either:+ - `str` for simple text+ - `list[ContentBlock]` for mixed content (text, images, tool use, etc.)- **Content blocks**: `TextBlock`, `ImageBlock`, `ToolUseBlock`, `ToolResultBlock`, custom blocks-- **Message utilities**: Serialization, merging, role mapping, model-specific translation+- **Message utilities**:+ - Serialization/deserialization via `dumps()`, `loads()`+ - Message merging and deduplication+ - Role mapping for different model APIs+ - Model-specific translation (e.g., OpenAI format conversion)-### Tool Abstraction+### Tool Abstraction & BindingThe `BaseTool` in `repo://libs/core/langchain_core/tools/base.py` provides:-- **Tool protocol**: Sync/async invoke, schema generation from docstrings/Pydantic-- **Conversion**: Helper functions to wrap Python functions as tools-- **Rendering**: Format tools for model context as descriptions or structured schemas+- **Tool protocol**:+ - Sync/async invoke methods+ - Schema generation from docstrings and Pydantic models+ - Argument validation and type coercion+- **Tool conversion** (via `convert.py`):+ - `tool()` decorator for functions → StructuredTool+ - Pydantic model → Tool with JSON schema+ - Custom tool builders+- **Tool rendering** (via `render.py`):+ - Format tools for model context+ - Description-only for prompt inclusion+ - Structured schemas for function calling++Tool binding in chat models:+```python+model.bind_tools([tool1, tool2]) # Binds tools via provider API+```++### Output Parser Hierarchy+- **BaseOutputParser**: Abstract base for all parsers+- **PydanticOutputParser**: Validates against Pydantic model+- **JsonOutputParser**: Parses JSON text into dict+- **XmlOutputParser**: Parses XML structured output+- **OpenAI tool/function parsers**: Handle tool call and function call formats+- **Custom parsers**: User-defined parsing logic## Dependency Flow```User Applications├─→ langchain (v1.4.6)- │ ├─→ langchain-core (v1.6.11)- │ └─→ LangGraph (state machines)+ │ ├─→ langchain-core (v1.6.12)+ │ └─→ LangGraph (state machines, runtime)│├─→ langchain-core (direct use)+ │ └─→ LangSmith (tracing), httpx (HTTP), tenacity (retry), pydantic+ │+ ├─→ langchain-classic (v1.0.8) [backward compat]+ │ └─→ langchain-core, SQLAlchemy, LangSmith│└─→ Partner Packages (langchain-openai, langchain-anthropic, etc.)- └─→ Implement langchain-core abstractions+ ├─→ langchain-core (pinned versions)+ └─→ Provider SDKs (openai, anthropic, etc.)```-**Versioning**: Core is released independently with strict semantic versioning. LangChain and partners pin core versions. Partner packages are released independently per provider.+**Versioning Model**:+- Core is released independently with strict semantic versioning+- LangChain and partners pin core versions with lower bounds+- Partner packages are released independently per provider+- Standard-tests library contains shared conformance contracts++## Extension Points++### Adding Custom Chat Model+1. Extend `BaseChatModel` from `langchain_core.language_models.chat_models`+2. Implement: `_generate()`, `_stream()`, `_invoke()` methods+3. Register in `init_chat_model()` via `_BUILTIN_PROVIDERS` dict+4. Inherit callback support, streaming, token counting, structured output from base++### Adding Custom Retriever+1. Extend `BaseRetriever` from `langchain_core.retrievers`+2. Implement: `_get_relevant_documents()`, `_aget_relevant_documents()`+3. Automatic integration with callback system and streaming++### Adding Custom Output Parser+1. Extend `BaseOutputParser` from `langchain_core.output_parsers`+2. Implement: `parse()` method (and `aparse()` for async)+3. Optionally implement `get_format_instructions()` for prompt injection++### Adding Custom Tool+1. Extend `BaseTool` or use `@tool` decorator+2. Implement `_run()` (and `_arun()` for async)+3. Schema automatically generated from docstrings and Pydantic annotations++### Adding Custom Runnable+1. Extend `Runnable[Input, Output]` or `RunnableSerializable`+2. Implement: `invoke()`, `stream()`, `batch()` (async variants optional)+3. Automatically compose with operators: `|`, `+`, `.with_fallback()`, etc.diff --git a/openwiki/streaming.md b/openwiki/streaming.mdindex 163b0ec338..05917bbf73 100644--- a/openwiki/streaming.md+++ b/openwiki/streaming.md@@ -29,7 +29,7 @@ sources:generated: { by: "openwiki/0.5.0", at: "2026-10-16T08:25:55.096Z" }verified:- by: openwiki/0.5.0- at: 2026-10-16T08:25:55.096Z+ at: 2026-10-20T08:25:57.412Z---## Overviewdiff --git a/openwiki/structured-output.md b/openwiki/structured-output.mdindex 1c7ffe59b9..0493af8fce 100644--- a/openwiki/structured-output.md+++ b/openwiki/structured-output.md@@ -5,7 +5,7 @@ description: "Document the structured output system: response format specificatitags: [structured-output, response-format, agent, schema, validation, middleware]verified:- by: openwiki/0.5.0- at: 2026-09-28T08:35:20.640Z+ at: 2026-10-20T08:25:57.412Zsources:- id: openwiki-source-71e882e1ac9757ea8e959a7cresource: repo://libs/langchain_v1/langchain/agents/factory.pydiff --git a/openwiki/tools.md b/openwiki/tools.mdindex aacbd94f08..87093173fc 100644--- a/openwiki/tools.md+++ b/openwiki/tools.md@@ -4,6 +4,8 @@ title: "Tools and Tool Binding"description: "LangChain's tool system enables agents and language models to execute structured actions through schema-aware components with automatic validation, error handling, and callback integration."tags: ["tool", "agent", "schema", "runnable", "execution"]sources:+ - id: openwiki-source-c52037e7b642f7ac5a7642a8+ resource: repo://libs/core/langchain_core/language_models/chat_models.py- id: openwiki-source-9861ba5cf0c42c142cf732f9resource: repo://libs/core/langchain_core/messages/tool.py- id: openwiki-source-4ff475d7b00540f962384251@@ -16,10 +18,14 @@ sources:resource: repo://libs/core/langchain_core/tools/simple.py- id: openwiki-source-b816e651a5890bde13cf8013resource: repo://libs/core/langchain_core/tools/structured.py-generated: { by: "openwiki/0.5.0", at: "2026-09-21T08:30:16.745Z" }+ - id: openwiki-source-716439ad921db0ba7cb11ebf+ resource: repo://libs/core/langchain_core/utils/function_calling.py+ - id: openwiki-source-71e882e1ac9757ea8e959a7c+ resource: repo://libs/langchain_v1/langchain/agents/factory.py+generated: { by: "openwiki/0.5.0", at: "2026-10-20T08:25:57.412Z" }verified:- by: openwiki/0.5.0- at: 2026-10-16T08:25:55.096Z+ at: 2026-10-20T08:25:57.412Z---## Overview@@ -242,6 +248,81 @@ Models receive tool schemas in provider-specific formats (OpenAI function_callinThe `tool_call_schema` property ensures models never see injected arguments or reserved parameter names, protecting tool implementation details.+## Tool Binding to Language Models++**bind_tools() Method:**++The `bind_tools()` method on chat models configures a model instance to emit and respond to tool calls:++```python+from langchain_openai import ChatOpenAI+from langchain_core.tools import tool++@tool+def search(query: str) -> str:+ """Search for information."""+ return f"Results for {query}"++model = ChatOpenAI(model="gpt-4")+bound_model = model.bind_tools([search])++# Now the bound model returns AIMessage with tool_calls+response = bound_model.invoke("Find information about Python")+# response.tool_calls = [{"name": "search", "args": {"query": "..."}, "id": "..."}]+```++**Provider-Specific Implementation:**++Different model providers format tools differently:+- **OpenAI**: Converts tool_call_schema to function definitions with JSON schema parameters via `convert_to_openai_function()`+- **Anthropic**: Formats tools for Anthropic's tool_use block specification+- **Other providers**: May have custom tool rendering logic++Each model's `bind_tools()` implementation:+1. Accepts BaseTool instances or raw dicts/callables+2. Converts tools to provider-specific schemas via provider utility functions+3. Binds the formatted tools to model invocation, returning a new Runnable+4. Sets `tool_choice` parameter to control whether the model must use a tool++**Tool Choice Strategies:**++The `tool_choice` parameter controls model behavior:+- `None` (default): Model may or may not use tools+- `"any"` or `"auto"`: Model may use any available tool+- `"tool_name"`: Model must use the specified tool+- Provider may support additional strategies (e.g., OpenAI's "required")++## ToolNode: Agent Graph Tool Dispatcher++**ToolNode in Agent Graphs:**++ToolNode (from LangGraph) is a specialized graph node that executes tool calls extracted from model responses. It:++1. Receives AIMessage with tool_calls from the model+2. Extracts ToolCall dicts: `[{"name": "...", "args": {...}, "id": "..."}]`+3. Looks up corresponding BaseTool instances by name+4. Invokes each tool with `tool_call_id` to enable structured error handling+5. Returns list of ToolMessage objects with matching tool_call_id for model feedback+6. Handles errors per tool's `handle_tool_error` configuration++**Integration with Agent State:**++When integrated into the agent graph, ToolNode:+- Reads tool calls from `AIMessage` in the state's messages+- Resolves tool names against the agent's tool registry+- Executes tools in parallel or sequentially based on configuration+- Wraps results in ToolMessage with `tool_call_id` and `status`+- Appends ToolMessages to state, which re-enter the model on the next iteration++**Error Handling:**++ToolNode respects each tool's error handling configuration:+- `handle_tool_error=False`: Exceptions propagate (graph execution halts)+- `handle_tool_error=True` or `string`: Error is returned as ToolMessage with status="error"+- `handle_tool_error=callable`: Custom handler transforms exception to message++This allows agents to gracefully recover from tool failures without breaking the execution loop.+## Advanced Patterns: Injected Arguments and ToolRuntimeTools can receive runtime values not controlled by the model via injected arguments.@@ -499,6 +580,26 @@ Invalid docstrings (missing Args section, args not in signature, malformed) raisSet `verbose=True` to log tool execution. Combined with callback managers for comprehensive observability.+## Tool Call Extraction and Validation++Models return tool calls embedded in AIMessage objects when bound with tools. The extraction and validation process:++1. **Parsing:** Models emit structured JSON in tool_calls field of AIMessage+2. **Extraction:** ToolNode or custom code accesses `message.tool_calls` list+3. **Validation:** Each ToolCall dict contains name, args (JSON), and id+4. **Resolution:** Tool name is looked up against the agent's tool registry+5. **Input Validation:** Tool's args_schema validates the args dict via Pydantic+6. **Execution:** Tool is invoked with validated args and tool_call_id++**Invalid Tool Calls:**++Models may emit invalid tool calls:+- Unknown tool name: ToolNode reports error via ToolMessage with status="error"+- Invalid JSON args: Validation error caught per handle_validation_error+- Missing required args: Pydantic ValidationError during schema validation++These errors are returned to the model as ToolMessage, allowing it to correct and retry.+## Summary: When to Use Each Pattern- **@tool decorator:** Primary pattern for converting functions to tools; use with type hints for automatic schema inference@@ -508,3 +609,5 @@ Set `verbose=True` to log tool execution. Combined with callback managers for co- **convert_runnable_to_tool():** Wrapping existing Runnables as tools with consistent invocation- **Injected arguments:** Share runtime context (state, store, call IDs) without model visibility- **Custom error handlers:** Transform Pydantic or tool errors into user-friendly messages for agents+- **bind_tools():** Configure language models to call tools; use with agents or structured output patterns+- **ToolNode:** Execute tool calls in agentic loops; handles ToolCall extraction, resolution, validation, and executiondiff --git a/openwiki/unit-tests.md b/openwiki/unit-tests.mdindex b2339ebfca..e789c85d3b 100644--- a/openwiki/unit-tests.md+++ b/openwiki/unit-tests.md@@ -45,7 +45,7 @@ sources:generated: { by: "openwiki/0.5.0", at: "2026-09-28T08:35:20.640Z" }verified:- by: openwiki/0.5.0- at: 2026-10-16T08:25:55.096Z+ at: 2026-10-20T08:25:57.412Z---## Overview