Skip to content

Conversation

@luuquangvu
Copy link
Collaborator

@luuquangvu luuquangvu commented Nov 2, 2025

  • Fixes the MDB_MAP_FULL error.
  • The retention_days parameter defaults to 14 days and setting it to 0 disables cleanup.
  • Increase the default max_size to 256 MB.

Update:

  • Fixes LLM returned no images for the requested image_generation tool. The root cause is an issue with cookies expiring.
  • Fixes some unhandle exceptions.

@Nativu5 Nativu5 requested a review from Copilot November 3, 2025 04:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements automatic cleanup of expired conversations in the LMDB storage based on a configurable retention period. The retention policy helps manage storage space by removing old conversations after a specified number of days.

  • Adds a retention_days configuration parameter with a default of 14 days
  • Implements a cleanup_expired() method in LMDBConversationStore to delete old conversations
  • Introduces a background task that runs every 6 hours to enforce the retention policy

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
config/config.yaml Increased max database size to 256 MB and added retention_days: 14 configuration
app/utils/config.py Added retention_days field to StorageConfig model with default value of 14 days
app/services/lmdb.py Added retention_days parameter to constructor and implemented cleanup_expired() method
app/main.py Added background task _run_retention_cleanup() that periodically calls cleanup with 6-hour intervals
Comments suppressed due to low confidence (1)

app/services/lmdb.py:53

  • The docstring mentions default of 128MB but the code has been updated to use 256MB. Update the documentation to reflect the new default value of 256MB.
            max_db_size: Maximum database size in bytes (default: 128MB)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Nativu5 Nativu5 requested a review from Copilot November 5, 2025 04:05
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Nativu5 Nativu5 merged commit 68b21f6 into Nativu5:main Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants