Skip to content

docs(apify-actor-development): add remote-first guidance for Playwright Actors#62

Draft
DaveHanns wants to merge 1 commit into
apify:mainfrom
DaveHanns:docs/skill-playwright-remote-first
Draft

docs(apify-actor-development): add remote-first guidance for Playwright Actors#62
DaveHanns wants to merge 1 commit into
apify:mainfrom
DaveHanns:docs/skill-playwright-remote-first

Conversation

@DaveHanns

Copy link
Copy Markdown

Summary

Add a new section to skills/apify-actor-development/SKILL.md that tells agents to skip local apify run for browser-based Actors and go straight to apify push + apify call. Playwright's bundled Chromium requires native system libraries that many agent sandboxes, minimal containers, and CI runners don't ship — so today agents spend several turns diagnosing what looks like Actor bugs but is really an environment gap.

Problem

When an agent scaffolds a Playwright / PlaywrightCrawler Actor and runs apify run inside a typical agent sandbox or minimal container, one of three failure modes shows up:

  1. Chromium binary missing / unlaunchable:

    browserType.launch: Failed to launch: Error: spawn .../chrome-headless-shell ENOENT
    
  2. Dynamic linker missing (musl-based or stripped images):

    ls: /lib64/ld-linux-x86-64.so.2: No such file or directory
    
  3. playwright install-deps cannot escalate:

    su: must be suid to work properly
    Failed to install browser dependencies
    

All three look like Actor code bugs, but the fix is always the same: run remotely on the Apify platform, whose Actor images already include glibc, libnss3, libatk, fonts, and the rest of the Chromium runtime.

Fix

New section "Testing Playwright (and other browser-based) Actors" in SKILL.md, placed right after the existing "Local testing" section. It:

  • Recommends skipping local apify run for browser Actors and going straight to apify push + apify call.
  • Quotes the three typical error signatures verbatim so agents recognize them fast and pivot instead of chasing the code.
  • Provides a small capability probe:
    if [ ! -e /lib64/ld-linux-x86-64.so.2 ] && [ ! -e /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 ]; then
      echo "Local browsers unlikely to launch here — use apify push + apify call instead."
    fi
  • Warns explicitly against running npx playwright install-deps in unprivileged environments (it needs root apt access).
  • Clarifies that non-browser Actors (Cheerio, plain HTTP, Python requests) are unaffected — apify run remains the right local loop for them.

Docs-only change; no code paths touched.

Test plan

  • skills/apify-actor-development/SKILL.md renders with a new "Testing Playwright (and other browser-based) Actors" section between "Local testing" and "Standby mode".
  • The ld-linux-so heuristic and the three verbatim error strings are present so agents can grep for them.
  • An agent scaffolding a fresh PlaywrightCrawler Actor in a sandboxed environment reads this section and goes straight to apify push + apify call on the first attempt instead of debugging local browser launches.

Surfaced during an evaluation of Apify surfaces for agent-driven Actor development.

…ht Actors

Playwright's bundled Chromium needs native system libraries (glibc, libnss3,
libatk, fonts) that many agent sandboxes, minimal containers, and CI runners
don't provide. `apify run` for a Playwright Actor then fails with confusing
errors like `chrome-headless-shell ENOENT`, missing `ld-linux-x86-64.so.2`, or
`su: must be suid to work properly` from `playwright install-deps` — all of
which look like Actor bugs but are actually environment gaps.

Add a "Testing Playwright (and other browser-based) Actors" section that:
- recommends skipping local `apify run` for browser Actors and going straight
  to `apify push` + `apify call`, since the platform's images have every
  browser dependency preinstalled;
- lists the typical failure signatures so agents recognize them and pivot
  quickly instead of chasing the code;
- provides a small `ld-linux-x86-64.so.2` probe as a programmatic capability
  check;
- warns against `npx playwright install-deps` in unprivileged environments;
- clarifies that non-browser Actors (Cheerio / HTTP / requests) are unaffected.

Surfaced during an evaluation of Apify surfaces for agent-driven Actor development.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@DaveHanns
DaveHanns marked this pull request as draft July 5, 2026 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants