refactor(runtime): consolidate followup, gateway, and provider dedupe paths

This commit is contained in:
Peter Steinberger
2026-02-22 14:06:03 +00:00
parent 38752338dc
commit d116bcfb14
36 changed files with 848 additions and 908 deletions

View File

@@ -1,5 +1,5 @@
import { applyQueueDropPolicy, shouldSkipQueueItem } from "../../../utils/queue-helpers.js";
import { FOLLOWUP_QUEUES, getFollowupQueue } from "./state.js";
import { getExistingFollowupQueue, getFollowupQueue } from "./state.js";
import type { FollowupRun, QueueDedupeMode, QueueSettings } from "./types.js";
function isRunAlreadyQueued(
@@ -57,11 +57,7 @@ export function enqueueFollowupRun(
}
export function getFollowupQueueDepth(key: string): number {
const cleaned = key.trim();
if (!cleaned) {
return 0;
}
const queue = FOLLOWUP_QUEUES.get(cleaned);
const queue = getExistingFollowupQueue(key);
if (!queue) {
return 0;
}