feat(memory): add legacy int data format detection and workspace default fallback

- Add .hypothesis/ to .gitignore for test framework artifacts
- Remove outdated comment from EndUser model memory_config_id field
- Update memory config extraction methods to return tuple with legacy format flag
- Add detection for legacy int-formatted memory_config_id in Agent and Workflow configs
- Implement workspace default memory config fallback when legacy int format detected
- Add _get_workspace_default_memory_config_id method to retrieve default or earliest active config
- Update return types from Optional[uuid.UUID] to Tuple[Optional[uuid.UUID], bool] for extraction methods
- Add comprehensive logging for legacy format detection and fallback behavior
- Improve backward compatibility for applications with old int-based memory configuration data
This commit is contained in:
Ke Sun
2026-01-29 21:00:09 +08:00
parent a01911ba5f
commit 8267761890
4 changed files with 171 additions and 25 deletions

View File

@@ -21,7 +21,6 @@ class EndUser(Base):
created_at = Column(DateTime, default=datetime.datetime.now)
updated_at = Column(DateTime, default=datetime.datetime.now, onupdate=datetime.datetime.now)
# Memory config association - updated lazily during conversation
memory_config_id = Column(
UUID(as_uuid=True),
ForeignKey("memory_config.config_id"),