fix(channels): preserve explicit compaction feedback and silent delivery

This commit is contained in:
Xubin Ren committed 2026-09-30 13:44:42 +08:00
1 parent 0b402d0414
commit 7644d845b4
13 files changed
+96 -37

No files matched your search

+3 -1
View File
@@ -798,10 +798,12 @@ async def test_followups_only_repeat_issue_context_when_it_changes(tmp_path: Pat
@pytest.mark.asyncio
@pytest.mark.parametrize("notify", [False, True])
@pytest.mark.parametrize("idle", [True, False])
@pytest.mark.parametrize("phase", ["succeeded", "failed", "cancelled"])
async def test_compaction_restores_issue_context_on_next_message(
tmp_path: Path, idle: bool, phase: Literal["succeeded", "failed", "cancelled"],
notify: bool,
) -> None:
channel, _ = _runtime(tmp_path)
payload = _agent_webhook()
@@ -815,7 +817,7 @@ async def test_compaction_restores_issue_context_on_next_message(
await channel.send(outbound_message_for_event(
channel="linear", chat_id=inbound.chat_id,
metadata={} if idle else inbound.metadata,
event=ContextCompactionEvent(compaction_id="compact", phase=phase, notify=True),
event=ContextCompactionEvent(compaction_id="compact", phase=phase, notify=notify),
))
for delivery, include_context in (("after", phase == "succeeded"), ("again", False)):
await channel._process_webhook(delivery, followup) # pyright: ignore[reportPrivateUsage]