From 6f48261306a04bd50cb982230ee720259b851d8d Mon Sep 17 00:00:00 2001 From: Mahima Shanware Date: Wed, 29 Apr 2026 02:55:50 +0000 Subject: [PATCH] fix(simulator): allow acting on static screens when blocked to handle UI lag --- packages/cli/src/services/UserSimulator.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/services/UserSimulator.ts b/packages/cli/src/services/UserSimulator.ts index 540dea801a..ce0dbf58c2 100644 --- a/packages/cli/src/services/UserSimulator.ts +++ b/packages/cli/src/services/UserSimulator.ts @@ -36,6 +36,7 @@ export class UserSimulator { private editableKnowledgeFile: string | null = null; private actionHistory: string[] = []; private pendingToolCalls: ToolCall[] = []; + private staleCycleCount = 0; private messageBusHandler: ((msg: ToolCallsUpdateMessage) => void) | null = null; @@ -138,7 +139,17 @@ export class UserSimulator { const currentStateKey = `${normalizedScreen}::${pendingIds}`; if (currentStateKey === this.lastStateKey) { - return; + if (this.pendingToolCalls.length > 0) { + this.staleCycleCount++; + // Every 10 ticks (10s) on a static screen while blocked, we try a prompt + if (this.staleCycleCount % 10 !== 0) { + return; + } + } else { + return; + } + } else { + this.staleCycleCount = 0; } this.lastStateKey = currentStateKey;