Repository navigation
Commit 202ea4b
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 ae9474b commit 202ea4b
2 files changed
Lines changed: 23 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
504 | 504 | | |
505 | 505 | | |
506 | 506 | | |
507 | | - | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
508 | 521 | | |
509 | 522 | | |
510 | 523 | | |
| |||
514 | 527 | | |
515 | 528 | | |
516 | 529 | | |
517 | | - | |
| 530 | + | |
| 531 | + | |
518 | 532 | | |
519 | 533 | | |
520 | 534 | | |
| |||
524 | 538 | | |
525 | 539 | | |
526 | 540 | | |
527 | | - | |
| 541 | + | |
| 542 | + | |
528 | 543 | | |
529 | 544 | | |
530 | 545 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| 94 | + | |
94 | 95 | | |
95 | 96 | | |
96 | 97 | | |
| |||
99 | 100 | | |
100 | 101 | | |
101 | 102 | | |
102 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
103 | 107 | | |
104 | 108 | | |
105 | 109 | | |
| |||
0 commit comments