feat(http): add HTTP interception packages#80
Draft
dcramer wants to merge 1 commit into
Draft
Conversation
Add engine-neutral HTTP fixture and replay helpers that share the core replay cassette behavior. Add a Vercel Sandbox adapter for forwarded egress requests with direct fixtures, replay fallback, and live fetch routing. Co-Authored-By: OpenAI Codex <codex@openai.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add HTTP interception packages for eval traffic that leaves the process through HTTP rather than local tool wrappers. The base package provides direct fixtures and record/replay cassettes on top of the existing replay primitive, and the Vercel Sandbox package adapts forwarded egress requests into that generic interceptor flow.
Current State
This PR introduces
@vitest-evals/httpwith route-style fixtures (httpFixture.get/post/...), fixture chaining, live fetch fallback, replay fallback on top ofexecuteWithReplay, sensitive header redaction, serialized request/response recordings, and replay metadata attached to returned responses.It also introduces
@vitest-evals/http-vercel-sandboxfor Vercel forwarded-header parsing, upstream request reconstruction, proxy-only/hop-by-hop header stripping, direct fixture routing, interceptor/replay fallback, provider metadata, and optional live fetch routing. Docs and README references are in place.Goals
Provide a higher-level HTTP interception path for eval traffic that leaves the process through sandbox/proxy/fetch behavior, so this can become the replacement direction for local tool replay where HTTP is the real integration boundary.
Keep the generic HTTP layer engine-neutral while isolating Vercel-specific forwarding in
packages/http-vercel-sandbox, leaving room for Docker, Playwright/MSW, or other adapters.Remaining Work
This is not yet a full Junior drop-in. The Vercel adapter does not own Junior-shaped OIDC verification, requester authorization, credential lease issuance, lease invalidation after 401/403, or egress policy decisions.
We should add structured proxy failure responses, lifecycle hooks for logging/audit/credential cleanup, fixture ergonomics for larger mock catalogs, and reporter integration so HTTP replay status shows up alongside tool replay metadata.