Context
VCR-pattern libraries (VCR.py, polly.js, go-vcr) provide "record real API calls, replay them deterministically" patterns for integration testing.
What to yoink
- Record mode — proxy real API calls to OpenAI/Anthropic, capture request/response pairs as "cassettes"
- Replay mode — match incoming requests against recorded cassettes, return deterministic responses
- Request matching — configurable matching (exact, fuzzy, header-ignoring) for finding the right recorded response
- Cassette management — versioned, human-readable recording files (YAML/JSON) that can be committed to repos
Approach
Mocktopus is already a drop-in mock for OpenAI/Anthropic APIs. Adding VCR-style recording makes it useful for a different workflow:
- Record real API interactions during manual testing
- Replay them in CI for deterministic, zero-cost integration tests
- Re-record when prompts or model behavior changes
This complements the existing mock approach — mocks for unit tests, VCR for integration tests.
References
Priority
Tier 3 — Complementary testing mode
Context
VCR-pattern libraries (VCR.py, polly.js, go-vcr) provide "record real API calls, replay them deterministically" patterns for integration testing.
What to yoink
Approach
Mocktopus is already a drop-in mock for OpenAI/Anthropic APIs. Adding VCR-style recording makes it useful for a different workflow:
This complements the existing mock approach — mocks for unit tests, VCR for integration tests.
References
Priority
Tier 3 — Complementary testing mode