Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions apps/server/src/orchestration-v2/ModelAlertReactor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ export const make = Effect.gen(function* () {
/**
* The alert as it stands now: threads that moved on leave it, and null means nothing is left to
* say. A thread moved on when it has a newer run that runs or finished, is settled, archived or
* on another provider, or its parent replaced it.
* on another provider, or its parent replaced it. A model alert ignores newer runs.
*/
const currentAlert = Effect.fnUntraced(function* (alert: WatcherAlert) {
const stillCurrent = Effect.fnUntraced(function* (
Expand All @@ -749,11 +749,13 @@ export const make = Effect.gen(function* () {
if (fresh.length === 0) return null;
return fresh.length === alert.members.length ? alert : { ...alert, members: fresh };
}
const about =
alert.type === "model-degraded"
? { providerInstanceId: alert.providerInstanceId }
: undefined;
return (yield* stillCurrent(alert.threadId, alert.runId, about)) ? alert : null;
if (alert.type === "model-degraded") {
// A newer run does not answer a model alert: a run with the same problem stays quiet by
// design (recordModelAlert), so dropping this one would mean the watcher never hears it.
const about = { providerInstanceId: alert.providerInstanceId };
return (yield* stillCurrent(alert.threadId, null, about)) ? alert : null;
}
return (yield* stillCurrent(alert.threadId, alert.runId, undefined)) ? alert : null;
});

/**
Expand Down