Improve screen normalization in UserSimulator to prevent polling loops

This commit is contained in:
Your Name
2026-04-20 18:52:05 +00:00
committed by Mahima Shanware
parent 7cc657add2
commit 27ed3a4d07
+5 -2
View File
@@ -101,8 +101,11 @@ export class UserSimulator {
.replace(/\n([ \t]*\n)+/g, '\n\n');
const normalizedScreen = strippedScreen
.replace(/[⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏]/g, '')
.replace(/\[?\s*\b\d+(\.\d+)?s\b\s*\]?/g, '')
.replace(/[\u2800-\u28FF]/g, '')
.replace(/[|/-\\]/g, '')
.replace(/\b\d+(\.\d+)?s\b/g, '')
.replace(/\b\d+m\s+\d+s\b/g, '')
.replace(/\(\s*\)/g, '')
.trim();
if (normalizedScreen === this.lastScreenContent) return;