Standardize failed outbound delivery recovery#31
Open
Dnyaneshvn wants to merge 1 commit into
Open
Conversation
Failed SMS, iMessage and email sends now wake the agent so it can retry on the same thread. The delivery-failure events weren't woken before, so the handlers never ran and recovery never replied on the channel that failed. - subscribe to the hard failure events (ignore delivery_unconfirmed telemetry) - correlate a failure back to the original conversation and thread - reply on the failed channel by default; the agent can reword to retry, switch channels with its tools, or reply [SILENT] to stay quiet - dedup repeat webhooks and cap retries so a dead channel can't loop Fixes inkbox-ai#22
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.
Fixes #22.
What was wrong
Outbound SMS, iMessage and email can fail after the agent has gone idle, via async delivery webhooks. The failure events were already subscribed, but dispatch only logged them, so a failure never turned into an agent turn. There was also no outbound context to correlate a failure back to its conversation, no on-channel routing for the recovery reply, and no dedup or loop protection.
What this does
text.delivery_failed,imessage.delivery_failed,message.bounced/message.failed);text.delivery_unconfirmedstays off the wake path since it's telemetry, not a hard failure[SILENT]to stay quietTests
[SILENT]suppresses the visible replytext.delivery_unconfirmeddoes not wake the agentFull suite green (307 tests).