feat(cli): add 'add-all' command and auto_delete_added_files config - #232
Open
sebastianbraun25 wants to merge 5 commits into
Open
feat(cli): add 'add-all' command and auto_delete_added_files config#232sebastianbraun25 wants to merge 5 commits into
sebastianbraun25 wants to merge 5 commits into
Conversation
added 5 commits
August 27, 2026 15:27
- Added retryable exception classifier (_should_retry_exception) - Modified _llm_call() to pass retries=2 to litellm.completion() - Modified _llm_call_async() to pass retries=2 to litellm.acompletion() - LiteLLM handles exponential backoff (base 2) internally - Retries transient errors (Timeout, RateLimitError, ConnectionError) - Skips retry for permanent errors (ValueError, Auth, BadRequest) - Added comprehensive unit tests for exception filtering logic Fixes VectifyAI#229
…ption - New 'openkb add-all' command processes all files in raw/ directory - New config parameter 'auto_delete_added_files' (default: false) - When enabled, both 'add' and 'add-all' automatically delete successfully ingested files - Updated help texts to document the new cleanup behavior - Config applies to all ingest methods: direct files, directories, and URLs
Duplicates (skipped files) should also be auto-deleted when auto_delete_added_files is enabled, so raw/ stays clean. Only 'failed' status files are preserved to allow retries. Updated docstrings and helper function logic accordingly.
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.
Problem
The
openkb addcommand supports adding directories recursively, but users who frequently download documents to/rawmust manually invokeopenkb add raw/and then manually delete processed files. There is no batch processing command for the/rawstaging directory, and no configuration option to auto-delete successfully ingested files and duplicates.Solution / Changes
New CLI command:
openkb add-allprocesses all files in the KB'sraw/directory recursivelyNew configuration parameter:
auto_delete_added_files(boolean, default:false)addandadd-allautomatically delete files after processingImplementation:
_delete_if_auto_cleanup_enabled()helper function to handle cleanup logicaddandadd-allcommands to use the helper functionIssues