fix: stop sending context compaction notifications
This commit is contained in:
1 parent
fbe9b4fd72
commit
0b402d0414
31 files changed
+157
-38
No files matched your search
@@ -130,6 +130,8 @@ class LinearChannel(BaseChannel):
|
||||
if isinstance(event, ContextCompactionEvent):
|
||||
if event.phase == "succeeded":
|
||||
self._issue_contexts.pop(msg.chat_id, None)
|
||||
if not event.notify:
|
||||
return
|
||||
# Idle notifications have no originating Linear turn. Sending a thought
|
||||
# through the cached route would reactivate an already completed session.
|
||||
if _linear_route(msg.metadata) is None:
|
||||
|
||||
@@ -815,7 +815,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),
|
||||
event=ContextCompactionEvent(compaction_id="compact", phase=phase, notify=True),
|
||||
))
|
||||
for delivery, include_context in (("after", phase == "succeeded"), ("again", False)):
|
||||
await channel._process_webhook(delivery, followup) # pyright: ignore[reportPrivateUsage]
|
||||
@@ -1211,7 +1211,9 @@ async def test_compaction_uses_temporary_progress_and_a_persistent_outcome(
|
||||
channel="linear",
|
||||
chat_id="session-1",
|
||||
metadata=metadata,
|
||||
event=ContextCompactionEvent(compaction_id="compaction-1", phase="started"),
|
||||
event=ContextCompactionEvent(
|
||||
compaction_id="compaction-1", phase="started", notify=True,
|
||||
),
|
||||
))
|
||||
assert client.activities[0]["content"] == {
|
||||
"type": "thought", "body": "Compressing context\u2026",
|
||||
@@ -1222,7 +1224,7 @@ async def test_compaction_uses_temporary_progress_and_a_persistent_outcome(
|
||||
channel="linear",
|
||||
chat_id="session-1",
|
||||
metadata=metadata,
|
||||
event=ContextCompactionEvent(compaction_id="compaction-1", phase=phase),
|
||||
event=ContextCompactionEvent(compaction_id="compaction-1", phase=phase, notify=True),
|
||||
)
|
||||
await channel.send(outcome)
|
||||
assert client.activities[-1]["content"] == {"type": "thought", "body": outcome.content}
|
||||
|
||||
Reference in new issue
Block a user