feat: support document and collection summary#1107
Conversation
|
bugbot run |
- Removed the summary field from the collection schema and its associated status. - Introduced a new CollectionSummary model to manage collection summaries with distinct statuses (PENDING, GENERATING, COMPLETE, FAILED). - Updated the CollectionService to trigger summary generation based on collection configuration. - Enhanced the collection summary reconciliation process with a dedicated reconciler and callbacks for task completion and failure. - Adjusted frontend components to reflect the removal of the summary field and updated status handling.
There was a problem hiding this comment.
Bug: Callback Parameters Mismatch
The on_summary_failed callback is called with incorrect parameters. It expects (summary_id, error_message, target_version) but receives (collection_id, str(e)). This incorrectly uses collection_id instead of summary_id and omits target_version, preventing the failure callback from working properly.
config/celery_tasks.py#L806-L810
Lines 806 to 810 in 28f7178
Bug: Mismatched Collection Models in Summary Generation
The generate_collection_summary_view endpoint passes a view_models.Collection object (returned by collection_service.get_collection) to collection_summary_service.trigger_collection_summary_generation. This service expects a db_models.Collection database model, leading to runtime errors. Specifically, the config attribute's type differs (CollectionConfig in the view model vs. Text in the database model), causing issues when parseCollectionConfig() is called.
aperag/views/main.py#L112-L118
Lines 112 to 118 in 28f7178
Bug: Null Check Error in Configuration Parsing
Missing null check: The parseCollectionConfig() function might return None, but the code immediately attempts to access config.enable_summary without verifying if config is None. This can lead to an AttributeError at runtime.
aperag/tasks/document.py#L128-L131
ApeRAG/aperag/tasks/document.py
Lines 128 to 131 in 28f7178
aperag/tasks/document.py#L291-L294
ApeRAG/aperag/tasks/document.py
Lines 291 to 294 in 28f7178
Was this report helpful? Give feedback by reacting with 👍 or 👎
No description provided.