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 e44354e98e
commit 0d30d717e1

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) {