Skip to content

Conversation

@GreyCrossX
Copy link

This PR adds a regression test covering the JSON Schema $ref pattern found in
MCP-style schemas, where a $ref points into a list-based structure such as:

#/properties/body/anyOf/1/properties/Message/properties/bccRecipients/items

This pattern historically failed due to incorrect handling of numeric list
components in _retrieve_ref. The underlying bug has since been fixed, and
this test ensures coverage so we don't regress on list-index $ref resolution.

The new test (test_dereference_refs_list_index_items_ref_mcp_like) verifies:

  • correct traversal into anyOf[1]
  • proper dereferencing of items.$ref
  • no errors thrown
  • ccRecipients.items is identical to the resolved schema of bccRecipients.items

No code changes are included, just the one test — this PR adds coverage to preserve the expected
behavior and documents support for this real-world MCP schema pattern.

Related to #32012.

@GreyCrossX GreyCrossX requested a review from eyurtsev as a code owner November 25, 2025 00:55
@github-actions github-actions bot added core Related to the package `langchain-core` tests labels Nov 25, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Nov 25, 2025

CodSpeed Performance Report

Merging #34097 will not alter performance

Comparing GreyCrossX:mikeathie/add_test_json_schema (3f99d4e) with master (c375732)1

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

Summary

✅ 13 untouched
⏩ 21 skipped2

Footnotes

  1. No successful run was found on master (7fe1c4b) during the generation of this report, so c375732 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

  2. 21 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Related to the package `langchain-core` tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant