mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-30 01:41:43 +00:00
fix(config): respect quoted false for session vacuum_after_prune
This commit is contained in:
parent
4fade39c90
commit
7da299ddb0
6 changed files with 94 additions and 15 deletions
31
tests/cli/test_state_db_auto_maintenance.py
Normal file
31
tests/cli/test_state_db_auto_maintenance.py
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
from unittest.mock import Mock
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.mark.parametrize("raw_value", ["false", False])
|
||||
def test_run_state_db_auto_maintenance_respects_vacuum_flag(monkeypatch, tmp_path, raw_value):
|
||||
monkeypatch.setenv("HERMES_HOME", str(tmp_path))
|
||||
|
||||
import cli as cli_mod
|
||||
|
||||
session_db = Mock()
|
||||
monkeypatch.setattr(
|
||||
"hermes_cli.config.load_config",
|
||||
lambda: {
|
||||
"sessions": {
|
||||
"auto_prune": True,
|
||||
"retention_days": 30,
|
||||
"min_interval_hours": 12,
|
||||
"vacuum_after_prune": raw_value,
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
cli_mod._run_state_db_auto_maintenance(session_db)
|
||||
|
||||
session_db.maybe_auto_prune_and_vacuum.assert_called_once_with(
|
||||
retention_days=30,
|
||||
min_interval_hours=12,
|
||||
vacuum=False,
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue