Repository navigation
fix(feishu): wait for accepted replay work during shutdown - #150094
Conversation
Join accepted synthetic events, active message handlers and deferred logical replay settlement through the existing account task owner. Preserve queue-first adoption, the five-minute queue limit and accepted card actions across cancellation. Retire failed broadcasts without dropping admitted lane commits.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review blockedAutomated review did not run, so no review verdict was produced. Reason: The input-safety check could not safely complete for this revision. ClawSweeper will not retry this unchanged revision. Next step: No contributor action is requested. Maintainers should inspect the linked workflow run. |
|
Codex review: needs maintainer review before merge. Reviewed September 20, 2026, 5:44 AM ET / 09:44 UTC (Revision 6). ClawSweeper reviewWhat this changesThe Feishu plugin waits for accepted handlers and replay writes before finishing account shutdown, with matching lifecycle tests, SQLite-worker test routing, and documentation. Merge readiness✅ Ready for maintainer review This remains useful work: neither current main nor the latest release contains the complete shutdown repair. No introduced blocking defect was found, and the earlier card-fixture concern is addressed. Priority: P2 Review scores
Verification
How this fits togetherThe Feishu plugin receives messages and interaction events, dispatches agent work, and records replay protection. Its account lifecycle coordinates transport shutdown with pending work before releasing account resources. flowchart TD
A[Feishu messages and interactions] --> B[Account admission check]
B --> C[Durable message ingress]
B --> D[Interaction handlers]
C --> E[Agent dispatch and replay writes]
D --> E
E --> F[Account task tracking]
G[Shutdown request] --> B
G --> F
F --> H[Release account resources]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +126, Tests +789, Docs +2. Total +917 across 35 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep accepted work owned by the existing account lifecycle through final settlement, preserving durable-ingress ordering and existing interaction authorization. Do we have a high-confidence way to reproduce the issue? Yes, from source: defer a logical replay commit until after transport adoption, then stop the account; current main can release account resources before that commit settles. No runtime reproduction was executed during this review. Is this the best way to solve the issue? Yes. Extending account task ownership covers detached settlement without duplicating durable ingress, changing stored data, or expanding the public plugin API. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e71ac748fccb. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
Related: #150135
What Problem This Solves
Feishu account shutdown could finish while accepted synthetic events or deferred message and broadcast replay work still owned pending writes, including handlers whose five-minute per-chat ordering slot had already expired.
User Impact
Shutdown closes new event admission and waits for accepted handlers and replay writes to settle before releasing account resources. Pending work can therefore extend account cleanup. Menu/card acknowledgments, card-token behavior, VC auto-join defaults, and the five-minute queue limit remain unchanged. No configuration or migration is required.
Why This Change Was Made
The account lifecycle tracks accepted handlers through deferred settlement, while the existing durable ingress owner continues to drain message admission. Broadcast settlement starts at fanout creation, joins admitted lane commits through failure, and retires late adoption. Transport adoption still precedes logical replay commits.
The persistence backend now runs in SQLite workers, so this change also incorporates the remaining fixture preparation from #150135: route all fourteen current Feishu persistence test roots through the worker lane, join accepted fixture work before database close, and preserve shutdown and close failures. Restart checks close and reopen SQLite before testing replay suppression.
Evidence
594 tests across 20 files passed: 303 Feishu database-worker tests, 61 ordinary Feishu tests, 193 test-routing checks, and 37 shared ingress-monitor checks. These exercise real SQLite restart persistence, registered message/card/menu/meeting shutdown, deferred broadcast commits, original handlers after queue-slot eviction, and loopback webhook behavior.
Production and test type checks, scoped lint, formatting, line-cap, max-lines, and assertion-safety checks passed. Independent P2 review and the maintainer ownership audit completed with no accepted finding. The changed-check plan was inspected and proportional checks ran; the full local check:changed orchestration was not run.
This establishes isolated SQLite and channel-boundary behavior. It does not claim live Feishu provider validation.