Preserve session key when archiving new sessions

This commit is contained in:
chengyongru authored and Xubin Ren committed 2026-06-10 18:09:45 +08:00
1 parent bfc6febddc
commit 8c30dc5a57
3 files changed
+17 -7

No files matched your search

@@ -219,8 +219,11 @@ async def test_preflight_consolidation_before_llm_call(tmp_path, monkeypatch) ->
loop = _make_loop(tmp_path, estimated_tokens=0, context_window_tokens=200)
async def track_consolidate(messages):
archived_session_keys: list[str | None] = []
async def track_consolidate(messages, *, session_key=None):
order.append("consolidate")
archived_session_keys.append(session_key)
return True
loop.consolidator.archive = track_consolidate # type: ignore[method-assign]
@@ -251,3 +254,4 @@ async def test_preflight_consolidation_before_llm_call(tmp_path, monkeypatch) ->
assert "consolidate" in order
assert "llm" in order
assert order.index("consolidate") < order.index("llm")
assert archived_session_keys == ["cli:test"]