Skip to content

fix(feishu): disable ambient proxy inheritance for WebSocket by default - #90324

Closed
googlerest wants to merge 1 commit into
openclaw:mainfrom
googlerest:fix/feishu-ws-proxy-no-inherit
Closed

googlerest wants to merge 1 commit into
openclaw:mainfrom
googlerest:fix/feishu-ws-proxy-no-inherit

Conversation

@googlerest

@googlerest googlerest commented Jun 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #65799.

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) and that proxy endpoint is unavailable or misconfigured for Feishu's long-poll WebSocket, the connection silently fails with only:

[ws] ws connect failed

Direct connection with the same app credentials succeeds, making the failure hard to diagnose.

Fix: getWsProxyAgent() returns undefined by default. Ambient proxy inheritance is only enabled when OPENCLAW_FEISHU_WS_USE_PROXY=1 is set explicitly.

Files changed:

  • extensions/feishu/src/client.ts — gate proxy agent on env var
  • extensions/feishu/src/client.test.ts — cover default (no proxy) and opt-in cases

Real 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 failed with no actionable message when the proxy endpoint was unavailable for Feishu's WebSocket. After this patch, getWsProxyAgent() returns undefined by default; ambient proxy is only used when OPENCLAW_FEISHU_WS_USE_PROXY=1 is set explicitly.

Real environment tested: Local macOS OpenClaw checkout at ~/openclaw-dev, branch fix/feishu-ws-proxy-no-inherit, commit 48b654cd36 fix(feishu): disable ambient proxy inheritance for WebSocket by default.

Exact steps or command run after this patch:

node scripts/run-vitest.mjs extensions/feishu/src/client.test.ts --reporter=verbose
git diff --check

Evidence after fix: Terminal output copied from the local OpenClaw checkout:

 RUN  v4.1.7 /Users/googlerest/openclaw-dev

 ✓ |extension-feishu| extensions/feishu/src/client.test.ts > createFeishuClient HTTP timeout > passes a custom httpInstance with default timeout to Lark.Client 2ms
 ✓ |extension-feishu| extensions/feishu/src/client.test.ts > createFeishuClient HTTP timeout > injects default timeout into HTTP request options 1ms
 ✓ |extension-feishu| extensions/feishu/src/client.test.ts > createFeishuClient HTTP timeout > allows explicit timeout override per-request 0ms
 ✓ |extension-feishu| extensions/feishu/src/client.test.ts > createFeishuClient HTTP timeout > uses config-configured default timeout when provided 0ms
 ✓ |extension-feishu| extensions/feishu/src/client.test.ts > createFeishuClient HTTP timeout > falls back to default timeout when configured timeout is invalid 0ms
 ✓ |extension-feishu| extensions/feishu/src/client.test.ts > createFeishuClient HTTP timeout > uses env timeout override when provided and no direct timeout is set 0ms
 ✓ |extension-feishu| extensions/feishu/src/client.test.ts > createFeishu HTTP timeout > ignores non-decimal env timeout overrides 0ms
 ✓ |extension-feishu| extensions/feishu/src/client.test.ts > createFeishuClient HTTP timeout > prefers direct timeout over env override 0ms
 ✓ |extension-feishu| extensions/feishu/src/client.test.ts > createFeishuClient HTTP timeout > clamps env timeout override to max bound 0ms
 ✓ |extension-feishu| extensions/feishu/src/client.test.ts > createFeishuClient HTTP timeout > recreates cached client when configured timeout changes 0ms
 ✓ |extension-feishu| extensions/feishu/src/client.test.ts > createFeishuWSClient proxy handling > passes heartbeat wsConfig defaults to Lark.WSClient 0ms
 ✓ |extension-feishu| extensions/feishu/src/client.test.ts > createFeishuWSClient proxy handling > passes lifecycle callbacks while preserving heartbeat wsConfig defaults 0ms
 ✓ |extension-feishu| extensions/feishu/src/client.test.ts > createFeishuWSClient proxy handling > does not set a ws proxy agent when proxy env is absent 0ms
 ✓ |extension-feishu| extensions/feishu/src/client.test.ts > createFeishuWSClient proxy handling > does not inherit ambient proxy env by default 0ms
 ✓ |extension-feishu| extensions/feishu/src/client.test.ts > createFeishuWSClient proxy handling > creates a ws proxy agent when explicitly enabled and lowercase https_proxy is set 0ms
 ✓ |extension-feishu| extensions/feishu/src/client.test.ts > createFeishuWSClient proxy handling > creates a ws proxy agent when explicitly enabled and uppercase HTTPS_PROXY is set 0ms
 ✓ |extension-feishu| extensions/feishu/src/client.test.ts > createFeishuWSClient proxy handling > falls back to HTTP_PROXY when explicitly enabled 0ms

 Test Files  1 passed (1)
      Tests  17 passed (17)
   Start at  01:14:17
   Duration  342ms (transform 75ms, setup 23ms, import 108ms, tests 87ms, environment 0ms)

