OpenProgram Docs

Web frontend subprocess creation

The worker starts Next.js through start_web_frontend in openprogram/operations/worker/web.py and restarts it when .next/BUILD_ID changes. Both spawn sites pass no_window_creation_flags() from openprogram.host._platform.process_ownership, and each imports it in its own function scope.

CaseBehaviour
POSIX flagsZero
Windows flagsBackground window
Initial spawn raises OSErrorReported; returns None
Rebuild spawn raises OSErrorReported; the watcher still sees the next build
ShutdownStops the latest successfully spawned child
Acceptance and boundaries
  • Component tests call the public startup entry with fake subprocesses and capture the production watcher callback without starting an unbounded thread. A temporary BUILD_ID file drives successive rebuilds.
  • They check helper flags at initial and repeated spawns, latest-child shutdown and recovery after a spawn error. Process creation and port reclamation are isolated, so the running App is unaffected.
  • Command construction, environment propagation, port reclamation and manifest patching are unrelated to the flags. Watcher scheduling, shutdown cancellation and other platform behaviour are out of scope.
  • No dependency, API, configuration or security-boundary change.
Last updated · 2026-11-25