Skip to content

Commit e02169b

Browse files
committed
Clear stale confirm deadline when projected state recovers unchanged
1 parent 97ed442 commit e02169b

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

apps/server/src/relay/AgentAwarenessRelay.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,11 @@ export const make = Effect.gen(function* () {
410410
const publishIdentity = agentAwarenessPublishIdentity(snapshot.state);
411411
const publishedStateByThread = yield* Ref.get(publishedStateByThreadRef);
412412
if (publishedStateByThread.get(threadId) === publishIdentity) {
413+
// The projection recovered to the last published state, so any deferred
414+
// confirmation (tombstone or first-state completion) is moot. Clear the
415+
// deadline so the next divergence gets a fresh deferral window instead
416+
// of confirming immediately against a stale, expired deadline.
417+
publishConfirmDeadlines.delete(threadId);
413418
yield* Effect.logDebug("agent activity publish skipped; projected state unchanged", {
414419
environmentId,
415420
threadId,

0 commit comments

Comments
 (0)