feat(distill,conversations,scheduler,api,ui): close deep chats with a distiller fork, digest and index, idle and weekly state jobs

This commit is contained in:
hh
2026-08-29 03:15:39 +02:00
parent ab9ce50b82
commit 23cfb16228
11 changed files with 1103 additions and 19 deletions
+28
View File
@@ -420,3 +420,31 @@ async def test_pre_sdk_rows_show_canonical_history_and_a_title(world: World) ->
assert shown["title"] == "так смотри, план на май" and shown["session_id"] is None
history = await api.get(f"/conversations/{conv.external_id}/history")
assert [m["role"] for m in history["messages"]] == ["user", "assistant"]
async def test_close_distills_a_deep_chat(world: World) -> None:
from test_distill import DistillerClient, deep_chat, distiller
config = distiller(world, DistillerClient)
api = Api(world)
master = await world.conversations.create(kind="master", agent="a", origin="test")
chat = await deep_chat(world)
res = await api.http.post(
f"/conversations/{chat.external_id}/close", headers=HEADERS
)
assert res.status_code == 200, res.text
body = res.json()
assert body["status"] == "closed" and body["error"] is None
assert body["digest"] == str(config.dir / "2026-08-29 - тема.md")
assert body["text"].count("\n") == 2
assert (await world.conversations.get(chat.external_id)).status == "closed"
assert (await world.conversations.queue.recent(master.id))[0].origin == "выжимка"
again = await api.http.post(
f"/conversations/{chat.external_id}/close", headers=HEADERS
)
assert again.status_code == 400
branch = await world.conversations.create(kind="branch", agent="a", origin="test")
plain = await api.http.post(
f"/conversations/{branch.external_id}/close", headers=HEADERS
)
assert plain.status_code == 200 and plain.json()["status"] == "closed"