Skip to content

Record against Req 0.7, where the Finch adapter is a module - #7

Open
johns10 wants to merge 3 commits into
lostbean:mainfrom
johns10:req-0.7-adapter
Open

Record against Req 0.7, where the Finch adapter is a module#7
johns10 wants to merge 3 commits into
lostbean:mainfrom
johns10:req-0.7-adapter

Conversation

@johns10

@johns10 johns10 commented Aug 12, 2026

Copy link
Copy Markdown

forward_and_capture/3 builds its passthrough with adapter: &Req.Steps.run_finch/1. Req 0.7 replaced that function with the Req.Finch adapter module, so on 0.7 the capture raises UndefinedFunctionError as soon as a cassette is recorded.

The failure mode is unusually quiet: replay never reaches this path, so an application that upgrades to Req 0.7 keeps replaying its existing cassettes and looks completely healthy. Nothing surfaces until someone records a new one — in our case months later, and the error (function Req.Steps.run_finch/1 is undefined or private) points at Req rather than at the version constraint that allowed the combination.

  • resolves the adapter at runtime, so a single build works either side of the rename
  • widens the version range to ~> 0.5.15 or ~> 0.6 or ~> 0.7

Happy to add a 0.7 row to the CI compatibility matrix if you'd like it in the same PR — the comment at that call site asks for exactly that, and I did not want to guess at your matrix layout.

🤖 Generated with Claude Code

https://claude.ai/code/session_01M6g6U83HzmVZmeCiyD1Ay4

johns10 and others added 3 commits August 11, 2026 20:02
The record path built its passthrough with `adapter: &Req.Steps.run_finch/1`.
Req 0.7 moved that to the `Req.Finch` adapter module, so the capture raises
UndefinedFunctionError the moment a cassette is written.

Replay never touches this path, so an application on Req 0.7 keeps replaying
its existing cassettes and looks healthy. The breakage only surfaces when
someone records a new one — which is where it is least welcome.

Resolved at runtime so one build works across the rename, and the version
range widened to admit 0.7.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6g6U83HzmVZmeCiyD1Ay4
Naming Steps.run_finch/1 in the fallback branch warns on every build against
Req 0.7, which is the configuration the fallback exists to avoid.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6g6U83HzmVZmeCiyD1Ay4
Sequential replay is strictly positional: interaction N answers request N. But
record mode answers a repeat from the file instead of performing it, so a
request made three times is stored once — and the replay that follows runs out
on the second, reporting no matching interaction for a request the cassette
visibly contains. The diagnostic says as much: method matched, URI matched,
body matched, nothing left.

That combination is easy to reach and hard to read. Anything that polls until
a resource is ready records one poll; a page that re-reads a listing in
reaction to an event records one read. The recording looks complete and the
replay is short by however many repeats happened.

Under sequential the only coherent recording is one interaction per request
actually made, so record every one. Non-sequential cassettes keep collapsing
repeats, which is what you want there.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6g6U83HzmVZmeCiyD1Ay4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant