-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Description
When running migrations that include BaseMetadataConfig classes in a BaseRetrieval.filters list, the CreateRetrieval operation serializes the filter references as Python class repr strings (e.g., "<class 'data.knowledgebase.metadata.CategoryMetadata'>") in the migration state. During _sync_content_with_api(), the _set_if_defined("filters") call (line ~354 in migrate.py) copies this raw value into the API payload without resolving it to metadata config IDs.
As a result:
- The
MetadataConfigis created correctly on the node. - The
Retrievalis created/updated correctly. - But the filters are not assigned to the retrieval tool — they appear as empty
[]in the platform.
Steps to Reproduce
- Define a
BaseMetadataConfigsubclass (e.g.,CategoryMetadata). - Reference it in
BaseRetrieval.filters = [CategoryMetadata]. - Run
manage.py migrate dataandmanage.py migrate agents. - Check the retrieval tool in the platform — filters are empty.
Expected Behavior
The migration should resolve the BaseMetadataConfig class references to their remote metadata config IDs and assign them to the retrieval tool via the API.
Actual Behavior
The filters field in the state contains class repr strings that are passed as-is to the API, which either ignores them or fails silently. The retrieval tool ends up with filters: [].
Affected Examples
examples/search-with-filters(genre, language, decade filters on MovieSearch)examples/support-escalation(category filter on HelpDeskSearch)
Environment
- cogsol-framework 0.2.1
- Python 3.9