fix(telegram): brief-seeded branches reply and stream in their topic
This commit is contained in:
@@ -474,6 +474,27 @@ async def test_commands_status_merge_and_new(stack: Stack) -> None:
|
||||
assert stack.bot.topics[-1] == "edit:902:✅ отчёт"
|
||||
|
||||
|
||||
async def test_brief_branch_from_the_tool_replies_in_its_topic(stack: Stack) -> None:
|
||||
stack.bot.message("hi")
|
||||
await stack.until(lambda: stack.sent_with("hi"), what="reply")
|
||||
master = await stack.world.conversations.find_bound(
|
||||
frontend="telegram", external_id=GENERAL
|
||||
)
|
||||
child = await stack.world.conversations.spawn(
|
||||
kind="branch",
|
||||
seed="brief",
|
||||
text="найди X",
|
||||
title="X",
|
||||
parent=master,
|
||||
origin="mcp",
|
||||
)
|
||||
reply = await stack.until(lambda: stack.sent_with("найди X"), what="brief reply")
|
||||
assert reply["thread"] == 902
|
||||
assert not any(m["text"].startswith("📝") for m in stack.bot.sent)
|
||||
assert any(d["message_thread_id"] == 902 for d in stack.bot.drafts)
|
||||
assert (await stack.world.conversations.get(child.external_id)).flags == {}
|
||||
|
||||
|
||||
async def test_master_topic_survives_rotation(stack: Stack) -> None:
|
||||
stack.bot.message("hi")
|
||||
await stack.until(lambda: stack.sent_with("hi"), what="reply")
|
||||
|
||||
Reference in New Issue
Block a user