Skip to content

Conversation

@Emart29
Copy link
Contributor

@Emart29 Emart29 commented Feb 11, 2026

Description

Fixes the bug where Runtime accepts a nonexistent storage path without validation, leading to silent failures when trying to save data later.

Fixes #1870

Type of Change

  • Bug fix (non-breaking change that fixes an issue)

Changes Made

  • Added path validation in Runtime.__init__()
  • Logs a warning when the storage directory doesn't exist
  • Auto-creates the directory with parents=True to prevent downstream errors
  • Implements Option 3 from the issue discussion (explicit, safe, informative)

Before

runtime = Runtime(Path('nonexistent'))  # Silently accepts
# ... later fails when trying to save

After

runtime = Runtime(Path('nonexistent'))
# WARNING: Storage path does not exist, creating: nonexistent
# Directory is created, saves work correctly

Testing

  • Manual testing with nonexistent paths
  • Manual testing with existing paths
  • Lint passes (ruff check)

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • My changes generate no new warnings

- Add path validation in Runtime.__init__()
- Log warning when creating nonexistent storage directory
- Auto-create directory with parents to prevent silent failures later
- Implements Option 3 from issue discussion (explicit, safe, informative)

Fixes adenhq#1870
@Emart29
Copy link
Contributor Author

Emart29 commented Feb 11, 2026

@austin931114 @Hundao

Implemented the fix as discussed in #1870. Ready for review.

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.

[Bug]: Runtime accepts nonexistent storage path without validation

1 participant