test: pair attribute-form load_config stubs with readonly siblings

Second stub shape the first sweep missed: monkeypatch.setattr(config_mod,
"load_config", ...) — attribute-form instead of string-form. Four files
(compression_max_attempts, preflight_compression_cap_e2e,
codex_gpt55_autoraise_notice, proactive_prune_config) stub agent_init
config reads that now go through load_config_readonly(). Swept the whole
tree for the attribute form; remaining hits stub modules that still use
the mutable loader. 1,210 tests green across the 19-file re-sweep.
This commit is contained in:
teknium1 2026-07-29 12:29:24 -07:00 committed by Teknium
parent 243c9182b1
commit a16fd675df
4 changed files with 12 additions and 0 deletions

View file

@ -59,6 +59,8 @@ def _make_codex_agent(monkeypatch, tmp_path: Path, *, show_notice: bool):
from hermes_cli import config as config_mod
monkeypatch.setattr(config_mod, "load_config", lambda: _config(show_notice=show_notice))
monkeypatch.setattr(config_mod, "load_config_readonly", lambda: _config(show_notice=show_notice))
db = SessionDB(db_path=tmp_path / "state.db")
stdout = io.StringIO()

View file

@ -46,6 +46,9 @@ def _make_agent(monkeypatch, tmp_path: Path, *, max_attempts=None):
monkeypatch.setattr(
config_mod, "load_config", lambda: _config(max_attempts=max_attempts)
)
monkeypatch.setattr(
config_mod, "load_config_readonly", lambda: _config(max_attempts=max_attempts)
)
db = SessionDB(db_path=tmp_path / "state.db")
with contextlib.redirect_stdout(io.StringIO()):
agent = AIAgent(

View file

@ -39,6 +39,8 @@ def _make_agent(monkeypatch, tmp_path: Path, **prune_keys):
from hermes_cli import config as config_mod
monkeypatch.setattr(config_mod, "load_config", lambda: _config(**prune_keys))
monkeypatch.setattr(config_mod, "load_config_readonly", lambda: _config(**prune_keys))
db = SessionDB(db_path=tmp_path / "state.db")
with contextlib.redirect_stdout(io.StringIO()):
agent = AIAgent(

View file

@ -60,6 +60,11 @@ def _make_agent(monkeypatch, tmp_path: Path, *, max_attempts) -> AIAgent:
monkeypatch.setattr(
config_mod, "load_config", lambda: _config(max_attempts)
)
monkeypatch.setattr(
config_mod, "load_config_readonly", lambda: _config(max_attempts)
)
db = SessionDB(db_path=tmp_path / "state.db")
with (
contextlib.redirect_stdout(io.StringIO()),