Skip to content

Commit a1c6ba1

Browse files
test(server): cover settled Live Activity rows held by monitors
Also clarify that skipping thread.unsettled only blocks the immediate re-alert; #11938 still covers later metadata republishes. Co-authored-by: Cursor <[email protected]>
1 parent 2148da0 commit a1c6ba1

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

‎apps/server/src/relay/AgentAwarenessRelay.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,10 @@ export function shouldPublishAgentAwarenessEvent(
8585
) {
8686
return false;
8787
}
88-
// Unsettling is not published: the row is already gone and a re-published
89-
// completed thread would re-alert Done for work the user already dismissed.
88+
// Unsettling is not published: the row is already gone and republishing a
89+
// completed thread with a fresh updatedAt would re-alert Done for work the
90+
// user already dismissed. A later rename, model change, or PR sync after an
91+
// unsettle can still re-alert (#11938).
9092
switch (event.type) {
9193
case "thread.created":
9294
case "thread.archived":

‎packages/shared/src/agentAwareness.test.ts‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,20 @@ describe("projectThreadAwarenessV2", () => {
109109
).toMatchObject({ phase: "waiting_for_input" });
110110
});
111111

112+
it("keeps a settled completed run held open by a monitor", () => {
113+
expect(
114+
projectThreadAwarenessV2({
115+
environmentId: "env-1" as EnvironmentId,
116+
project,
117+
thread: v2Thread({
118+
status: "completed",
119+
settledOverride: "settled",
120+
pendingBackgroundTasks: [{ taskId: "watch", kind: "monitor" }],
121+
}),
122+
}),
123+
).toMatchObject({ phase: "running" });
124+
});
125+
112126
it("keeps an older activity run visible over a newer cancelled run", () => {
113127
expect(
114128
projectThreadAwarenessV2({

0 commit comments

Comments
 (0)