Repository navigation
feat(discord): proactive text send-leg through the shared DeliveryProvider (5b stage 1) - #3098
Merged
qingyun-wu merged 1 commit intoAug 18, 2026
Conversation
…vider (5b stage 1) The bridge keeps claim/retry orchestration (the cross-bridge .sending protocol needs a migration fence before claiming moves); the outbound text chunks now earn canonical receipts. OUTCOME_UNKNOWN maps to the policy's capped-transient UnconfirmedDelivery — bounded retry visible to the attempt budget, then park — and NOT_DELIVERED parks as permanent. Attachments stay on the WS client (provider has no file surface yet). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Collaborator
Author
|
Folded into #3095 at the owner's direction — the provider and its first activated caller (the proactive text send-leg) now review as one unit, which is what both review threads asked to see. Branch feat/discord-proactive-provider is superseded. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #3095 (
feat/discord-delivery-provider). Merge order: #3091 → #3092 → #3094 → #3095 → this. Child-only layer:pr3095..HEAD, 3 files, +187/−6.What
Stage 1 of migrating
poll_proactivebehind the delivery-core seam: the text send-leg only. The bridge keeps claim/retry orchestration — theproactive-*.txt.sendingclaim protocol is shared by the discord/telegram/slack bridges on the same files, so moving claiming requires a cross-bridge migration fence (single-protocol-per-epoch); that is deliberately out of this PR. Attachments stay on the WS client (the provider has no file surface yet).src/discord_proactive_send.py—deliver_text(provider, channel_id, text, item_id, chunker): per-chunk delivery throughDiscordDeliveryProvider, per-chunk idempotency keys ({item}#{i}).OUTCOME_UNKNOWN→send_failure_policy.UnconfirmedDelivery— the policy's capped-transient class (bounded retry visible to the bridge's attempt budget, then park). This replaces the old WS behavior where a timeout looked like a plain failure and was retried on the next poll — the 2026-08-16 12-duplicate incident's shape.NOT_DELIVERED→ProviderSendFailed, permanent (a 4xx does not become a 200), carryingsent_chunksso the bridge'sprogressedsignal survives partial sends.poll_proactivewiring: DM leg and[channel:]redirect leg both deliver text viaasyncio.to_thread(deliver_text, ...); the redirect's fail-loudly semantics (literal marker kept in DM + WARN on failure) are unchanged — a provider failure raises into the existing except path.Evidence
At HEAD:
Before (parent):
poll_proactivesent text viaawait dm.send(chunk)/await _target_ch.send(chunk)(WS client, no receipts, timeout = retry-next-poll). After: chunks earn canonicalCONFIRMED / NOT_DELIVERED / OUTCOME_UNKNOWNreceipts with the mapping above.Live-path status
This is the live proactive delivery loop, so harness proof is not sufficient for merge-readiness per repo policy. The live round trip (bridge restart on this branch → synthetic
proactive-*.txt→ message observed in the owner DM, including one UNKNOWN injection) is planned as part of the stack's post-merge restart chain, same protocol as #3086's done-chain; happy to run it pre-merge on request instead.Signed: @sutando-qingyun-001:ag2.space
🤖 Generated with Claude Code