fix: log persistence storage location for @persist decorator#5373
Open
devin-ai-integration[bot] wants to merge 3 commits intomainfrom
Open
fix: log persistence storage location for @persist decorator#5373devin-ai-integration[bot] wants to merge 3 commits intomainfrom
devin-ai-integration[bot] wants to merge 3 commits intomainfrom
Conversation
When using @persist, users had no way to discover where their flow state was being stored. The default SQLiteFlowPersistence uses appdirs which varies by platform, making the database location opaque. Changes: - Log db_path at INFO level when SQLiteFlowPersistence is initialized - Log storage location (db_path) after each state save in persist decorator - Show storage location in console output when verbose=True - Add 5 new tests covering persistence path discoverability Closes #5372 Co-Authored-By: João <joao@crewai.com>
Contributor
Author
|
Prompt hidden (unlisted session) |
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Co-Authored-By: João <joao@crewai.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e22d185. Configure here.
…og messages Co-Authored-By: João <joao@crewai.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
When using
@persiston a flow, users had no way to discover where their flow state was being stored. The defaultSQLiteFlowPersistenceresolves its path viaappdirs.user_data_dir(), which is platform-specific and was never surfaced to the user. This addresses #5372.Changes:
SQLiteFlowPersistence._setup()now logs the resolveddb_pathat INFO level on initializationPersistenceDecorator.persist_state()now logs the storage location (thedb_pathfor SQLite, or the class name for custom backends) at INFO level after each state saveverbose=True, the storage location is also printed to the console viaPRINTERBehavioral note: The old
save_statelog message was renamed from"Saving flow state to memory for ID: {}"to"Saving flow state for ID: {}". The storage location is now logged unconditionally at INFO level on every save (previously, no log was emitted withverbose=False).Review & Testing Checklist for Human
persist_state()call, not just the first. For flows with many persisted steps, this could be chatty. Consider whether this should be DEBUG instead, or only logged once per persistence instance.verbose=Falseproduced no "Saving flow state" logs. This assertion is no longer valid because storage location is now always logged at INFO. The test was removed rather than updated — confirm this behavioral change is desired.getattrfallback for custom persistence backends. For non-SQLite backends without adb_pathattribute, the log falls back totype(persistence_instance).__name__. Confirm this is useful enough for custom implementations.Notes
@persist()and check that the log output includes the SQLite database path. Enable Python INFO logging (e.g.,logging.basicConfig(level=logging.INFO)) or useverbose=Trueon the decorator.Link to Devin session: https://app.devin.ai/sessions/0bf4c592e402444eb5656a8159404869
Note
Low Risk
Low risk behavior change limited to additional INFO-level logging during persistence initialization and every state save; main concern is potential log noise or tests that assume quiet default logging.
Overview
Makes persisted flow state discoverable by logging where it is stored.
@persistnow logs an INFO message after each save that includes the flow ID and the persistence storage location (usesdb_pathwhen available, otherwise the backend class name), and prints the same message to the console whenverbose=True.SQLiteFlowPersistencealso logs its resolveddb_pathon initialization.Updates and expands tests to cover the new logging behavior (including default path logging, save-time storage logging, verbose output, and class-level
@persist).Reviewed by Cursor Bugbot for commit 3758361. Bugbot is set up for automated code reviews on this repo. Configure here.