{"record":{"id":"1ee378c0799fc866","repo":"jackwener/OpenCLI","slug":"opencli-tab-tabid-url-is-not-debuggable-ta","errorCode":null,"errorMessage":"[opencli] Tab ${tabId} URL is not debuggable (${tab.url}), re-resolving","messagePattern":"\\[opencli\\] Tab (.+?) URL is not debuggable \\((.+?)\\), re-resolving","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"extension/src/background.ts","lineNumber":1514,"sourceCode":"            : `Target tab is not the tab bound to session \"${session.session}\".`,\n          'Run \"opencli browser bind\" again on a debuggable http(s) tab.',\n        );\n      }\n      if (session && !matchesSession && session.preferredTabId === null && isDebuggableUrl(tab.url)) {\n        // Tab drifted to another window but content is still valid.\n        // Try to move it back instead of abandoning it.\n        console.warn(`[opencli] Tab ${tabId} drifted to window ${tab.windowId}, moving back to ${session.windowId}`);\n        try {\n          await chrome.tabs.move(tabId, { windowId: session.windowId, index: -1 });\n          const moved = await chrome.tabs.get(tabId);\n          if (moved.windowId === session.windowId && isDebuggableUrl(moved.url)) {\n            return { tabId, tab: moved };\n          }\n        } catch (moveErr) {\n          console.warn(`[opencli] Failed to move tab back: ${moveErr}`);\n        }\n      } else if (!isDebuggableUrl(tab.url)) {\n        console.warn(`[opencli] Tab ${tabId} URL is not debuggable (${tab.url}), re-resolving`);\n      }\n    } catch (err) {\n      if (err instanceof CommandFailure) throw err;\n      if (existingSession && !existingSession.owned) {\n        automationSessions.delete(leaseKey);\n        throw new CommandFailure(\n          'bound_tab_gone',\n          `Bound tab for session \"${existingSession.session}\" no longer exists.`,\n          'Run \"opencli browser bind\" again, then retry the command.',\n        );\n      }\n      console.warn(`[opencli] Tab ${tabId} no longer exists, re-resolving`);\n    }\n  }\n\n  const existingPreferredTabId = existingSession?.preferredTabId ?? null;\n  if (existingSession && existingPreferredTabId !== null) {\n    const session = existingSession;","sourceCodeStart":1496,"sourceCodeEnd":1532,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/extension/src/background.ts#L1496-L1532","documentation":"A console warning logged during tab re-resolution when the bound tab still exists but its current URL is not debuggable (not http/https devtools-eligible), so the extension re-resolves to a different tab. It indicates the bound tab navigated somewhere automation cannot attach to.","triggerScenarios":"The bound tab navigated to chrome://, chrome-extension://, file://, about:blank-adjacent, or web store pages, then an automation command re-resolves the session's tab.","commonSituations":"User types a chrome:// URL in the automation tab; a redirect lands on a non-debuggable page; navigation to an internal page during a run.","solutions":["Navigate the tab back to an http(s) URL before running commands","Re-run 'opencli browser bind' on a debuggable http(s) tab","Prevent manual navigation of the automation tab, or run automation in a dedicated window","If a redirect causes it, intercept or whitelist the target URL in the automation flow"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const tab = await chrome.tabs.get(tabId);\nif (!/^https?:/.test(tab.url ?? '')) await rebindToDebuggableTab();","typeGuard":"const isDebuggable = (url) => typeof url === 'string' && /^https?:\\/\\//.test(url);","tryCatchPattern":null,"preventionTips":["Keep the automation tab on http(s) URLs","Block manual navigation to chrome:// pages in the automation tab","Rebind after intentional navigation to non-debuggable pages"],"tags":["chrome-extension","debugging","tab-management"],"backgroundTag":"non-debuggable-tab-url","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}