Repository navigation
fix(remote-control): honor HTTP proxies for WebSocket connections - #5037
Merged
Merged
Conversation
6 tasks done
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
commit: |
liruifengv
approved these changes
Nov 18, 2026
Merged
devin-ai-integration Bot
added a commit
to 7723qqq/kimi-code
that referenced
this pull request
Nov 24, 2026
Port upstream MoonshotAI#5037: resolve HTTP_PROXY/HTTPS_PROXY/NO_PROXY for the relay connection and tunnel the WebSocket through an HttpsProxyAgent, keeping the loopback bypass from resolveNoProxy. Invalid proxy values fall back to a direct connection with a stderr note. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
devin-ai-integration Bot
added a commit
to 7723qqq/kimi-code
that referenced
this pull request
Nov 24, 2026
…end drift-allow - bun scripts/upstream-ledger.mjs --refresh: 148 new pending rows covering the 2.7.0 tail and upstream/main. - Mark MoonshotAI#5043/MoonshotAI#5037/MoonshotAI#5049 ported (26f22db, 0d20273, d61aacc) and MoonshotAI#5042 equivalent (multiline feedback editor already shipped, localized). - Refresh MoonshotAI#4820 evidence: the machine-architecture blocker retired with the 2.7.0 merge. - drift-allow: add the missing translated/renamed upstream files (media.ts, node-local hostServices/rgLocator/runRg, executor validate.ts, remaining vitest configs) so upstream-drift stops flagging deliberate removals. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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.
Requirement or Bug
Users behind a corporate HTTP proxy cannot establish a Remote Control tunnel: the relay WebSocket connection ignores the
HTTP_PROXY/HTTPS_PROXY/NO_PROXYenvironment variables and always dials the relay directly. This is a re-submission of #5004 (targetingrelease/2026-11-16) againstmain.Bug Reproduction Steps
HTTP_PROXY/HTTPS_PROXYto a working proxy and unset direct egress.kimi remote-control(or any flow that opens the relay tunnel).Root Cause
connectWebSocketinpackages/remote-control/src/remote-control.tsconstructsws.WebSocketwithout anagent, so the connection always goes direct even when proxy env vars are set. Fundamental fix, not a workaround: the relay connection now honors the same proxy resolution (HTTP_PROXY/HTTPS_PROXY/ALL_PROXY/NO_PROXY) that other HTTP traffic in the codebase already uses.Code Changes
packages/agent-core-v2/src/_base/utils/proxy.ts: export the existingresolveHttpProxyUrlshelper so the remote-control package can reuse the same env-var resolution.packages/remote-control/src/remote-control.ts: build one proxy agent per relay origin (createRelayProxyAgent) — resolvesNO_PROXYfirst and skips proxying for matched hosts, pickshttpsProxy/httpProxyby relay scheme, and falls back to a direct connection (with a stderr warning) when the proxy URL is invalid. The agent is threaded through both WebSocket handshake attempts (subprotocol-token and Authorization-header variants).packages/remote-control/package.json: addhttps-proxy-agentdependency (already used elsewhere in the repo).NO_PROXY-bypass-aware path.Behavior Changes and Affected Users
HTTP_PROXY/HTTPS_PROXY/ALL_PROXYNO_PROXYmatchesNO_PROXYAffected: remote-control tunnel connections only; all other HTTP traffic already behaved this way. Covered by the updated end-to-end case in
packages/remote-control/test/remote-control.test.ts.Checklist
/approve).gen-changesetsskill, or this PR needs no changeset. (changeset included)gen-docsskill, or this PR needs no doc update.