Skip to content

fix(feishu): await HTTP server shutdown during monitor cleanup - #92840

Merged
vincentkoc merged 2 commits into
mainfrom
clownfish/ghcrawl-156788-autonomous-smoke
Jun 14, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
clownfish/ghcrawl-156788-autonomous-smoke

Conversation

@openclaw-clownfish

Copy link
Copy Markdown
Contributor

Fixes #48183.

This repairs the existing contributor PR #48588 from @alex-xuweilong rather than opening a competing fix. The source PR already identified the right Feishu-local cleanup race; this pass should keep that attribution while making the branch landable.

Plan:

  • rebase/update fix(feishu): await HTTP server close before clearing state references #48588 against current main 399f5bc
  • share a bounded closeHttpServer helper between monitor state and webhook cleanup
  • wait for close or timeout before deleting httpServers and bot identity state
  • keep server.close() before closeAllConnections() and clear fallback timers on successful close
  • propagate cleanup rejections from monitorWebhook abort paths
  • expose/retain an awaitable stop path where callers need shutdown ordering
  • add focused behavior proof for delayed HTTP close and webhook abort cleanup

Validation:

  • pnpm -s vitest run extensions/feishu/src/monitor.cleanup.test.ts extensions/feishu/src/monitor.webhook-e2e.test.ts
  • pnpm check:changed

Before merge, run a fresh Codex /review and address every actionable finding.

Clownfish 🐠 replacement reef notes:

fish notes: model gpt-5.5, reasoning xhigh; reviewed against b2846f6.

@clawsweeper

clawsweeper Bot commented Jun 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 13, 2026, 10:47 PM ET / 02:47 UTC.

Summary
The PR makes Feishu monitor cleanup await bounded HTTP server shutdown before clearing tracked server and bot identity state, updates the stop wrapper, and adds focused cleanup/webhook tests.

PR surface: Source +124, Tests +270. Total +394 across 9 files.

Reproducibility: yes. at source level: current main still closes Feishu HTTP servers and clears state before the close callback in both stop cleanup and webhook abort cleanup. I did not run a live Feishu restart loop in this read-only review.

Review metrics: none identified.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🌊 off-meta tidepool
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

  • No automated repair lane is needed because the replacement PR has no actionable review findings from this pass.

Security
Cleared: The diff is limited to Feishu-local HTTP shutdown sequencing and tests, with no dependency, workflow, package, auth policy, secret, or publishing-surface change.

Review details

Best possible solution:

Land this Feishu-local replacement after normal CI and maintainer validation, then close the linked bug while leaving broader ResourceManager design to the existing follow-up issues.

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

Yes, at source level: current main still closes Feishu HTTP servers and clears state before the close callback in both stop cleanup and webhook abort cleanup. I did not run a live Feishu restart loop in this read-only review.

Is this the best way to solve the issue?

Yes: the narrow Feishu-local bounded close helper is the best immediate fix shape, and the broader ResourceManager discussion is separate product/API design work.

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add P2: This is a normal-priority Feishu restart/resource-cleanup bug with limited plugin scope but real availability impact.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This is an OpenClaw Clownfish bot replacement PR, so the external-contributor real-behavior proof gate does not require contributor action here.

Label justifications:

  • P2: This is a normal-priority Feishu restart/resource-cleanup bug with limited plugin scope but real availability impact.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This is an OpenClaw Clownfish bot replacement PR, so the external-contributor real-behavior proof gate does not require contributor action here.
Evidence reviewed

PR surface:

Source +124, Tests +270. Total +394 across 9 files.

View PR surface stats
Area Files Added Removed Net
Source 5 158 34 +124
Tests 4 284 14 +270
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 9 442 48 +394

What I checked:

Likely related people:

  • steipete: History shows multiple recent Feishu monitor/transport changes, including the monitor startup/transport split that carried the current cleanup shape. (role: recent area contributor; confidence: high; commits: f46bd2e0cc17, 8be3a4466cbc, 58912f8fd842; files: extensions/feishu/src/monitor.ts, extensions/feishu/src/monitor.state.ts, extensions/feishu/src/monitor.transport.ts)
  • vincentkoc: Recent commits split the monitor state/runtime seams and maintained adjacent Feishu lifecycle code used by this cleanup path. (role: Feishu lifecycle contributor; confidence: high; commits: 2fff6be4c393, 319aa2f1fe67, f9b47ad2a169; files: extensions/feishu/src/monitor.state.ts, extensions/feishu/src/monitor.transport.ts, extensions/feishu/src/monitor.cleanup.test.ts)
  • schumilin: Authored the merged Feishu WebSocket monitor stop/abort cleanup in the same state and cleanup-test area. (role: adjacent cleanup contributor; confidence: medium; commits: bd4237c16c2c; files: extensions/feishu/src/monitor.state.ts, extensions/feishu/src/monitor.cleanup.test.ts)
  • alex-xuweilong: Opened the original linked PR that identified the Feishu-local awaited HTTP close repair this replacement branch preserves and expands. (role: source fix proposer; confidence: medium; commits: 8fc7e52923e4, 284336a89325, 80c074a12a83; files: extensions/feishu/src/monitor.state.ts, extensions/feishu/src/monitor.transport.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.

@clawsweeper clawsweeper Bot added 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. P2 Normal backlog priority with limited blast radius. labels Jun 14, 2026
@vincentkoc
vincentkoc merged commit 9f32bea into main Jun 14, 2026
198 of 203 checks passed
@vincentkoc
vincentkoc deleted the clownfish/ghcrawl-156788-autonomous-smoke branch June 14, 2026 02:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: feishu Channel integration: feishu clownfish Tracked by Clownfish automation P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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.

[Bug]: Feishu monitor state cleanup incomplete - potential memory leak in httpServers Map

1 participant