fix: handle empty/whitespace source content without retry loop#576
Merged
Conversation
Source.vectorize() wrapped its own ValueError in DatabaseOperationError, bypassing the stop_on=[ValueError] retry guard in process_source_command. This caused up to 15 retries when processing files with no extractable text, blocking sync API requests indefinitely. - Re-raise ValueError directly in Source.vectorize() instead of wrapping - Add .strip() check to catch whitespace-only content - Skip vectorization gracefully in save_source() when content is empty - Add unit tests for vectorize error handling Fixes #560
Merged
demobdev
pushed a commit
to demobdev/open-notebook
that referenced
this pull request
Feb 25, 2026
…o#576) Source.vectorize() wrapped its own ValueError in DatabaseOperationError, bypassing the stop_on=[ValueError] retry guard in process_source_command. This caused up to 15 retries when processing files with no extractable text, blocking sync API requests indefinitely. - Re-raise ValueError directly in Source.vectorize() instead of wrapping - Add .strip() check to catch whitespace-only content - Skip vectorization gracefully in save_source() when content is empty - Add unit tests for vectorize error handling Fixes lfnovo#560
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.
Summary
Source.vectorize()wrapping its ownValueErrorinDatabaseOperationError, which bypassed thestop_on=[ValueError]retry guard and caused up to 15 retries when processing files with no extractable textsave_source()graph node when content is empty/whitespace-only.strip()validation to catch whitespace-only contentRoot Cause
Source.vectorize()had a broadexcept Exceptionthat caught its ownValueErrorand re-raised it asDatabaseOperationError. Theprocess_source_commandretry config usesstop_on=[ValueError]to prevent retrying validation errors, but since the exception was nowDatabaseOperationError, the retry logic kicked in — repeating the same failing operation up to 15 times with exponential backoff, blocking sync API requests indefinitely.Test plan
vectorize()with None, empty, whitespace-only, and valid contentFixes #560