The worker starts Next.js through start_web_frontend and restarts it when .next/BUILD_ID changes. Both subprocess creation sites use the shared no_window_creation_flags helper from openprogram._compat. Each calling function imports the helper in its own scope, just as the build function does. A function-local import in the build function cannot provide a binding to another function.
The existing platform helper supplies zero flags on POSIX and the background-window flag on Windows. Command construction, environment propagation, port reclamation and manifest patching retain their current behavior. A failed initial spawn returns None after reporting OSError. A failed rebuild spawn reports OSError and leaves the watcher able to observe a subsequent build. Shutdown selects the latest successful subprocess handle.
Component tests invoke 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. Tests verify helper flags at initial and repeated spawn sites, latest-child shutdown, and recovery after a spawn error. Process creation and port reclamation are isolated, so checks cannot affect the running App. Tests first fail against the missing-import baseline and then pass with the contributor's fix.
This change restores existing behavior. It introduces no dependency, API, configuration or security-boundary change. Watcher scheduling, shutdown cancellation and unrelated platform behavior remain outside this repair.
The contributor's two local imports implement the repair. Behavior checks and independent reviews are required before release; exact commands and results are maintained in the review ledger.