Repository navigation
fix: retry delivery when outbound adapter is unavailable - #119371
fuller-stack-dev merged 4 commits into
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 4, 2026, 11:18 PM ET / August 5, 2026, 03:18 UTC. ClawSweeper reviewWhat this changesThe PR makes outbound adapter lookup and lazy-runtime failures retryable when they occur before a channel provider send begins. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep open for normal maintainer merge handling. The exact head repairs the pre-dispatch retry boundary; the earlier Feishu payload concern is unreachable on this head, but the remaining exact-head build check should finish before merge. Priority: P1 Review scores
Verification
How this fits togetherThe Gateway delivery queue routes queued messages through channel-plugin outbound adapters and records whether provider dispatch may have started. Restart recovery replays only entries with proven pre-dispatch failure, avoiding duplicate messages. flowchart LR
A[Queued outbound message] --> B[Gateway delivery queue]
B --> C[Request-scoped channel adapter]
C --> D{Provider send began?}
D -->|No| E[Retryable queue entry]
D -->|Yes or uncertain| F[Protected replay state]
E --> G[Restart recovery]
F --> G
Before merge
Agent review detailsSecurityNone. PR surfaceSource +64, Tests +382. Total +446 across 10 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the generic request-scoped adapter lookup and typed pre-dispatch classification once the exact head has completed its remaining packaged build validation. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main ignores the request-scoped registry at the lazy adapter loader, and the linked queue/restart scenario follows that path; this read-only review did not rerun it. Is this the best way to solve the issue? Yes. Resolving the adapter from the request-scoped registry and classifying only pre-invocation resolution failures preserves the queue owner's single replay-safety boundary. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1f3d45b76f51. 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 (2 earlier review cycles) |
|
ClawSweeper follow-up on the structured-payload finding: the cited path is not reachable on @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
* origin/main: fix(channels): honor explicit preview streaming settings refactor(telegram): consolidate outbound contracts and targets (#119438) fix(qa): retry transport cleanup and always stop owned labs (#119442) fix(mcp): guard stdio stdout frame parsing against oversized-buffer crash (#119379) refactor(auto-reply): centralize delivery deduplication and routing (#119436) fix(qa): preserve scenario isolation in serial suites (#119439) perf(xai): lazy-load optional capability runtimes (#119374) refactor(browser): consolidate browser CLI and normalization helpers (#119432) fix(qa): require ready transport accounts (#119431) refactor(media): share image and video geometry normalization (#119416) fix(config): preserve plugin metadata for missing config (#119421) fix: retry delivery when outbound adapter is unavailable (#119371) fix(cli): retire invalid secret flags and prove doctor recovery (#118926) refactor(signal): share outbound and reaction transport (#119415)
…9371) * fix(outbound): preserve pre-dispatch retryability * test(outbound): assert lazy runtime sender * fix(feishu): preflight direct message runtime * test(gateway): preserve scoped registry fixture
Closes #119370
What Problem This Solves
Fixes an issue where queued channel deliveries could become unrecoverable when
an outbound adapter was unavailable before platform dispatch. The queue
persisted those definitely-unsent failures as ambiguous send attempts, so
restart recovery refused to replay them.
Why This Change Was Made
Channel adapter loading now honors the Gateway request-scoped plugin registry,
and lazy outbound adapter/runtime resolution failures are reported through the
canonical definitely-not-dispatched error. Provider method invocation remains
outside that classification boundary, preserving the existing no-blind-replay
safety rule after a send may have begun.
This is generic channel behavior rather than a Discord-specific workaround. It
does not rewrite historical ambiguous rows.
User Impact
Deliveries that fail before provider dispatch because their outbound adapter is
temporarily unavailable remain safely retryable after restart. Deliveries whose
provider send actually began remain protected from duplicate replay.
Evidence
loader, Discord and Telegram adapters, and SQLite:
send_attempt_startedsend_attempt_startedand was not replayedAI-assisted: implementation, investigation, and validation were performed with
Codex. The change and its delivery-safety boundary were independently reviewed
and exercised through packaged runtime proof.