fix(agent-switch): correct off-by-one in fallback message cap
This commit is contained in:
parent
e44354e98e
commit
0d30d717e1
@ -114,7 +114,7 @@ export function createAgentSwitchHook(ctx: PluginInput) {
|
|||||||
processedFallbackMessages.add(marker)
|
processedFallbackMessages.add(marker)
|
||||||
|
|
||||||
// Prevent unbounded growth of the Set
|
// 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 iterator = processedFallbackMessages.values()
|
||||||
const oldest = iterator.next().value
|
const oldest = iterator.next().value
|
||||||
if (oldest) {
|
if (oldest) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user