Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): stop replaying old agent alerts on restart #13340

Mergedjuliusmarmingemerged 2 commits intomain fromrefs/pull/13340/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 178 additions and 1 deletion (loading 1).

x
0 of 2 viewed, 2 left
178 additions and 1 deletionapps/server/src/relay/AgentAwarenessRelay.test.tsModified
View file
@@ -20,6 +20,7 @@
import { RelayClientTracer } from "@t3tools/shared/relayTracing";
import { RELAY_ACTIVITY_PUBLISH_TYP, verifyRelayJwt } from "@t3tools/shared/relayJwt";
import { describe, expect, it } from "@effect/vitest";
+import * as DateTime from "effect/DateTime";
import * as Deferred from "effect/Deferred";
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
@@ -325,6 +326,9 @@
const projectId = "project-1" as ProjectId;
const activeThreadId = "thread-active" as ThreadId;
const idleThreadId = "thread-idle" as ThreadId;
+ const oldCompletedId = "thread-old-completed" as ThreadId;
+ const newCompletedId = "thread-new-completed" as ThreadId;
+ const freshMessageId = "thread-fresh-message" as ThreadId;
​
const baseThread = {
projectId,
@@ -351,6 +355,7 @@
expect(
AgentAwarenessRelay.resolveAgentAwarenessRelayActiveThreadIds({
environmentId,
+ startedAt: Date.parse(now),
projects: [
id: projectId,
@@ -374,6 +379,44 @@