Repository navigation
fix(retain): reject async append without document_id at submit time - #5651
Merged
Merged
Conversation
…5415) The queued path never checked update_mode='append' against document_id, so the item was accepted, failed in the worker, and was retried for minutes before being marked failed. Both paths now share one check, raising a new InvalidRetainRequestError (a ValueError, so HTTP answers 400). The worker treats it as non-retryable, for any row that still meets it at run time (e.g. bank config changed to store_document_text=false after submit).
…h paths Review fix: the 200 -> 400 change for async retain had no blackbox story.
This was referenced Oct 16, 2026
Merged
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.
Fixes #5415.
submit_async_retainnow runs the sameupdate_mode='append'checks as the sync path (needs adocument_id; needsstore_document_texton). One shared helper,_validate_retain_update_modes.InvalidRetainRequestError(subclass ofValueError), soPOST /memorieswithasync: truereturns 400 instead of 200 + a failed operation.InvalidRetainRequestErroras non-retryable, so a row that still hits it at run time fails at once instead of after ~4 minutes of retries.Tests: engine-level async rejection, HTTP 400 for both async and sync, non-retry classification.