Conversation
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.
Problem
Fixes #572.
When a pending workflow completion backlog is split into several messages, a later synchronous send failure discards the earlier batches' success receipts. The existing result queue then retries completions that were already accepted.
Value
Avoid unnecessary duplicate completion delivery and duplicate parent-model context after a partial transport failure.
Approach
Track accepted delivery IDs after each successful batch. On failure, stop sending further batches as before, but return per-envelope receipts: success for accepted IDs and failure for the rest. The existing queue retains ownership of durable persistence and later lifecycle retry.
This does not introduce an exactly-once transport promise. The documented at-least-once behavior after durable receipt persistence failure is unchanged.
Validation
persistWorkflowJson->workflows(pi)->session_start->agent_settled. A 400-run backlog with normal IDs reaches real bounded batching; batch one is accepted and batch two throws.bun run check,git diff --check, one scoped read-only review — pass/no actionable findings.Impact