Skip to content

Conversation

@mruckman1
Copy link
Contributor

This PR implements the artifact cleanup functionality based on the cleanup_old_artifacts and artifact_retention_days settings in the configuration. This resolves the potential issue of unbounded disk space usage from stored artifacts.

Changes:

  • Added a new private method _cleanup_old_artifacts to the ProgramDatabase class.
  • This method is called during db.save() to perform cleanup when checkpoints are created.
  • It safely removes artifact directories older than the specified retention period.
  • Added a new, self-contained unit test (tests/test_database_cleanup.py) to verify the cleanup logic.

Note on Existing Tests:

While working on this, I encountered a pre-existing issue where the main test suite (python -m unittest discover tests) fails with a 401 Unauthorized error, as it appears to be making an unexpected real API call. Per CONTRIBUTING.md, the tests should be mocked. This PR does not address that issue, as it is unrelated to the database changes. The new test I've added passes in isolation.

@CLAassistant
Copy link

CLAassistant commented Aug 10, 2025

CLA assistant check
All committers have signed the CLA.

@codelion codelion merged commit ddf42e2 into algorithmicsuperintelligence:main Aug 10, 2025
2 checks passed
wangcheng0825 pushed a commit to wangcheng0825/openevolve that referenced this pull request Sep 15, 2025
…ature/artifact-cleanup

feat: Implement automatic artifact cleanup
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.

3 participants