test(agent): isolate steer persistence regression

(cherry picked from commit 004b4cad4bc346f8fc4d85aeadb7f2977e38e97e)
This commit is contained in:
fangliquan
2026-09-20 18:31:10 +08:00
committed by Teknium
parent bb9058d7e8
commit bee33c7ce1

View File

@@ -10,7 +10,10 @@ from run_agent import AIAgent
def test_flushed_steer_keeps_one_display_identity_across_compactions(tmp_path):
db = SessionDB(tmp_path / "state.db")
session_id = "steer-compaction"
with patch.dict("os.environ", {"OPENROUTER_API_KEY": "test-key"}):
with (
patch.dict("os.environ", {"OPENROUTER_API_KEY": "test-key"}),
patch("agent.model_metadata.fetch_model_metadata", return_value={}),
):
agent = AIAgent(
api_key="test-key",
base_url="https://openrouter.ai/api/v1",