aboutsummaryrefslogtreecommitdiff
path: root/modules/core/module-debug-supervisor.js
diff options
context:
space:
mode:
Diffstat (limited to 'modules/core/module-debug-supervisor.js')
-rw-r--r--modules/core/module-debug-supervisor.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/core/module-debug-supervisor.js b/modules/core/module-debug-supervisor.js
index 6768df1..79c9acc 100644
--- a/modules/core/module-debug-supervisor.js
+++ b/modules/core/module-debug-supervisor.js
@@ -173,6 +173,10 @@ class DebugSupervisorModule {
try {
localStorage.removeItem('webx11_chat_token');
localStorage.removeItem('webx11_chat_state');
+ // a stale agent cursor would point past the end of the new, empty thread
+ Object.keys(localStorage)
+ .filter(k => k.indexOf('webx11_chat_agent_cursor') === 0)
+ .forEach(k => localStorage.removeItem(k));
this.terminal.print('🔄 Chat token rotated — a new thread starts with your next message', 'success');
} catch (e) {
this.terminal.print('❌ ' + e.message, 'error');