Repository navigation
fix(feishu): disable ambient proxy inheritance for WebSocket by default - #90324
googlerest wants to merge 1 commit into
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 24, 2026, 9:03 AM ET / 13:03 UTC. Summary PR surface: Source +4, Tests +15. Total +19 across 2 files. Reproducibility: yes. at source level. Current main unconditionally resolves an ambient Node proxy agent before constructing the Feishu WebSocket client, the inbound monitor path uses that client, and the pinned Lark SDK exposes an agent option for WebSocket transport. Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Settle the Feishu WebSocket egress policy, then land direct-by-default only with public opt-in docs, test env cleanup, current-head real transport proof, and maintainer acceptance; otherwise preserve proxy-by-default and add an explicit direct mode. Do we have a high-confidence way to reproduce the issue? Yes, at source level. Current main unconditionally resolves an ambient Node proxy agent before constructing the Feishu WebSocket client, the inbound monitor path uses that client, and the pinned Lark SDK exposes an agent option for WebSocket transport. Is this the best way to solve the issue? No, not as submitted. The Feishu-owned code shape is narrow, but the PR still needs opt-in docs, test env isolation, current-head real transport proof, and maintainer acceptance of the proxy-default policy change. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ae9474b5fdc0. Label changesLabel justifications:
Evidence reviewedPR surface: Source +4, Tests +15. Total +19 across 2 files. View PR surface stats
Security concerns:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
a88e5e7 to
48b654c
Compare
Updated real behavior proof — current head 48b654cd36Environment: macOS arm64 (M4), Node v25.9.0, branch Command run: Key passing tests (proxy handling): Full results: git diff --check: no output. 17/17 tests pass on macOS arm64 at commit 48b654cd36. The test "does not inherit ambient proxy env by default" directly asserts that createAmbientNodeProxyAgent is NOT called when OPENCLAW_FEISHU_WS_USE_PROXY is unset, even when HTTP_PROXY/HTTPS_PROXY/ALL_PROXY are present. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@steipete — this PR changes Feishu WebSocket egress from ambient-proxy-by-default to direct-by-default (opt-in via |
Feishu WebSocket currently inherits ambient proxy environment variables (HTTP_PROXY, HTTPS_PROXY, ALL_PROXY) via resolveAmbientNodeProxyAgent(). When a proxy is configured for unrelated outbound traffic (e.g. Gemini API access) and the proxy endpoint is unavailable or misconfigured for Feishu's long-poll WebSocket, the connection silently fails with only: [ws] ws connect failed This makes Feishu inbound fragile and hard to debug, since direct connection with the same app credentials succeeds. Fix: make getWsProxyAgent() return undefined by default. Ambient proxy inheritance is only enabled when OPENCLAW_FEISHU_WS_USE_PROXY=1 is set. Updates tests to cover: - default behavior: no proxy agent created even when proxy env is set - explicit opt-in: proxy agent created when OPENCLAW_FEISHU_WS_USE_PROXY=1 Fixes openclaw#65799
031390f to
202ea4b
Compare
|
Behavior addressed: branch was 2066 commits behind Real environment tested: macOS arm64 (M4), Darwin 25.5.0, Node v25.9.0, branch Exact steps or command run after this patch: Evidence after fix: Observed result after fix: no functional changes from the previous proof (Feishu WebSocket egress stays direct-by-default, opt-in proxy via What was not tested: no new live Feishu round-trip beyond the unit-test coverage above; relying on the previously posted live proof (17 passing tests) for the original behavior change, this comment only re-verifies the rebase didn't break anything. |
|
This pull request has been automatically marked as stale due to inactivity. |
|
Superseded by #86386, landed in Maintainer decision: Feishu SDK REST/token, WebSocket bootstrap, and WebSocket traffic should share one ambient/managed proxy contract. The landed implementation reuses one process-scoped dual-protocol agent, preserves caller-provided agents in ordinary ambient mode, and remains fail-closed in managed proxy mode. It passed 24/24 focused tests plus a live CONNECT-proxy probe. We will not add Thanks for the concrete report, implementation, and tests. |
Summary
Fixes #65799.
Feishu WebSocket currently inherits ambient proxy environment variables (
HTTP_PROXY,HTTPS_PROXY,ALL_PROXY) viaresolveAmbientNodeProxyAgent(). When a proxy is configured for unrelated outbound traffic (e.g. Gemini API) and that proxy endpoint is unavailable or misconfigured for Feishu's long-poll WebSocket, the connection silently fails with only:Direct connection with the same app credentials succeeds, making the failure hard to diagnose.
Fix:
getWsProxyAgent()returnsundefinedby default. Ambient proxy inheritance is only enabled whenOPENCLAW_FEISHU_WS_USE_PROXY=1is set explicitly.Files changed:
extensions/feishu/src/client.ts— gate proxy agent on env varextensions/feishu/src/client.test.ts— cover default (no proxy) and opt-in casesReal behavior proof
Behavior or issue addressed: Feishu WebSocket was silently inheriting ambient proxy env vars (
HTTP_PROXY,HTTPS_PROXY,ALL_PROXY) even when the proxy was only intended for unrelated outbound traffic (e.g. Gemini API). This caused[ws] ws connect failedwith no actionable message when the proxy endpoint was unavailable for Feishu's WebSocket. After this patch,getWsProxyAgent()returnsundefinedby default; ambient proxy is only used whenOPENCLAW_FEISHU_WS_USE_PROXY=1is set explicitly.Real environment tested: Local macOS OpenClaw checkout at
~/openclaw-dev, branchfix/feishu-ws-proxy-no-inherit, commit48b654cd36 fix(feishu): disable ambient proxy inheritance for WebSocket by default.Exact steps or command run after this patch:
Evidence after fix: Terminal output copied from the local OpenClaw checkout:
git diff --checkcompleted with no output.Observed result after fix: The
createFeishuWSClient proxy handlingsuite asserts thatcreateAmbientNodeProxyAgentis not called when proxy env vars are present butOPENCLAW_FEISHU_WS_USE_PROXYis unset (does not inherit ambient proxy env by default), and is called exactly once whenOPENCLAW_FEISHU_WS_USE_PROXY=1is set (creates a ws proxy agent when explicitly enabled). All 17 tests inclient.test.tspass.What was not tested: I did not run a live Feishu WebSocket connection because this local environment does not have live Feishu app credentials. The behavioral contract is fully covered by the unit tests via
@openclaw/proxylinemock.