Skip to content

fix(feishu): restore websocket liveness timeout - #103763

Merged
steipete merged 1 commit into
openclaw:mainfrom
litang9:fix/feishu-ws-ping-timeout
Jul 12, 2026
Merged

steipete merged 1 commit into
openclaw:mainfrom
litang9:fix/feishu-ws-ping-timeout

Conversation

@litang9

@litang9 litang9 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where users relying on the Feishu WebSocket channel could stop receiving messages after a half-open connection because the intended heartbeat liveness timeout was silently ignored.

Why This Change Was Made

The existing code passed PingInterval and PingTimeout, which are server response field names rather than supported WSClient constructor options. This change uses the SDK's typed pingTimeout option, leaves ping cadence server-controlled, and removes the type assertion that previously allowed unsupported keys to bypass TypeScript validation.

User Impact

Feishu WebSocket connections now enable the SDK's three-second post-ping liveness watchdog, allowing stale connections to enter the existing reconnect flow without any operator configuration change.

Evidence

  • Real behavior proof against the pinned @larksuiteoapi/[email protected] constructor:

    {
      "legacyPingTimeoutSec": 0,
      "fixedPingTimeoutSec": 3,
      "legacyPingIntervalMs": 120000,
      "fixedPingIntervalMs": 120000
    }

    This shows the legacy keys left the watchdog disabled, while pingTimeout enables it and preserves the SDK/server-controlled ping interval.

  • Feishu plugin test suite: 75 test files passed, 1,031 tests passed.

  • git diff --check: passed.

  • codex review --base upstream/main: no actionable findings.

  • Not performed: a live forced-disconnect test against a production Feishu app. The constructor probe exercises the real pinned SDK rather than the mocked unit-test boundary.

AI-assisted: Yes. I reviewed the final diff, the pinned SDK source/types, and the validation results.

@openclaw-barnacle openclaw-barnacle Bot added channel: feishu Channel integration: feishu size: XS labels Jul 10, 2026
@litang9
litang9 marked this pull request as ready for review July 10, 2026 15:16
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P1 High-priority user-facing bug, regression, or broken workflow. labels Jul 10, 2026
@clawsweeper

clawsweeper Bot commented Jul 10, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 10, 2026, 11:36 AM ET / 15:36 UTC.

Summary
Changes the Feishu WSClient configuration from unsupported PingInterval and PingTimeout keys to the typed pingTimeout option and updates the adjacent constructor-option tests.

PR surface: Source -3, Tests -2. Total -5 across 2 files.

Reproducibility: yes. at high confidence from source and dependency inspection: OpenClaw passes keys the SDK constructor never reads, leaving the watchdog at zero, and the PR's real constructor output confirms pingTimeout changes it to three seconds. A production half-open connection was not forced during this review.

Review metrics: none identified.

Root-cause cluster
Relationship: canonical
Canonical: #103763
Summary: This PR is the narrow current fix for the liveness-option mismatch; older merged reconnect work provides provenance but does not track remaining work.

Members:

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

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

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

Rank-up moves:

  • none.

Next step before merge

  • [P2] The open PR is already the narrow correct implementation and needs ordinary owner review and landing rather than a separate ClawSweeper repair job.

Security
Cleared: The patch only corrects a typed SDK option and test expectations, with no dependency, credential, permission, install, publishing, or new code-execution surface.

Review details

Best possible solution:

Land the typed SDK-owned pingTimeout setting, remove the assertion that masked unsupported keys, and retain focused coverage that fails if the dependency option contract changes again.

Do we have a high-confidence way to reproduce the issue?

Yes at high confidence from source and dependency inspection: OpenClaw passes keys the SDK constructor never reads, leaving the watchdog at zero, and the PR's real constructor output confirms pingTimeout changes it to three seconds. A production half-open connection was not forced during this review.

Is this the best way to solve the issue?

Yes. Using the dependency's typed pingTimeout, retaining server-authoritative ping cadence, and deleting the unsafe assertion is the narrowest ownership-correct fix; custom heartbeat or reconnect logic would duplicate the SDK and existing transport lifecycle.

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P1: The shipped configuration leaves the Feishu SDK liveness watchdog disabled, allowing a half-open connection to silently stop inbound message delivery.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR includes after-fix output from the real pinned SDK constructor showing the liveness timeout changing from disabled to three seconds while the server-controlled ping interval remains unchanged; this directly demonstrates the behavior altered by the patch.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR includes after-fix output from the real pinned SDK constructor showing the liveness timeout changing from disabled to three seconds while the server-controlled ping interval remains unchanged; this directly demonstrates the behavior altered by the patch.
Evidence reviewed

PR surface:

Source -3, Tests -2. Total -5 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 1 4 -3
Tests 1 2 4 -2
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 3 8 -5

What I checked:

Likely related people:

  • vincentkoc: Authored the merged Feishu heartbeat/reconnect repair and subsequent retry-exhaustion recovery that define the affected WebSocket lifecycle. (role: feature owner and major reconnect contributor; confidence: high; commits: d93e6f61580a, f9b47ad2a169, eb721b0b306f; files: extensions/feishu/src/client.ts, extensions/feishu/src/monitor.transport.ts)
  • steipete: Authored the recent SDK dependency update and multiple nearby Feishu client, test, and transport changes, making this a strong secondary review route. (role: dependency upgrader and recent adjacent contributor; confidence: high; commits: 614e87cce1d4, ac24461252b0, 9dbbd9b5d49b; files: extensions/feishu/package.json, extensions/feishu/src/client.ts, extensions/feishu/src/client.test.ts)
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.

@steipete steipete self-assigned this Jul 11, 2026
@steipete
steipete merged commit a0c4c31 into openclaw:main Jul 12, 2026
243 of 249 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

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

Labels

channel: feishu Channel integration: feishu P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants