{"record":{"id":"625ca22f59bec845","repo":"stablyai/orca","slug":"no-active-terminal-pane-for-scrollback-api-scroll","errorCode":null,"errorMessage":"No active terminal pane for scrollback API scroll.","messagePattern":"No active terminal pane for scrollback API scroll\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"config/scripts/linux-wayland-terminal-exercise.mjs","lineNumber":286,"sourceCode":"  // Why: headless Wayland does not provide a reliable native wheel path in CI,\n  // so verify xterm's scrollback buffer can move without bypassing the renderer.\n  await runWithTimeout(\n    'terminal scrollback API scroll',\n    () =>\n      page.evaluate(() => {\n        const store = window.__store\n        const state = store?.getState()\n        const worktreeId = state?.activeWorktreeId\n        const tabId =\n          state?.activeTabType === 'terminal'\n            ? state.activeTabId\n            : worktreeId\n              ? (state?.activeTabIdByWorktree?.[worktreeId] ?? null)\n              : null\n        const manager = tabId ? window.__paneManagers?.get(tabId) : null\n        const pane = manager?.getActivePane?.() ?? manager?.getPanes?.()[0] ?? null\n        if (!pane) {\n          throw new Error('No active terminal pane for scrollback API scroll.')\n        }\n        pane.terminal.scrollLines(-10)\n      }),\n    rendererActionTimeoutMs\n  )\n  logPhase('scroll.api-scroll-sent')\n  const after = await waitFor('terminal scrollback API response', () =>\n    page.evaluate((previousViewportY) => {\n      const store = window.__store\n      const state = store?.getState()\n      const worktreeId = state?.activeWorktreeId\n      const tabId =\n        state?.activeTabType === 'terminal'\n          ? state.activeTabId\n          : worktreeId\n            ? (state?.activeTabIdByWorktree?.[worktreeId] ?? null)\n            : null\n      const manager = tabId ? window.__paneManagers?.get(tabId) : null","sourceCodeStart":268,"sourceCodeEnd":304,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/linux-wayland-terminal-exercise.mjs#L268-L304","documentation":"During the scrollback assertion, the scrollback API scroll step resolves the active terminal pane (same store → tab → pane manager walk as focusActiveTerminal) and throws if no pane exists before calling terminal.scrollLines(-10). It mirrors the focus guard because the scroll must target a live pane.","triggerScenarios":"The pane disappeared between the 'scrollable terminal buffer' check and the API scroll; the active tab/pane state changed mid-assertion; the pane manager no longer has the tab.","commonSituations":"Terminal pane unmounted during the assertion (e.g. PTY closed, tab switched); GPU wedge cleared and reset state; teardown racing the scroll.","solutions":["Ensure the terminal pane stays mounted through the whole scrollback assertion (no tab switch / PTY close).","Re-run the assertion after confirming the pane is stable.","Check that activeTabType and activeTabId still point at the terminal tab at scroll time."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"const hasPane = await page.evaluate(() => {\n  const state = window.__store?.getState?.()\n  const tabId = state?.activeTabType === 'terminal' ? state.activeTabId : null\n  const manager = tabId ? window.__paneManagers?.get(tabId) : null\n  return Boolean(manager?.getActivePane?.() ?? manager?.getPanes?.()[0])\n})\nif (!hasPane) throw new Error('cannot scroll: no active terminal pane')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the terminal pane mounted through the entire scrollback assertion (no tab switch or PTY close).","Re-verify activeTabType/activeTabId at scroll time if the GPU stall may have reset state."],"tags":["wayland","terminal","scrollback"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}