Skip to content

agent-screen-pool

agent-screen-pool #158

name: agent-screen-pool
# On-demand live-browser caster for the agent wall (workers/agent-screen-pool).
#
# This is the BURST runner, not a 24/7 host: GitHub caps a job at 6h, so each run
# casts watched agents for ~5.4h then exits. The schedule re-launches it so it
# self-renews around the clock; trigger manually for events/demos. For a true
# always-on pool, run the Docker image on a small VM (see the worker README) —
# the platform's zero-cost activity view covers every agent regardless.
#
# Requires repo secret SCREEN_WORKER_SECRET (must match the value set on the API).
on:
workflow_dispatch:
inputs:
max_browsers:
description: 'Max concurrent live casts'
required: false
default: '6'
runtime_minutes:
description: 'How long this run should cast before exiting'
required: false
default: '320'
schedule:
# Every 5 hours — each run lasts ~5.4h, so coverage overlaps with no gap.
- cron: '0 */5 * * *'
concurrency:
group: agent-screen-pool
cancel-in-progress: false
jobs:
cast:
runs-on: ubuntu-latest
timeout-minutes: 350
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
working-directory: workers/agent-screen-pool
run: npm install --omit=dev
- name: Install Chromium
working-directory: workers/agent-screen-pool
run: npx playwright install --with-deps chromium
- name: Run caster pool
working-directory: workers/agent-screen-pool
env:
SCREEN_WORKER_SECRET: ${{ secrets.SCREEN_WORKER_SECRET }}
BASE_URL: https://three.ws
MAX_BROWSERS: ${{ github.event.inputs.max_browsers || '6' }}
run: |
if [ -z "$SCREEN_WORKER_SECRET" ]; then
echo "SCREEN_WORKER_SECRET secret is not set on the repo — nothing to do."
exit 0
fi
MINUTES="${{ github.event.inputs.runtime_minutes || '320' }}"
timeout "${MINUTES}m" node index.js || code=$?
# 124 = timeout fired (expected, clean renewal); 0 = clean exit.
if [ "${code:-0}" -ne 0 ] && [ "${code:-0}" -ne 124 ]; then exit "${code}"; fi