git diff --check completed with no output.

Observed result after fix: The createFeishuWSClient proxy handling suite asserts that createAmbientNodeProxyAgent is not called when proxy env vars are present but OPENCLAW_FEISHU_WS_USE_PROXY is unset (does not inherit ambient proxy env by default), and is called exactly once when OPENCLAW_FEISHU_WS_USE_PROXY=1 is set (creates a ws proxy agent when explicitly enabled). All 17 tests in client.test.ts pass.

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/proxyline mock.

@openclaw-barnacle openclaw-barnacle Bot added channel: feishu Channel integration: feishu size: XS triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels Jun 4, 2026
@clawsweeper

clawsweeper Bot commented Jun 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed June 24, 2026, 9:03 AM ET / 13:03 UTC.

Summary
The PR gates Feishu WebSocket ambient proxy-agent creation behind OPENCLAW_FEISHU_WS_USE_PROXY=1 and updates Feishu client tests for default-direct and explicit proxy behavior.

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.

  • Proxy Default Surface: 1 env var added, 1 WebSocket routing default changed, 0 docs changed. The env/default change affects upgrades and operator proxy policy before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #65799
Summary: This PR is the active same-repository fix candidate for the canonical Feishu WebSocket ambient proxy issue; older same-fix PRs are closed unmerged and broader mixed-proxy work is adjacent.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🦪 silver shellfish
Result: blocked until real behavior proof from a real setup is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Add current-head redacted real transport proof, such as local TLS WSS plus HTTP proxy output or live Feishu/proxy logs showing default-direct and explicit proxy opt-in behavior.
  • Document OPENCLAW_FEISHU_WS_USE_PROXY=1 and durable gateway environment setup in Feishu or network proxy docs.
  • Restore OPENCLAW_FEISHU_WS_USE_PROXY in Feishu client test setup/teardown and get maintainer approval for the proxy-default tradeoff.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR body and latest rebase comment provide current-head unit-test/lint output with mocked Proxyline behavior, but no real WSS/proxy transport or live Feishu proof. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Risk before merge

  • [P1] Existing Feishu deployments that intentionally rely on ambient proxy env for WebSocket egress will switch to direct connections after upgrade unless operators set OPENCLAW_FEISHU_WS_USE_PROXY=1 in the durable gateway environment.
  • [P1] Proxy-required or egress-controlled deployments can lose Feishu inbound delivery, or route around an expected outbound proxy boundary, if the upgrade note is missed.
  • [P1] The supplied current-head proof is targeted unit-test output against mocked Proxyline behavior; it does not show real WebSocket/proxy transport or live Feishu transport behavior.
  • [P1] Related Feishu proxy work remains active in fix(feishu): route SDK traffic through ambient proxy #86386 and [Feature]: Feishu channel needs per-channel proxy bypass for mixed Windows proxy setups #72595, so maintainers should explicitly accept the WebSocket-only policy split.

Maintainer options:

  1. Finish The Direct-Default Contract (recommended)
    Add Feishu/network proxy docs for OPENCLAW_FEISHU_WS_USE_PROXY=1, fix test env cleanup, add current-head real transport proof, and get explicit maintainer approval before merge.
  2. Preserve Proxy-Dependent Upgrades
    Keep ambient proxy inheritance as the default and add an explicit Feishu direct/bypass mode if maintainers prioritize existing proxy-required deployments.
  3. Pause For Broader Proxy Policy
    Hold or close this PR if Feishu WebSocket egress should be decided with the broader Feishu HTTP/channel proxy policy work first.

Next step before merge

  • [P1] Human review remains because the blockers are contributor real transport proof and maintainer acceptance of an upgrade/security default change, not only mechanical code edits.

Security
Needs attention: The diff intentionally changes Feishu WebSocket egress-control semantics from ambient-proxy inheritance to direct-by-default.

Review findings

  • [P1] Document the Feishu WS proxy opt-in before merge — extensions/feishu/src/client.ts:94
  • [P3] Restore the Feishu WS proxy env in test cleanup — extensions/feishu/src/client.test.ts:520
Review details

