Skip to content

render-omp.mjs fails on omp relay-browser sessions: facade screenshot guard blocks every render #27

Description

@rz1989s

Environment: omp (darwin-arm64), session browser attached to a relay Chrome (http://127.0.0.1:9224), macOS 26 (Kernel 25.6.0), keystone @getpipher/keystone from ~/.omp/plugins/node_modules.

Repro (the documented §7.2 omp path):

  1. omp session whose browser global attaches to the user's relay Chrome (not a spawned headless).
  2. In the eval kernel: const { render } = await import('<plugins>/@getpipher/keystone/engine/render-omp.mjs'); await render({ htmlPath, viewports: [1280, 375], outDir })
  3. Driver opens the tab fine (Opened tab "keystone-1280-…" on relay), then dies at screenshot:
ToolError: The attached browser tab is not visible; switch to it before taking a screenshot

Expected: §7.2 renders work on any omp session, including relay-attached ones.

Actual: omp's facade tab.screenshot() guard requires the tab to be the visible tab; background relay tabs always fail. driver-omp-native.mjs comments assume "shared, headless, launch-on-first-use" — that assumption doesn't hold on relay sessions.

Workaround that worked (no tab-switching needed): replace the tab's screenshot method on a clone — call raw Puppeteer page.screenshot({ encoding: 'base64' }) via tab.run and return a data: URL; driver-omp-native's writeScreenshot already handles data: strings. CDP captureScreenshot renders background tabs fine. Suggest the driver do this internally (or offer a transport: 'raw-cdp' option / bringToFront fallback) so the documented one-import flow works on relay sessions.

Happy to verify a fix against my session. (Also: after this failure, render-core leaves the opened tab behind — the error path doesn't close it.)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions