fix(taskruntime): prevent duplicate stream replay - #60
Merged
jasonchen922 merged 2 commits intoJul 28, 2026
Conversation
Sync of gim-home/dwp#934. - give each chat request a stable submission id and derive per-delegate submission identities, deterministic batch ids and task keys from it - observe an existing batch on replay instead of re-executing it, guarded by a submission fingerprint - suppress whole-generation chat retries once a task batch has been submitted - recognize GORM-translated duplicate-key errors - replace the reconcile interval knob with a bounded startup recovery pass (immediate + one delayed) driven by the shutdown event
- move the replay batch lookup inside the failure guard so a store read that fails for a reason other than "not found" (backend outage, RPC timeout) still marks the parent delegate step failed instead of leaving it running - add backend tests pinning that buildChatRequest assigns a unique submission id and that an Unavailable retry reuses it, so core treats the second attempt as a replay rather than a new submission
jasonchen922
deleted the
users/jasonchen922/sync-taskruntime-stream-replay
branch
July 28, 2026 07:33
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.
Syncs the upstream taskruntime stream-replay fix into this repo.
Summary
submission_id(protoChatRequest.submission_id, set by the backend) and derive per-delegate submission identities from itTASK_RUNTIME_RECONCILE_INTERVAL_SECONDSwithTASK_RUNTIME_REPLAY_MATERIALIZATION_TIMEOUT_SECONDS, and run a bounded startup recovery (immediate + one delayed pass) driven by the shutdown eventValidation
./scripts/lint.sh --backend/--corecd backend && go build ./... && go test ./...cd core && uv run pytest(823 passed)Rollout
Pause new task submissions and let active taskruntime batches drain before rolling mixed backend/core versions: the old and new batch identity formats cannot safely coexist.