fix(agent-switch): correct off-by-one in fallback message cap

This commit is contained in:
ismeth
2026-02-20 14:19:10 +01:00
committed by YeonGyu-Kim
parent afab3e658a
commit 0679167cc7
+1 -1
View File
@@ -114,7 +114,7 @@ export function createAgentSwitchHook(ctx: PluginInput) {
processedFallbackMessages.add(marker)
// Prevent unbounded growth of the Set
if (processedFallbackMessages.size > MAX_PROCESSED_FALLBACK_MARKERS) {
if (processedFallbackMessages.size >= MAX_PROCESSED_FALLBACK_MARKERS) {
const iterator = processedFallbackMessages.values()
const oldest = iterator.next().value
if (oldest) {