Repository navigation
fix(line): stop inbound media hangs after response headers - #124606
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 16, 2026, 9:46 AM ET / 13:46 UTC. ClawSweeper reviewWhat this changesThe PR extends LINE inbound-media cancellation and the existing 15-second deadline from readiness polling through response-body EOF, and stops pre-adoption work when durable ingress is cancelled. Merge readinessKeep open for maintainer merge review. The patch repairs the owner boundary that currently clears its deadline at response headers, but merging deliberately makes a slow post-header LINE transfer retry after the shared 15-second budget. Priority: P1 Review scores
Verification
How this fits togetherLINE webhook events download inbound attachments before the event is handed to agent processing. The LINE plugin owns readiness polling and response consumption, then passes a completed attachment to shared media storage and message dispatch. flowchart LR
A[LINE webhook event] --> B[LINE event handler]
B --> C[Media readiness and download]
C --> D[Deadline or ingress cancellation]
D --> E[Shared media storage]
E --> F[Agent message dispatch]
Decision needed
Why: Current main permits an unbounded post-header transfer, while this PR intentionally changes slow successful transfers into durable retries; that availability tradeoff requires maintainer intent. Before merge
Agent review detailsSecurityNone. PR surfaceSource +26, Tests +77. Total +103 across 4 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one LINE-owned deadline and cancellation flow, and land it only after a maintainer accepts the 15-second full-transfer retry tradeoff and queued exact-head checks complete. Do we have a high-confidence way to reproduce the issue? Yes—source proves that current main clears the only deadline at headers while the following body reader can remain pending; this read-only review did not execute the pre-fix scenario. Is this the best way to solve the issue? Unclear—the owner-boundary implementation is sound, but a maintainer must decide whether the single 15-second budget is the right default for slow valid media. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 605dece17105. LabelsLabel changes:
Label 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
|
|
Merged via squash.
|
Related: #109165
What Problem This Solves
Fixes an issue where a LINE inbound media message could leave delivery running indefinitely after LINE returned HTTP 200 headers but stalled the response body. Gateway shutdown also did not cancel that pre-adoption download, so old media work could continue after the durable ingress owner stopped.
Why This Change Was Made
The LINE download owner now keeps one existing 15-second absolute deadline across readiness polling, 202 backoff, response headers, and body EOF. It composes that deadline with the durable-ingress abort signal, preserves the exact winning abort reason, cancels and releases incomplete response readers, and rechecks ingress cancellation before accepting materialized media. Healthy 202-to-200 retry behavior, byte limits, MIME detection, persistence, and retry classification remain unchanged.
Maintainer decision: accept the 15-second total-transfer policy. A valid transfer that exceeds the single owner-held budget retries through durable ingress instead of holding that ingress claim indefinitely.
A separate post-header timeout was rejected because it would extend work beyond the existing deadline and lifecycle owner. Moving LINE policy into the shared media store was also rejected: the store already owns atomic sibling-temp cleanup, while LINE owns its API-specific readiness and retry contract.
User Impact
LINE media delivery now either finishes within the existing bounded window or rejects for durable retry; it no longer wedges indefinitely on a stalled body or continues after ingress shutdown. Text messages, outbound LINE sends, configuration, auth, routing, public plugin contracts, persistence schemas, release behavior, and deployment are unchanged.
Evidence
Exact reviewed candidate:
2dbf2e1bec02e824eb3d41aa16462f6b8e15c7bf. Rebased exact head:e0cd3b87953c650d7de6147d8de8e4236fc8acadon localorigin/maineafeeec537a643d1f47459ec617516986b17c514. The rebase was conflict-free; all four before/after blob IDs and stable patch ID remained identical, so the accepted proof and autoreview still cover the exact change.OPENCLAW_HEAVY_CHECK_LOCK_SCOPE=worktree node scripts/run-vitest.mjs extensions/line/src/download.test.ts extensions/line/src/bot-handlers.test.ts extensions/line/src/webhook-spool.test.ts extensions/line/src/monitor.lifecycle.test.ts --reporter=verbose— 81 tests passed. The body-stall and ingress-cancellation regressions failed on pre-fix code for the intended reasons.e0cd3b87953c650d7de6147d8de8e4236fc8acadwith 41 successful jobs and zero failures.autoreview clean: no accepted/actionable findings reported.Production LOC: +61/-35 (net +26). Tests: +87/-10 (net +77). The production growth is the minimum owner-held signal/deadline composition and reader cleanup needed to cover headers through EOF and ingress shutdown without adding config, fallback, or parallel policy paths.
Duplicate search found closed #109165 and closed #86873. #109165 used separate 15-second readiness and 120-second body budgets, did not propagate durable-ingress cancellation, exposed a test-only timeout option, and lacked native transport cleanup proof; this change replaces that shape with the single owner deadline and lifecycle invariant above.
AI-assisted: yes. The implementation, dependency behavior, lifecycle ownership, tests, and live/controlled evidence were directly reviewed.