Repository navigation
Commit 077824c
committed
fix(feishu): disable ambient proxy inheritance for WebSocket by default
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 #657991 parent 14a113f commit 077824c
2 files changed
Lines changed: 23 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
401 | 401 | | |
402 | 402 | | |
403 | 403 | | |
404 | | - | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
405 | 418 | | |
406 | 419 | | |
407 | 420 | | |
| |||
411 | 424 | | |
412 | 425 | | |
413 | 426 | | |
414 | | - | |
| 427 | + | |
| 428 | + | |
415 | 429 | | |
416 | 430 | | |
417 | 431 | | |
| |||
421 | 435 | | |
422 | 436 | | |
423 | 437 | | |
424 | | - | |
| 438 | + | |
| 439 | + | |
425 | 440 | | |
426 | 441 | | |
427 | 442 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
86 | 87 | | |
87 | 88 | | |
88 | 89 | | |
| |||
91 | 92 | | |
92 | 93 | | |
93 | 94 | | |
94 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
95 | 99 | | |
96 | 100 | | |
97 | 101 | | |
| |||
0 commit comments