Repository navigation
refactor(channels): adopt core retryAsync for feishu and matrix retry loops - #104431
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 11, 2026, 7:23 AM ET / 11:23 UTC. Summary PR surface: Source -20. Total -20 across 2 files. Reproducibility: not applicable. This PR refactors established retry control flow rather than reporting a current-main behavior failure. Equivalence is inspectable through the shared helper contract and existing focused tests. Review metrics: none identified. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Next step before merge
Security Review detailsBest possible solution: Land the bounded two-channel adoption of the canonical retry helper after required checks complete, retaining the focused tests that lock terminal errors, caller opt-outs, size-limit fallback, and the fixed 1×/2× delay schedules. Do we have a high-confidence way to reproduce the issue? Not applicable; this PR refactors established retry control flow rather than reporting a current-main behavior failure. Equivalence is inspectable through the shared helper contract and existing focused tests. Is this the best way to solve the issue? Yes; using the existing plugin SDK retry helper removes duplicated channel control flow at the intended ownership boundary without adding a new API, config surface, or behavior mode. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c49e5c480dc2. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source -20. Total -20 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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
|
|
Merged via squash.
|
The inter-attempt delay in monitor.comment.ts used a bare setTimeout and never received the owning monitor account's AbortSignal, so an account teardown (ws disconnect, webhook stop, config reload) left the in-flight comment reply retry running for up to ~6s after the rest of the lifecycle settled. delayMs now wraps waitForAbortableDelay from async.ts and the abortSignal is threaded through fetchDriveCommentContext → resolveDriveCommentEventTurn → handleFeishuCommentEvent → createFeishuDriveCommentNoticeHandler, sourced from monitorSingleAccount. The retry loop checks the waitMs return value and the abortSignal flag, breaking out of the next 1s tick instead of running the full 6×1s poll budget. Sibling surface monitor.bot-identity.ts already uses the same pattern; openclaw#104431 explicitly skipped the comment-monitor retry because it is a result-predicate poll, not an error retry, and this fix is orthogonal to that decision. Not tested: live Feishu tenant, real bot identity, real drive comment, and account restart. requestFeishuOpenApi itself does not accept AbortSignal — that is a separate, larger refactor and is out of scope.
…8408) * fix(feishu): honor abortSignal in drive comment reply retry loop The inter-attempt delay in monitor.comment.ts used a bare setTimeout and never received the owning monitor account's AbortSignal, so an account teardown (ws disconnect, webhook stop, config reload) left the in-flight comment reply retry running for up to ~6s after the rest of the lifecycle settled. delayMs now wraps waitForAbortableDelay from async.ts and the abortSignal is threaded through fetchDriveCommentContext → resolveDriveCommentEventTurn → handleFeishuCommentEvent → createFeishuDriveCommentNoticeHandler, sourced from monitorSingleAccount. The retry loop checks the waitMs return value and the abortSignal flag, breaking out of the next 1s tick instead of running the full 6×1s poll budget. Sibling surface monitor.bot-identity.ts already uses the same pattern; #104431 explicitly skipped the comment-monitor retry because it is a result-predicate poll, not an error retry, and this fix is orthogonal to that decision. Not tested: live Feishu tenant, real bot identity, real drive comment, and account restart. requestFeishuOpenApi itself does not accept AbortSignal — that is a separate, larger refactor and is out of scope. * test(feishu): prove comment retry abort --------- Co-authored-by: Peter Steinberger <[email protected]>
…nclaw#108408) * fix(feishu): honor abortSignal in drive comment reply retry loop The inter-attempt delay in monitor.comment.ts used a bare setTimeout and never received the owning monitor account's AbortSignal, so an account teardown (ws disconnect, webhook stop, config reload) left the in-flight comment reply retry running for up to ~6s after the rest of the lifecycle settled. delayMs now wraps waitForAbortableDelay from async.ts and the abortSignal is threaded through fetchDriveCommentContext → resolveDriveCommentEventTurn → handleFeishuCommentEvent → createFeishuDriveCommentNoticeHandler, sourced from monitorSingleAccount. The retry loop checks the waitMs return value and the abortSignal flag, breaking out of the next 1s tick instead of running the full 6×1s poll budget. Sibling surface monitor.bot-identity.ts already uses the same pattern; openclaw#104431 explicitly skipped the comment-monitor retry because it is a result-predicate poll, not an error retry, and this fix is orthogonal to that decision. Not tested: live Feishu tenant, real bot identity, real drive comment, and account restart. requestFeishuOpenApi itself does not accept AbortSignal — that is a separate, larger refactor and is out of scope. * test(feishu): prove comment retry abort --------- Co-authored-by: Peter Steinberger <[email protected]>
…nclaw#108408) * fix(feishu): honor abortSignal in drive comment reply retry loop The inter-attempt delay in monitor.comment.ts used a bare setTimeout and never received the owning monitor account's AbortSignal, so an account teardown (ws disconnect, webhook stop, config reload) left the in-flight comment reply retry running for up to ~6s after the rest of the lifecycle settled. delayMs now wraps waitForAbortableDelay from async.ts and the abortSignal is threaded through fetchDriveCommentContext → resolveDriveCommentEventTurn → handleFeishuCommentEvent → createFeishuDriveCommentNoticeHandler, sourced from monitorSingleAccount. The retry loop checks the waitMs return value and the abortSignal flag, breaking out of the next 1s tick instead of running the full 6×1s poll budget. Sibling surface monitor.bot-identity.ts already uses the same pattern; openclaw#104431 explicitly skipped the comment-monitor retry because it is a result-predicate poll, not an error retry, and this fix is orthogonal to that decision. Not tested: live Feishu tenant, real bot identity, real drive comment, and account restart. requestFeishuOpenApi itself does not accept AbortSignal — that is a separate, larger refactor and is out of scope. * test(feishu): prove comment retry abort --------- Co-authored-by: Peter Steinberger <[email protected]>
Related: #104318
What Problem This Solves
Channels hand-roll retry/backoff loops instead of using the core retry engine, so retryability decisions and delay math drift per channel. This sweep migrates the two sites whose semantics map cleanly and documents exactly why the remaining three do not (that record feeds the ChannelAdapter v2 delivery design).
Why This Change Was Made
feishu's
requestFeishuApi(comment send path) and matrix'sretryMatrixApprovalDeliverynow run on coreretryAsync, keeping each channel's classification exactly (feishu re-throws fulfilled rate-limit bodies in the synthetic AxiosError shape its predicate expects; matrix keeps its caller opt-out predicate and size-limit fallback). Backoff-curve equivalence at the fixed attempt budgets is pinned in comments. Skipped with recorded gaps: mattermost (full-jitter schedule test-asserted, inexpressible in core retryAsync — needs a jitter-mode knob), imessage watch-subscribe (abort-aware sleep + teardown between attempts), feishu comment monitor (result-predicate poll, not error retry).User Impact
No behavior change; retry cadence equivalence documented at the changed sites.
Evidence
tbx_01kx8ds5kpydq7q42mw3xc1a52: feishu/imessage/mattermost/matrix suites green + fullpnpm check:changed; existing retry contract tests (feishu send.retry, matrix approval) hold unchanged.git diff --numstat: net −20 prod LOC.