Repository navigation
fix(replay): send through the upstream's own client, like forwarding does - #173
Merged
Merged
Conversation
…does Replay sent the request with the gateway's shared client, which reads the system proxy. A `direct` upstream on 127.0.0.1 therefore went through the system proxy on replay (and came back as the proxy's 503 page), while the data plane reaches it directly; an upstream with a named proxy bypassed that proxy on replay. Replay now uses the same per-upstream client the data plane uses, for both the credential exchange and the request. The shared fallback client (used only when an upstream is missing from the current runtime) is now direct too, matching its doc and the `direct` default. `ControlState::http()` had no other caller and is gone. The probe, model-list and latency (L1/L3) paths already use the upstream's own client or its configured hop. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
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.
Replaying a request whose upstream is `http://127.0.0.1:…\` came back as a system proxy's 503 page. Replay used the gateway's shared `reqwest` client, which reads the system proxy, while the data plane uses each upstream's own client (`direct` = no proxy at all, a named proxy = that proxy).
Other control-plane paths that reach upstreams were checked: the connection test and model list use `probe` with the upstream's client, L3 speed test uses `client_for`, L1 builds its hop from the upstream's proxy setting, ChatGPT/Z.ai logins use `client_for_provider`. Only replay was off.
Tests (`crates/tw-control/tests/replay.rs`): with a fake system proxy in the environment answering 503,
Both fail on the old code.
🤖 Generated with Claude Code