Conversation
berry-13
added this pull request to stack #16567
September 30, 2026 13:14
berry-13
force-pushed
the
followup/33-compaction-collision-settlement
branch
from
October 3, 2026 16:55
1f2c160 to
676f074
Compare
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.
Pull Request
Summary
Related to berry-13#33. Stacked on the abort persistence and failed-turn finalization PR; review that one first.
Settling a compaction row after a failure still had gaps at the edges. A settle that only rewrote the envelope left legacy or imported failure parts without the identity marker, so a restored turn kept the wrong rerun target. When the error id collided with the anchor shape, the error row was either suppressed with nothing written or aimed at the anchor id itself. The settled-job guard applied to every turn rather than only compactions, and marking mutated shared parts in place.
This stamps legacy failure parts when settling, redirects a colliding error row to the live response id and withholds it when there is none, keeps pending rows as fallbacks, scopes the settled-job guard to compactions, and copies stamped parts instead of mutating them.
Type of change
Testing
Tested environments/configuration: jest for the unit and controller suites; MongoDB and the in-memory job store.
Automated tests:
packages/api:npx jest src/agents/compaction.spec.tsplussrc/stream/__tests__/abortCompactionIdentity.spec.ts src/stream/__tests__/RedisJobStore.spec.ts: 134 passednpx tsc --noEmit -p packages/api/tsconfig.json: cleanapi:npx jeston the abort route, request partial disconnect and resume metadata suites: 195 passedScreenshots / recordings
No user-facing change.
Risk / compatibility
Only compaction turns are affected; ordinary turns no longer pass through the settled-job guard.
Checklist