chore: optimize SIGWINCH vision and recovery logic

This commit is contained in:
Mahima Shanware
2026-05-06 05:53:15 +00:00
parent 0c02dec524
commit dcf47f9207
2 changed files with 6 additions and 4 deletions
+1
View File
@@ -68,3 +68,4 @@ temp_agents/
# conductor extension and planning directories
conductor/
simulator_workspace_*
+5 -4
View File
@@ -122,8 +122,9 @@ export class UserSimulator {
// (e.g. ANSI clear/repaint sequences) before looking at the screen.
// Increased to 1s to handle high-latency PTYs in Docker.
// Force a terminal repaint by sending SIGWINCH to the current process.
process.kill(process.pid, "SIGWINCH");
await new Promise((resolve) => setTimeout(resolve, 1000));
debugLogger.log('[SIMULATOR] Sending SIGWINCH to process group to force repaint.');
try { process.kill(0, 'SIGWINCH'); } catch (_e) { process.kill(process.pid, 'SIGWINCH'); }
await new Promise((resolve) => setTimeout(resolve, 1500));
const screen = this.getScreen();
if (!screen) return;
@@ -176,8 +177,8 @@ export class UserSimulator {
// RECOVERY: If screen is blank and we are stalled, try a terminal refresh.
if (normalizedScreen.length === 0 && this.pendingToolCalls.length > 0) {
debugLogger.log('[SIMULATOR] Screen is blank but system is BLOCKED. Sending refresh carriage return.');
this.stdinBuffer.write('\r');
debugLogger.log('[SIMULATOR] Screen is blank but system is BLOCKED. Sending SIGWINCH refresh.');
try { process.kill(0, 'SIGWINCH'); } catch (_e) { process.kill(process.pid, 'SIGWINCH'); }
return;
}
} else {