fix(config): resolve sqlite_dir relative to CWD, not Paths.base_dir

resolve_path() resolves relative to Paths.base_dir (.deer-flow),
which double-nested the path to .deer-flow/.deer-flow/data/app.db.
Use Path.resolve() (CWD-relative) instead.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
rayhpeng 2026-04-06 22:11:04 +08:00
parent cfb167c702
commit 11dcf48596

View File

@ -62,21 +62,22 @@ class DatabaseConfig(BaseModel):
# -- Derived helpers (not user-configured) --
@property
def _resolved_sqlite_dir(self) -> str:
"""Resolve sqlite_dir to an absolute path (relative to CWD)."""
from pathlib import Path
return str(Path(self.sqlite_dir).resolve())
@property
def checkpointer_sqlite_path(self) -> str:
"""SQLite file path for the LangGraph checkpointer."""
from deerflow.config.paths import resolve_path
resolved_dir = str(resolve_path(self.sqlite_dir))
return os.path.join(resolved_dir, "checkpoints.db")
return os.path.join(self._resolved_sqlite_dir, "checkpoints.db")
@property
def app_sqlite_path(self) -> str:
"""SQLite file path for application ORM data."""
from deerflow.config.paths import resolve_path
resolved_dir = str(resolve_path(self.sqlite_dir))
return os.path.join(resolved_dir, "app.db")
return os.path.join(self._resolved_sqlite_dir, "app.db")
@property
def app_sqlalchemy_url(self) -> str: