fix(todo-continuation): remove activity-based stagnation bypass

Activity signals (tool calls like compress, grep, bash) were treated as
'progress' by the stagnation detector, resetting the stagnation counter
every cycle. This prevented MAX_STAGNATION_COUNT from being reached,
causing infinite continuation loops when models degrade to minimal
responses in long sessions (e.g. GLM-5.1 at ~100K tokens).

Stagnation now only tracks actual todo state changes: incomplete count
decrease, completed count increase, or todo snapshot change. Tool-level
activity no longer resets the stagnation counter.
This commit is contained in:
Evgeny Zotov
2026-04-10 20:07:56 +02:00
committed by YeonGyu-Kim
parent fe66c96215
commit 68e9d54fa5
6 changed files with 7 additions and 78 deletions
@@ -16,14 +16,6 @@ import { acknowledgeCompactionGuard, isCompactionGuardActive } from "./compactio
import type { SessionStateStore } from "./session-state"
import { startCountdown } from "./countdown"
function shouldAllowActivityProgress(modelID: string | undefined): boolean {
if (!modelID) {
return false
}
return !modelID.toLowerCase().includes("codex")
}
export async function handleSessionIdle(args: {
ctx: PluginInput
sessionID: string
@@ -204,7 +196,6 @@ export async function handleSessionIdle(args: {
sessionID,
incompleteCount,
todos,
{ allowActivityProgress: shouldAllowActivityProgress(resolvedInfo?.model?.modelID) },
)
if (shouldStopForStagnation({ sessionID, incompleteCount, progressUpdate })) {
return