Skip to content

Commit 6311df2

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 6948acc commit 6311df2

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
@@ -91,8 +91,10 @@ export function shouldPublishAgentAwarenessEvent(
9191
// pending background work (a finished subagent, a cleared roster, or an
9292
// ended background item can release a held completion), and settlement
9393
// (settling a finished thread removes it). Unsettling is not published: the
94-
// row is already gone, and its fresh updatedAt would re-alert Done. Message
95-
// bodies and tool progress cannot change the published activity.
94+
// row is already gone, and republishing a completed row with a fresh
95+
// updatedAt would look newly finished (#11938 still covers later rename /
96+
// model / PR sync after an unsettle). Message bodies and tool progress
97+
// cannot change the published activity.
9698
switch (event.type) {
9799
case "thread.created":
98100
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)