Repository navigation
docs(line): document inbound durability, retry policy, and dead-letter recovery - #115702
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 28, 2026, 9:43 PM ET / August 29, 2026, 01:43 UTC. ClawSweeper reviewWhat this changesThe PR documents how LINE webhook events are durably accepted, ordered, retried, recovered from dead letters, and diagnosed by operators. Merge readinessKeep open. The new LINE operator documentation is not present on fetched current main and its OpenClaw-specific claims match the current ingress implementation; the cited LINE redelivery conditions still need a maintainer to verify against the vendor page, which was unreachable from this review environment. Priority: P3 Review scores
Verification
How this fits togetherLINE webhooks enter the LINE plugin, which durably queues accepted events before the shared ingress drain delivers them to agent turns. The page explains the queue’s delivery, retry, retention, and recovery behavior to LINE operators. flowchart LR
A[LINE webhook] --> B[LINE plugin]
B --> C[Durable ingress queue]
C --> D[Lane and retry policy]
D --> E[Agent delivery]
D --> F[Dead-letter recovery tools]
Decision needed
Why: The OpenClaw behavior is source-backed, but this review could not inspect the external authority due to DNS failure. Before merge
Agent review detailsSecurityNone. PR surfaceDocs +98. Total +98 across 1 file. View PR surface stats
Review metricsNone. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Verify the linked official LINE redelivery documentation, then merge this focused page update if its conditions and caveats match the cited vendor contract. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR documents an existing delivery flow rather than repairing a reported runtime failure; current source and tests establish the OpenClaw-side behavior. Is this the best way to solve the issue? Unclear: the OpenClaw-specific material is accurately sourced, but the external LINE redelivery contract needs direct verification before this is the best operator guidance. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 740ca0fddf7b. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (27 earlier review cycles; latest 8 shown)
|
…ability # Conflicts: # docs/docs_map.md
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Patrick-Erichsen
left a comment
There was a problem hiding this comment.
Verified at exact head 40afe9c: docs validation and hosted CI pass; fresh ClawSweeper has no findings; official LINE documentation confirms the redelivery and webhook-verification conditions.
|
Merged via squash.
|
…r recovery (openclaw#115702) * docs(line): document inbound durability, retry policy, and dead-letter recovery * docs(line): clarify non-retryable failures skip retries at any attempt * docs(line): note the durable-acceptance marker and polish the durability section * docs(line): correct dead-owner claim recovery timing * docs(line): make dead-letter recovery reason-specific * docs(line): bound lane independence by concurrency and cite LINE redelivery The per-conversation ordering bullet claimed a retrying event never delays other chats. Lanes are independent, but the drain stops claiming once eight deliveries are active, so a ninth lane waits for a slot. State the cap as the bound on cross-chat progress. The webhook redelivery paragraph asserted the LINE Console prerequisite with no source. Link the Messaging API documentation, name the second condition (no 2xx from the bot server), and record that LINE does not guarantee redelivery, does not disclose retry count or interval, and may resend out of order or more than once. * docs(line): describe the stall watchdog as retrying, not dead-lettering * docs(line): scope the stall watchdog to the pre-adoption window * docs(line): qualify duplicate suppression by the record cap, not only the TTL * docs(line): account for deferred ingress heartbeats * docs(line): fix handler-timeout grammar * docs(line): match admission-owned retention semantics * docs(line): correct webhook verification method --------- Co-authored-by: Patrick Erichsen <[email protected]>
What Problem This Solves
Operators running LINE have no documentation for what happens to a webhook event after the durable-queue acknowledgment.
docs/channels/line.mdsays events are retried and "poison events become failed queue records after bounded retries" but never states the bounds, the per-chat ordering guarantee, the crash-recovery windows, or how to find and recover a dead-lettered event — so a bot that silently skips one chat, or a dead-letter reported byopenclaw doctor, is undiagnosable from the LINE page. The safety claim that persistence failures return500also silently depends on the operator enabling Webhook redelivery in the LINE Developers console, which was documented nowhere.Why This Change Was Made
Adds an "Inbound durability" section (same heading
docs/channels/feishu.mduses for this topic) covering the LINE-specific drain settings — per-conversation lanes bounded by the 8-delivery concurrency cap, retry backoff and the deliberate opt-out of the 24-hour dead-letter age floor, non-retryable failure reasons, the adoption-stall watchdog, liveness-based claim recovery, the 30-day/4096-entry dedupe window, and the LINE-console redelivery dependency — and extends Troubleshooting with the dead-letter log signature plus theopenclaw channels dead-lettersinspect/resubmit flow. The section also documents thex-openclaw-delivery-accepted: durableresponse marker that #115796 added to the LINE webhook, matching the durability sections of the other six durable channels. Every OpenClaw number is read from current source rather than inferred from behavior, and the one platform-side claim (LINE redelivery) is cited to LINE's own Messaging API documentation rather than asserted. Intentionally not documented: drain poll interval and scan limit (internal tuning with no operator action, likely to drift). Docs-only; no runtime change.User Impact
LINE operators can now read what delivery guarantees they actually have (per-chat ordering, other chats progressing independently while any of the 8 delivery slots is free — and a 9th chat waiting for one to open, at-least-once with crash-lost deliveries reclaimed on the next drain recovery sweep rather than after a lease timeout), predict dead-letter timing (8 attempts, ~2 minutes of backoff) and know that the 5-minute stall watchdog hands an event back for retry rather than ending it, recover events with
openclaw channels dead-letters list/resubmit, and learn that the500-on-persistence-failure contract only protects them if Webhook redelivery is enabled in the LINE console — and that even then LINE treats redelivery as best effort, not a guarantee. No behavior change for running gateways.Evidence
Every documented OpenClaw number re-traced to current main after merging
8a101ed5a5d4:Cumulative backoff: attempts 1-7 wait 1+2+4+8+16+32+64 s = 127 s (
min(180s, 1s * 2^(n-1)), so the 3-minute cap is never reached before the 8th-attempt dead-letter). The "opts out of the 24-hour floor" sentence restates the source comment atwebhook-spool.ts:275-276. The 30-day dedupe retention is inherited fromCHANNEL_INGRESS_RETENTION_DEFAULTSafter #115824 folded the per-channel TTL constants into the shared defaults; LINE keeps its own 4096-entry caps. Durable-after-stop admission:webhook-spool.ts:267, with the mode contract atingress-monitor.ts:620-622. CLI commands and retention wording matchdocs/cli/channels.md("Inbound dead letters").Correction in this revision: the stall watchdog retries, it does not dead-letter. The earlier text said a 5-minute pre-adoption stall dead-letters as
handler-timeout. That was true of the code this branch was originally written against; #127090 (ee79b0a49ae, fix(channels): retry timed-out ingress messages) changed the watchdog to route its timeout through the canonical retry owner, and the branch had drifted behind that. Current main builds a timeout error and hands it toapplyFailureDisposition, the same path every other delivery failure takes:handler-timeouttherefore never appears as a dead-letterreasonanywhere in the tree — only as alastErrorsubstring on a pending row. The repo-wide grep is the negative proof, and the watchdog regression pins the positive behavior: the stalled event goes back to pending withattempts: 1,listFailedstays empty, and it keeps the head of its lane (evt-stalldispatches again before its younger siblingevt-next):Both places that stated the old behavior are corrected: the Stall watchdog bullet now says the event is released back to its lane with an incremented attempt count and that only the retry limit ends it as
retry-limit-exceeded, and the Troubleshooting entry is retitledhandler-timeoutretries with theapplying retry policy (handler-timeout)log line operators will actually see. The late-adoption fence is documented alongside it, since that is the part of the watchdog that still terminates something.The watchdog covers the pre-adoption window only, and the text now says so. The previous revision's troubleshooting entry named "a hung agent run" as the usual cause and sent operators to look for a stalled turn. That is the wrong place: the timer is armed at dispatch and
onAdoptedclears it, so it can only fire while the delivery is stilldispatchingordeferred— beforeexecuteAgentTurnruns at all. A turn that is already going is never the cause and is never cut off by it.Both places are corrected: the Stall watchdog bullet now states that adoption clears the watchdog so a long agent turn is never interrupted by it, and the Troubleshooting entry points at the dispatch path between claim and adoption — inbound media download, or a Gateway not accepting new work — instead of at a turn that never started. The late-adoption fence stays documented alongside, since that is the part of the watchdog that does still terminate something.
The duplicate-suppression window is bounded by the record cap, not only by the TTL. The previous revision read the 4096 figure as a reporting detail alongside a 30-day guarantee. It is an independent pruning limit:
pruneMaxEntriesorders each status byupdated_at descand deletes everything past the cap, so on a busy account a record is evicted well before it ages out.LINE sets
pruneIntervalMs: 0, which routes pruning to the admission owner rather than the pump timer, so the cap applies as soon as it is exceeded rather than at the next sweep. The section now says "up to 30 days, subject to a cap of 4096 records each per account — whichever limit is reached first", spells out that the cap keeps the most recently updated records and drops the rest, and states the consequence for operators: once a record is gone by either route a redelivery is admitted and dispatched again, so handlers with external side effects should not lean on this window in place of their own idempotency.The
401/403claim is OpenClaw's own classification, and it is pinned by a test in this repository. An earlier revision argued this fromnode_modules, which was the wrong place to point: a reviewer working from a checkout cannot inspect an installed dependency, and the documented sentence is not a statement about the SDK at all. What the section claims is OpenClaw behavior — that a LINE API authentication failure dead-letters immediately rather than retrying — and both the rule and its coverage are in the tree:That regression is the whole documented claim, end to end and without any vendor dependency: a delivery failure carrying
status: 401is attempted exactly once (toHaveBeenCalledTimes(1)— no retry) and lands asauthentication-failed. It runs in CI on this PR, so if the mapping ever stopped holding, the check that catches it is in this repository rather than in a dependency someone has to install to verify.The SDK's role is only to supply that
statusfield, and it is a published, typed part of the pinned version (extensions/line/package.jsonpins@line/bot-sdkat11.2.0;HTTPFetchErrordeclaresstatus: number). But nothing in the documented behavior rests on taking that on faith — if a future SDK stopped settingstatus, the repository test above would fail rather than the documentation silently going stale.One claim in this page is vendor-owned by design, and the page says so in its own prose. LINE's webhook-redelivery behavior cannot be derived from this repository — OpenClaw only controls the
500half of that contract, which is repo-verifiable. Rather than assert the platform half as if it were our behavior, the section attributes it in the running text and links the source:with a direct link to Redeliver a webhook that failed to be received. Every sentence there is either a console setting an operator can see for themselves or something explicitly framed as LINE's own documentation, so a reader cannot mistake it for a guarantee OpenClaw makes. The wording paraphrases LINE's page rather than inventing behavior: "doesn't guarantee that webhooks will be reliably delivered", "the number and interval of the webhook redelivery aren't disclosed", and "the order of webhook events you receive can be different from the order the events occurred".
That leaves exactly one thing outside this repository for a maintainer to eyeball — whether LINE's page still reads that way — instead of the two vendor gaps the previous review noted. If the preference is to carry no platform claim at all, the whole paragraph can be cut to its first sentence (the console prerequisite) without touching anything else in the section; I have kept it because the
500contract is misleading on its own, and an operator who does not know redelivery must be switched on will read the durability guarantee as stronger than it is.Lane independence is bounded by the concurrency cap, not unconditional. The drain blocks only occupied lanes, so an unrelated lane is never blocked by that lane — but claiming stops entirely once 8 deliveries are active, so a 9th lane waits for a slot. Both halves are in the same claim loop:
The section now says one chat's backlog never blocks another chat's lane, that other chats progress independently while a slot is free, and that a 9th lane waits for one to open.
The webhook-redelivery prerequisite is a LINE platform contract, so it is cited to LINE, not to OpenClaw source. Redeliver a webhook that failed to be received states both conditions — "Webhook redelivery is enabled" and "The bot server didn't return
2xxstatus code for the webhook" — and the caveats now carried into the docs verbatim in substance: "Webhook redelivery doesn't guarantee that webhooks will be reliably delivered", "The number and interval of the webhook redelivery aren't disclosed", "The order of webhook events you receive can be different from the order the events occurred", and that the same event "may be sent ... more than once" (absorbed by the documented duplicate-suppression window). The console setting lives in the Messaging API tab beside Use webhook, which the page's Setup step 4 already covers. OpenClaw source only proves the500half of that contract, which is why the vendor half is now linked rather than asserted.Crash recovery is liveness-gated, not lease-gated:
drainOncecallsrecoverStaleClaims()first, that call scans withstaleMs: 0, andisIngressClaimOwnedByOtherLiveProcessprotects a claim only when the owner is both fresh and a live process instance. A dead owner fails the liveness half, so its claim is reclaimed on the next sweep regardless of age. The existing regression test pins exactly that — a zero-age claim owned by dead PID999is dispatched by the firstdrainOnce():The 30-minute lease is therefore documented as the fallback bound for the opposite case — a claim whose owner still looks alive (running process, or a reused PID whose start-time identity is unreadable,
ingress-claim-owner.ts:185-205).Docs checks on the merged branch:
markdownlint (
markdownlint-cli2 --config config/markdownlint-cli2.jsonc, 772 files) reports no issues fordocs/channels/line.md; the single repo-wide finding is the pre-existingdocs/CLAUDE.mdsymlink, byte-identical toorigin/mainand untouched here. The optionaldocs-link-audit --anchorspass reports 311 pre-existing broken anchors across 43 files, none of them indocs/channels/line.md; that mode is not part ofcheck:docs, which runs the plain link audit above.An earlier revision of this PR also touched
docs/docs_map.md. #117398 moved that map to publish-time generation and reduced the checked-in file to a pointer stub, so the merge drops that hunk and this PR is now a single-file docs change.What was not tested: no live gateway run — docs-only change with no runtime surface. Proof limitations: the aggregate
format:docs:checkscript cannot run on this Windows machine (it exceeds thecmd.execommand-line length before oxfmt starts), so formatting was verified per-file by driving the script's own exportedrunOxfmtagainst a temp copy and diffing; CI runs the full script.