fix(settings): filter Fetch Metadata headers from Responses proxy - #573
Merged
Conversation
Node fetch adds sec-fetch-mode to the loopback validation request. Electron net.fetch rejects that browser-controlled header when it is forwarded explicitly, causing DeepSeek Responses validation to fail before reaching the provider.
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.
Problem
Codex validation for DeepSeek
deepseek-v4-flashcorrectly targets the native Responses endpoint, but the loopback Node fetch addssec-fetch-mode. The compatibility proxy forwarded that browser-controlled header to Electronnet.fetch, which rejects it withnet::ERR_INVALID_ARGUMENTbefore the request reaches DeepSeek.Proposed change
sec-fetch-*Fetch Metadata headers when forwarding loopback requests upstream.Scope and non-goals
deepseek-v4-flashcontinues to use/v1/responsesunder Codex.Acceptance criteria and validation
All checks below ran after the last material edit.
npm test -- --run src/main/settings/native-responses-compatibility.test.ts -t "forwards loopback requests without browser-controlled Fetch Metadata headers"npm test -- --run src/main/settings/native-responses-compatibility.test.ts src/main/settings/service.test.ts -t "native Responses compatibility|probes DeepSeek flash through the native Responses route under Codex"npm run typechecknpm run lintnpm testIndependent review completed with 0 Standards findings and 0 Spec findings.
Review focus
sec-fetch-*family is appropriately scoped for Electronnet.fetch.Uncovered risk
The suite does not use a live valid DeepSeek API key. It covers the local proxy behavior and Electron rejection contract without exercising a billed provider response.