fix(core): Anchor config.toml path to manual slop root

This fixes an issue where config.toml was erroneously saved to the current working directory (e.g. project dir) rather than the global manual slop directory.
This commit is contained in:
2026-03-08 21:29:54 -04:00
parent 1d18150570
commit 74737ac9c7
3 changed files with 9 additions and 5 deletions

View File

@@ -342,16 +342,17 @@ def run(config: dict[str, Any]) -> tuple[str, Path, list[dict[str, Any]]]:
def main() -> None:
# Load global config to find active project
config_path = Path(os.environ.get("SLOP_CONFIG", "config.toml"))
from src.paths import get_config_path
config_path = get_config_path()
if not config_path.exists():
print("config.toml not found.")
print(f"{config_path} not found.")
return
with open(config_path, "rb") as f:
global_cfg = tomllib.load(f)
active_path = global_cfg.get("projects", {}).get("active")
if not active_path:
print("No active project found in config.toml.")
print(f"No active project found in {config_path}.")
return
# Use project_manager to load project (handles history segregation)
proj = project_manager.load_project(active_path)