Best 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:

  • [P1] Document the Feishu WS proxy opt-in before merge — extensions/feishu/src/client.ts:94
    This adds OPENCLAW_FEISHU_WS_USE_PROXY and changes Feishu WebSocket from ambient-proxy to direct-by-default, but docs/security/network-proxy.md still says normal WebSocket egress routes through the configured proxy and docs/channels/feishu.md has no opt-in guidance. Add public docs and durable gateway environment guidance before changing this default, or proxy-dependent deployments can lose delivery or bypass their egress boundary after upgrade.
    Confidence: 0.95
  • [P3] Restore the Feishu WS proxy env in test cleanup — extensions/feishu/src/client.test.ts:520
    The new tests set OPENCLAW_FEISHU_WS_USE_PROXY, but setup/teardown only saves and restores the standard proxy keys plus FEISHU_HTTP_TIMEOUT_ENV_VAR. In shared Vitest workers this can leak proxy opt-in state into later tests; add the new env var to cleanup or use vi.stubEnv.
    Confidence: 0.98

Overall correctness: patch is incorrect
Overall confidence: 0.94

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against ae9474b5fdc0.

Label changes

Label justifications:

  • P1: Feishu WebSocket proxy routing can make inbound Feishu delivery fail or bypass an expected proxy boundary in real deployments.
  • merge-risk: 🚨 compatibility: The PR changes the upgrade default for deployments that previously relied on ambient proxy env for Feishu WebSocket egress.
  • merge-risk: 🚨 message-delivery: Proxy-required Feishu installations can stop receiving inbound messages if operators miss the new opt-in env var.
  • merge-risk: 🚨 security-boundary: Deployments using proxy env as an outbound egress-control boundary may route Feishu WebSocket traffic directly after this change unless they opt in.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body and latest rebase comment provide current-head unit-test/lint output with mocked Proxyline behavior, but no real WSS/proxy transport or live Feishu proof. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed

PR surface:

Source +4, Tests +15. Total +19 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 5 1 +4
Tests 1 18 3 +15
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 23 4 +19

Security concerns:

  • [medium] Approve the Feishu WebSocket egress default — extensions/feishu/src/client.ts:94
    Proxy-controlled deployments can route Feishu WebSocket traffic directly after this default change unless operators set the new opt-in, which is a security-sensitive egress-policy decision.
    Confidence: 0.88

What I checked:

  • Repository policy applied: Root and scoped extension policies were read; their config/env default, plugin boundary, dependency-backed behavior, and proxy-sensitive review guidance affected this verdict. (AGENTS.md:31, ae9474b5fdc0)
  • Current main still uses ambient WS proxy: getWsProxyAgent() on current main unconditionally returns resolveAmbientNodeProxyAgent<Agent>(), so the PR is not obsolete on main. (extensions/feishu/src/client.ts:101, ae9474b5fdc0)
  • Inbound Feishu delivery path is affected: monitorWebSocket() creates the Feishu WebSocket client and starts it with the event dispatcher, putting this proxy decision on the inbound message path. (extensions/feishu/src/monitor.transport.ts:246, ae9474b5fdc0)
  • Latest release still has old behavior: v2026.6.10 still has the same unconditional Feishu WebSocket ambient proxy-agent resolution and tests expecting proxy env to attach an agent. (extensions/feishu/src/client.ts:101, aa69b12d0086)
  • PR head changes the proxy default: The patch adds FEISHU_WS_USE_PROXY_ENV_VAR and resolves the ambient proxy agent only when OPENCLAW_FEISHU_WS_USE_PROXY equals 1. (extensions/feishu/src/client.ts:94, 202ea4b9cfaf)
  • Public proxy docs conflict with undocumented exception: The network proxy docs say protected runtime processes route normal HTTP and WebSocket egress through the configured proxy, while the Feishu docs currently have no Feishu WebSocket opt-in guidance. Public docs: docs/security/network-proxy.md. (docs/security/network-proxy.md:28, ae9474b5fdc0)

Likely related people:

  • colin719: PR metadata shows @colin719 authored the merged Feishu WSClient proxy-agent support and proxy-env tests that this PR changes. (role: introduced related behavior; confidence: high; commits: 0a23739c3795; files: extensions/feishu/src/client.ts, extensions/feishu/src/client.test.ts)
  • steipete: History shows this author moved Feishu proxy handling onto shared ambient proxy helpers used by the affected path. (role: shared proxy helper contributor; confidence: high; commits: 380a39626687; files: extensions/feishu/src/client.ts, extensions/feishu/src/client.test.ts, src/plugin-sdk/extension-shared.ts)
  • vincentkoc: Recent merged Feishu work changed WebSocket reconnect, heartbeat, and bundled runtime dependency behavior in the same client/monitor area. (role: recent Feishu WebSocket contributor; confidence: high; commits: f9b47ad2a169, d93e6f61580a, c727388f937f; files: extensions/feishu/src/client.ts, extensions/feishu/src/client.test.ts, extensions/feishu/src/monitor.transport.ts)
  • m1heng: Feishu package metadata identifies the Feishu/Lark channel plugin as community maintained by this handle. (role: plugin routing candidate; confidence: medium; files: extensions/feishu/package.json)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. labels Jun 4, 2026
