Repository navigation
fix: acknowledge delivered invocation input - #867
Draft
zhongkechen wants to merge 4 commits into
Draft
zhongkechen wants to merge 4 commits into
zhongkechen wants to merge 4 commits into
Conversation
This branch has not been deployed
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.
Issue #, if available
Fixes #861.
Description of changes
Invocation input construction cleared pending update IDs before delivery succeeded,
while a valid checkpoint-free resume did not acknowledge the input sequence. Retain
those IDs until a valid response, then consume only operation versions covered by
that input. Failed delivery retains updates for retry, newer changes stay pending,
and an invocation acknowledgment cannot retreat a newer checkpoint watermark.
Regression coverage uses wait completion, so this fix is independent of #860's
callback producer change. Public-handler tests cover memory/filesystem stores,
failure before SDK input delivery, legacy stored state, multiple resumes, and saved
steps executing once. No existing test expectations change.
The existing
test_pending_response_is_valid_when_an_operation_completed_after_the_handler_saw_itfixture now supplies concrete operation/update collections read by the real
acknowledgment path; its assertions are unchanged.
Design
existing fields and methods, with no public API change.
invocation completion would consume newer changes. Reuse the existing
per-operation versions and
advance_handler_seen; no new delivery ledger isneeded. Keep the watermark monotonic while pruning IDs covered by each actual
acknowledgment, including equal/older acknowledgments.
successful invocation completion never acknowledged checkpoint-free input.
Assumptions
PR; this implements the contract described in [Testing]: Acknowledge invocation input without losing pending updates #861/fix(testing): match replay state to the service #795.
sequence-zero interpretation. Tests load that legacy format and preserve newer
versioned changes.
Decisions not covered by the issue or the design note
of [Testing]: Record callback terminal completions as updated operations #860. A callback supplies only the later suspension barrier.
mark_state_deliveredhelper for existing callers; the executornow uses versioned acknowledgment instead.
Validation
d7ae955: 26 failed, 10 passed;baseline import path verified before running. With this fix: 36 passed.
hatch run dev-testing:typecheck: passed (137 source files).hatch fmt --check: passed.hatch run dev-testing:test -q --tb=short: 1,784 passed. Reran with loopbackaccess after the sandbox blocked the HTTP test servers.
hatch run dev-testing:js-examples: 123 test files passed, 150 tests passed,zero retries; four selected files have no cloud tests. JS SDK commit
3deb8389531d35642e2d4657a69575522dc7a7ea.git diff --check: passed.Checklist
By submitting this pull request, I confirm that you can use, modify, copy, and
redistribute this contribution, under the terms of your choice.