Skip to content

fix: prevent proxied stream crashes and normalize Groq reasoning - #15357

Merged
diegosouzapw merged 2 commits into
diegosouzapw:release/v3.8.52from
kalpakprod:fix/stability-from-production
Oct 6, 2026
Merged

diegosouzapw merged 2 commits into
diegosouzapw:release/v3.8.52from
kalpakprod:fix/stability-from-production

Conversation

@kalpakprod

Copy link
Copy Markdown
Contributor

These fixes were found while running the gateway in production under load.

  • Proxy failures: an escaped PROXY_REQUEST_FAILED could terminate the gateway and cut unrelated in-flight streams → classify it as a recoverable upstream network error while preserving fatal handling for genuine programming errors.
  • SOCKS streaming: HTTP/2 stream resets could escape through the SOCKS transport → pin SOCKS dispatchers to HTTP/1.1.
  • Groq GPT-OSS: foreign reasoning/output_config envelopes and forced none caused invalid requests → strip foreign envelopes and map forced none/low to low for openai/gpt-oss-20b, preserving ordinary model defaults.
  • ChatGPT browser sessions: the current ProseMirror composer was absent from the shared selector → recognize its editable textbox alongside legacy editors.

Validation: Node v26.8.1, dependencies installed with the upstream lockfile (npm ci --ignore-scripts --no-audit --no-fund --maxsockets=4). Eight focused upstream unit suites passed: 39 tests, zero failures or skips. Regression assertions fail against the unchanged upstream source and pass with this patch. ESLint and the repository commit hooks passed. Gitleaks and private-data pattern scans passed for the contribution.

node --import tsx/esm --import ./open-sse/utils/setupPolyfill.ts --import ./tests/_setup/isolateDataDir.ts --test --test-force-exit --test-concurrency=1 tests/unit/provider-field-strips.test.ts tests/unit/groq-field-strip-wiring.test.ts tests/unit/http-client-abort-guard-direct-timeout-12861.test.ts tests/unit/socks-connector-family.test.ts tests/unit/chatgpt-composer-selector.test.ts tests/unit/socks-connect-timeout.test.ts tests/unit/socks-connect-timeout-e2e.test.ts tests/unit/socks-handshake-timeout-5109.test.ts

⚠️ base-red inherited: #15306. The focused suites above pass; the complete upstream unit/Vitest matrix was not run locally.

https://claude.ai/code/session_01BsVwQEhCy4c35aK8tjA9A6

The custom SOCKS connect function bypasses Agent.allowH2, and undici's
buildConnector defaults allowH2 to true, so ALPN still negotiated h2 over
SOCKS proxies. Pass allowH2: false to the inner buildConnector as well.
Verified in production: a SOCKS TLS hop to an h2-capable origin
negotiated h2 before the change and http/1.1 after it, and
ERR_HTTP2_STREAM_ERROR stopped.
@diegosouzapw
diegosouzapw merged commit cda0f92 into diegosouzapw:release/v3.8.52 Oct 6, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants