chore(openai): fix broken vcr cassette playback and add ci guard (#36502)

Fix broken VCR cassette playback in `langchain-openai` integration tests
and add a CI job to prevent regressions. Two independent bugs made all
VCR-backed tests fail: `before_record_request` redacts URIs to
`**REDACTED**` but `match_on` still included `uri` (so playback never
matched), and a typo-fix commit (`c9f51aef85`) changed test input
strings without re-recording cassettes (so `json_body` matching also
failed).
This commit is contained in:
Mason Daugherty
2026-04-03 12:55:52 -04:00
committed by GitHub
parent 8c15649127
commit deb85b6c4c
6 changed files with 111 additions and 7 deletions

View File

@@ -32,7 +32,9 @@ def vcr_config() -> dict:
"""Extend the default configuration coming from langchain_tests."""
config = base_vcr_config()
config["match_on"] = [
m if m != "body" else "json_body" for m in config.get("match_on", [])
m if m != "body" else "json_body"
for m in config.get("match_on", [])
if m != "uri"
]
config.setdefault("filter_headers", []).extend(_EXTRA_HEADERS)
config["before_record_request"] = remove_request_headers