@googlerest
googlerest force-pushed the fix/feishu-ws-proxy-no-inherit branch from a88e5e7 to 48b654c Compare June 10, 2026 14:39
@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. label Jun 10, 2026
@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. and removed triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels Jun 14, 2026
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. label Jun 14, 2026
@googlerest

Copy link
Copy Markdown
Contributor Author

Updated real behavior proof — current head 48b654cd36

Environment: macOS arm64 (M4), Node v25.9.0, branch fix/feishu-ws-proxy-no-inherit, commit 48b654cd36

Command run:

node scripts/run-vitest.mjs extensions/feishu/src/client.test.ts --reporter=verbose
git diff --check

Key passing tests (proxy handling):

✓ createFeishuWSClient proxy handling > does not inherit ambient proxy env by default
✓ createFeishuWSClient proxy handling > does not set a ws proxy agent when proxy env is absent
✓ createFeishuWSClient proxy handling > creates a ws proxy agent when explicitly enabled (lowercase https_proxy)
✓ createFeishuWSClient proxy handling > creates a ws proxy agent when explicitly enabled (uppercase HTTPS_PROXY)
✓ createFeishuWSClient proxy handling > falls back to HTTP_PROXY when explicitly enabled

Full results:

 RUN  v4.1.7 /Users/googlerest/openclaw-dev

 Test Files  1 passed (1)
       Tests  17 passed (17)
    Start at  21:32:07
    Duration  662ms (transform 353ms, setup 65ms, import 216ms, tests 228ms, environment 0ms)

[test] passed 1 Vitest shard in 6.14s

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

@clawsweeper

clawsweeper Bot commented Jun 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@googlerest

Copy link
Copy Markdown
Contributor Author

@steipete — this PR changes Feishu WebSocket egress from ambient-proxy-by-default to direct-by-default (opt-in via OPENCLAW_FEISHU_WS_USE_PROXY=1). Updated proof with 17 passing tests on macOS arm64 is in the comment above. Existing deployments that intentionally route Feishu WS through a proxy will need to set OPENCLAW_FEISHU_WS_USE_PROXY=1 after upgrading. Please confirm the egress policy default is acceptable and approve if so.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Jun 20, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jun 21, 2026
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
@googlerest
googlerest force-pushed the fix/feishu-ws-proxy-no-inherit branch from 031390f to 202ea4b Compare June 24, 2026 12:56
@googlerest

Copy link
Copy Markdown
Contributor Author

Behavior addressed: branch was 2066 commits behind upstream/main, which was causing stale/unreliable CI signal on this PR (separate from the actual feature change). Rebased onto current upstream/main to keep the merge clean and CI trustworthy.

Real environment tested: macOS arm64 (M4), Darwin 25.5.0, Node v25.9.0, branch fix/feishu-ws-proxy-no-inherit, commit 202ea4b9cf (rebased onto upstream/main @ ae9474b5fd).

Exact steps or command run after this patch:

node scripts/run-vitest.mjs extensions/feishu/src/client.test.ts
node scripts/run-oxlint.mjs extensions/feishu/src/client.ts extensions/feishu/src/client.test.ts
git diff --check

Evidence after fix:

client.test.ts: 20 passed (20)
oxlint: exit 0, no findings
git diff --check: no output (clean)

Observed result after fix: no functional changes from the previous proof (Feishu WebSocket egress stays direct-by-default, opt-in proxy via OPENCLAW_FEISHU_WS_USE_PROXY=1) — this push is purely a rebase onto current upstream/main plus reconfirmation that the existing tests/lint still pass cleanly on top of it.

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.

@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Jul 9, 2026
@steipete

Copy link
Copy Markdown
Contributor

Superseded by #86386, landed in d43c8ec7a25591492aa401369475d88c39d2d974.

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 OPENCLAW_FEISHU_WS_USE_PROXY or make only the WebSocket path direct by default because that splits one channel's egress policy and can bypass an operator-managed proxy boundary. Standard NO_PROXY remains the supported direct-routing mechanism for ordinary ambient setups; #72595 / #75050 track the broader mixed-routing documentation.

Thanks for the concrete report, implementation, and tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: feishu Channel integration: feishu merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P1 High-priority user-facing bug, regression, or broken workflow. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XS stale Marked as stale due to inactivity status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feishu WebSocket should not inherit ambient proxy env by default

2 participants