The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
test: pin checkpoint transcript persistence before the next request
Teknium35104c20f5c3
diff --git a/tests/agent/test_iteration_budget_warning.py b/tests/agent/test_iteration_budget_warning.pyindex 90b46ee807e..0001c23672b 100644--- a/tests/agent/test_iteration_budget_warning.py+++ b/tests/agent/test_iteration_budget_warning.py@@ -10,7 +10,9 @@ def _agent(tmp_path, monkeypatch, ratio):f"agent:\n budget_warning_ratio: {ratio}\n", encoding="utf-8")from run_agent import AIAgent- return AIAgent(model="test-model", provider="openai-compat", api_key="test",+ from hermes_state import SessionDB+ return AIAgent(session_db=SessionDB(db_path=tmp_path / "proof.db"),+ model="test-model", provider="openai-compat", api_key="test",base_url="http://127.0.0.1:1/v1", max_iterations=4,quiet_mode=True, skip_context_files=True, skip_memory=True)@@ -46,7 +48,13 @@ def test_checkpoint_rearms_per_turn_with_tools_still_available(tmp_path, monkeypmessages = [{"role": "user", "content": "work"},{"role": "assistant", "tool_calls": [{"id": "t", "type": "function", "function": {"name": "read_file", "arguments": "{}"}}]},{"role": "tool", "tool_call_id": "t", "content": deepcopy(content)}]+ from agent.tool_executor import _flush_session_db_after_tool_progress+ assert _flush_session_db_after_tool_progress(agent, messages, stage="checkpoint")+ persisted = agent._session_db.get_messages(agent.session_id)+ assert "3 of 4" in str(persisted[-1]["content"])+ snapshot = deepcopy(messages)prepare_iteration(agent, messages=messages, api_call_count=3)+ assert messages == snapshotassert "3 of 4" in str(messages[-1]["content"])assert agent.iteration_budget.consume()assert not agent.iteration_budget.consume()