fix(look-at): avoid empty stable idle completion

This commit is contained in:
YeonGyu-Kim
2026-05-21 12:54:56 +09:00
parent 6e6f300c7d
commit bd55396266
3 changed files with 20 additions and 1 deletions
+5 -1
View File
@@ -9,6 +9,7 @@ export interface PollOptions {
timeoutMs?: number
abortSignal?: AbortSignal
allowStableIdleWithoutActivity?: boolean
allowEmptyStableIdleWithoutActivity?: boolean
}
const DEFAULT_POLL_INTERVAL_MS = 1000
@@ -136,7 +137,10 @@ export async function waitForLookAtSessionResult(
const canConcludeIdle =
sawNonIdleStatus ||
!status.supported ||
Boolean(options?.allowStableIdleWithoutActivity)
(
Boolean(options?.allowStableIdleWithoutActivity)
&& (outcome.hasAssistant || Boolean(options?.allowEmptyStableIdleWithoutActivity))
)
if (canConcludeIdle && stableIdlePolls >= IDLE_STABILITY_POLLS_REQUIRED) {
return { messages, outcome, statusType }