Skip to content

fix(settings): filter Fetch Metadata headers from Responses proxy - #573

Merged
ewen-poch merged 1 commit into
mainfrom
fix/deepseek-responses-header
Aug 1, 2026
Merged

fix(settings): filter Fetch Metadata headers from Responses proxy#573
ewen-poch merged 1 commit into
mainfrom
fix/deepseek-responses-header

Conversation

@ewen-poch

Copy link
Copy Markdown
Member

Problem

Codex validation for DeepSeek deepseek-v4-flash correctly targets the native Responses endpoint, but the loopback Node fetch adds sec-fetch-mode. The compatibility proxy forwarded that browser-controlled header to Electron net.fetch, which rejects it with net::ERR_INVALID_ARGUMENT before the request reaches DeepSeek.

Proposed change

  • Strip sec-fetch-* Fetch Metadata headers when forwarding loopback requests upstream.
  • Add a regression test that reproduces Electron's rejection at the external fetch seam and verifies the proxy completes the request after filtering.

Scope and non-goals

  • No architecture, data model, data relationship, configuration, or UI changes.
  • No change to DeepSeek model routing: deepseek-v4-flash continues to use /v1/responses under Codex.
  • No dependency or public interface changes.

Acceptance criteria and validation

All checks below ran after the last material edit.

Behavior Command Result
Loopback Fetch Metadata headers no longer trigger the Electron boundary failure npm test -- --run src/main/settings/native-responses-compatibility.test.ts -t "forwards loopback requests without browser-controlled Fetch Metadata headers" Pass: 1 test
Native Responses compatibility and DeepSeek Codex routing remain valid 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" Pass: 9 tests
TypeScript contracts remain valid npm run typecheck Pass
Repository lint gate npm run lint Pass: 0 errors; 23 existing warnings
Full unit/integration suite npm test Pass: 9,073 tests; 140 skipped

Independent review completed with 0 Standards findings and 0 Spec findings.

Review focus

  • Confirm filtering the sec-fetch-* family is appropriately scoped for Electron net.fetch.
  • Confirm required upstream headers other than browser-controlled Fetch Metadata remain forwarded.

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.

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.
@github-actions github-actions Bot added the bug Something isn't working label Aug 1, 2026
@ewen-poch
ewen-poch merged commit b81913d into main Aug 1, 2026
18 of 19 checks passed
@ewen-poch
ewen-poch deleted the fix/deepseek-responses-header branch August 1, 2026 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant