mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-31 19:16:29 +00:00
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:
parent
243c9182b1
commit
a16fd675df
4 changed files with 12 additions and 0 deletions
|
|
@ -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()
|
||||
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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()),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue