Repository navigation
fix(gateway): replay the transcript spool in drop order with full fidelity on restart (salvage #122718) #133932
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
unsupportedpastels
merged 18 commits into
NousResearch:main
from
unsupportedpastels:fix/gateway-spool-replay-order-salvage-122718
Oct 6, 2026
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
b438a89
fix(gateway): replay cap-dropped transcript spool files in drop order…
briandevans 9f77071
fix(gateway): preserve structured transcript fields when recovering s…
briandevans 70488cc
fix(gateway): stop a session's spool replay after the first failed ap…
briandevans be3f1c8
test(gateway): cover spool replay ordering across a restart
briandevans 19e53d5
test(gateway): cover field fidelity and failure handling in spool rec…
briandevans c918adf
fix(gateway): fall back to the payload clock only when a timestamp is…
briandevans a2c0e19
fix(gateway): the live and restart transcript writers share one row b…
jonpol01 0bd036f
fix(gateway): an out-of-range spool ts or seq no longer aborts recovery
jonpol01 e2154ae
fix(gateway): catch only read and decode errors when ordering spool f…
unsupportedpastels 36f27f2
fix(gateway): drain boot-held-back spool files before the session's n…
unsupportedpastels d4d5a8e
fix(gateway): bound decoded payload memory during restart recovery
unsupportedpastels 4d7d3c0
fix(gateway): order shutdown slot heads before same-second overflow
unsupportedpastels 02938cb
fix(gateway): keep live transcript rows queued while older spool file…
unsupportedpastels 7a54b7f
fix(gateway): replay the pending spool before boot resume turns and q…
unsupportedpastels 376d2e1
fix(gateway): keep the spool replay error classifiable when it blocks…
unsupportedpastels ab8d368
fix(gateway): stop one malformed spooled row from stalling its session
unsupportedpastels 575b4dd
fix(gateway): quarantine only rows sqlite cannot bind
unsupportedpastels 0b9659c
fix(gateway): never replay a written spool row whose file cannot be d…
unsupportedpastels File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a spool row is saved but its file cannot be deleted,
_drain_spooled_dropsreturnsNoneafter logging the error. The live writer then saves a newer row while the old file remains. On the next restart, the old row can be saved again, leaving a duplicate out of order. Keep the live row queued when file cleanup fails.Prompt To Fix With AI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Partly fixed in
0b9659c7887. Within a running process, a spool file whose row was written but could not be deleted is no longer replayed again, and replay carries on with the files after it, so the live row no longer overtakes them. Covered bytest_a_replayed_file_that_cannot_be_deleted_is_not_replayed_againandtest_boot_recovery_counts_and_never_repeats_a_file_it_could_not_delete.The restart duplicate you describe remains: nothing on disk records that the row was written, so the next start writes it once more. We are keeping fail-open behaviour rather than holding newer messages back, and the error log names the file to delete by hand. Keeping the live row queued would not prevent the restart duplicate either.