mirror of
https://github.com/moltbot/moltbot.git
synced 2026-03-07 22:44:16 +00:00
fix: respect canceled_by_user and replaced_with_devtools detach reasons
Skip re-attach when user explicitly dismisses debugger bar or opens DevTools. Prevents frustrating re-attach loop that fights user intent. Addresses review feedback from greptile-apps.
This commit is contained in:
@@ -653,15 +653,18 @@ async function onDebuggerDetach(source, reason) {
|
||||
if (!tabId) return
|
||||
if (!tabs.has(tabId)) return
|
||||
|
||||
// User explicitly cancelled or DevTools replaced the connection — respect their intent
|
||||
if (reason === 'canceled_by_user' || reason === 'replaced_with_devtools') {
|
||||
void detachTab(tabId, reason)
|
||||
return
|
||||
}
|
||||
|
||||
// Check if tab still exists — distinguishes navigation from tab close
|
||||
let tabInfo
|
||||
try {
|
||||
tabInfo = await chrome.tabs.get(tabId)
|
||||
} catch {
|
||||
// Tab is gone (closed) — normal cleanup
|
||||
void detachTab(tabId, reason)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user