sync update from LAN repo (source ji @ 85078a31)

This commit is contained in:
gozeros committed 2026-10-21 15:09:16 +08:00
1 parent 5d6627af50
commit e602d88695
864 files changed
+99150 -6346

No files matched your search

@@ -48,6 +48,47 @@ async def test_parallel_task_repository_rejects_stale_revision(tmp_path) -> None
assert final is not None
assert final["title"] == "newer"
assert final["messages"] == [{"snapshot": "newer"}]
lightweight = await store.list_tasks("user-1")
assert "messages" not in lightweight[0]
with_snapshots = await store.list_tasks("user-1", include_messages=True)
assert with_snapshots[0]["messages"] == [{"snapshot": "newer"}]
await store.create_task(
"user-1",
{
"id": "parallel-unrelated",
"title": "unrelated",
"messages": [{"large": "transcript"}],
},
)
await asyncio.sleep(0.002)
await store.create_task(
"user-1",
{
"id": "strategy-selection-second",
"title": "second",
"messages": [{"snapshot": "second"}],
},
)
first_page = await store.list_tasks(
"user-1",
limit=1,
id_prefix="strategy-selection-",
include_messages=True,
)
second_page = await store.list_tasks(
"user-1",
limit=1,
offset=1,
id_prefix="strategy-selection-",
include_messages=True,
)
assert [first_page[0]["id"], second_page[0]["id"]] == [
"strategy-selection-second",
"strategy-selection-cas",
]
assert first_page[0]["messages"] == [{"snapshot": "second"}]
finally:
await engine.dispose()