{"record":{"id":"78273b18bca9a7a8","repo":"garrytan/gstack","slug":"tab-tabid-not-found","errorCode":null,"errorMessage":"Tab ${tabId} not found","messagePattern":"Tab (.+?) not found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"browse/src/browser-manager.ts","lineNumber":799,"sourceCode":"    // Record tab ownership for multi-agent isolation\n    if (clientId) {\n      this.tabOwnership.set(id, clientId);\n    }\n\n    // Wire up console/network/dialog capture\n    this.wirePageEvents(page);\n\n    if (normalizedUrl) {\n      await page.goto(normalizedUrl, { waitUntil: 'domcontentloaded', timeout: 15000 });\n    }\n\n    return id;\n  }\n\n  async closeTab(id?: number): Promise<void> {\n    const tabId = id ?? this.activeTabId;\n    const page = this.pages.get(tabId);\n    if (!page) throw new Error(`Tab ${tabId} not found`);\n\n    await page.close();\n    this.pages.delete(tabId);\n    this.tabSessions.delete(tabId);\n    this.tabOwnership.delete(tabId);\n\n    // Switch to another tab if we closed the active one\n    if (tabId === this.activeTabId) {\n      const remaining = [...this.pages.keys()];\n      if (remaining.length > 0) {\n        this.activeTabId = remaining[remaining.length - 1];\n      } else {\n        // No tabs left — create a new blank one\n        await this.newTab();\n      }\n    }\n  }\n","sourceCodeStart":781,"sourceCodeEnd":817,"githubUrl":"https://github.com/garrytan/gstack/blob/94993f74012782fd94416dd44b8314f6363a13a4/browse/src/browser-manager.ts#L781-L817","documentation":"Error \"Tab ${tabId} not found\" thrown in garrytan/gstack.","triggerScenarios":"Thrown at browse/src/browser-manager.ts:799 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"94993f74012782fd94416dd44b8314f6363a13a4","analyzedAt":"2026-08-12T04:06:23.140Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}