You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
studio site create --no-start can fail in the Node-based CLI when Studio generates the default WordPress admin password.
The shared password helper currently imports generatePassword from @automattic/generate-password. That package calls window.crypto.getRandomValues(...), which is valid in browser-like runtimes but not in the Node CLI, where window is undefined.
Impact
A new site can reach the port-assignment step and then fail before saving the site:
✔ Port assigned: 9457
✖ Failed to create site: window is not defined
This also blocks reliable local Homeboy evidence runs for other Studio CLI/site-startup investigations because fresh site creation fails before the benchmark can proceed.
Root cause
Current trunk code path:
studio site create
→ apps/cli/commands/site/create.ts
→ createPassword()
→ tools/common/lib/passwords.ts
→ @automattic/generate-password
→ window.crypto.getRandomValues(...)
→ ReferenceError: window is not defined
The password is the default WordPress admin password generated when the caller does not provide one.
Homeboy evidence
Trunk failure
Studio SHA: ad48e06bc8cdbf3a35e9cbf9486d0dcde27c23d2
Summary
studio site create --no-startcan fail in the Node-based CLI when Studio generates the default WordPress admin password.The shared password helper currently imports
generatePasswordfrom@automattic/generate-password. That package callswindow.crypto.getRandomValues(...), which is valid in browser-like runtimes but not in the Node CLI, wherewindowis undefined.Impact
A new site can reach the port-assignment step and then fail before saving the site:
This also blocks reliable local Homeboy evidence runs for other Studio CLI/site-startup investigations because fresh site creation fails before the benchmark can proceed.
Root cause
Current trunk code path:
The password is the default WordPress admin password generated when the caller does not provide one.
Homeboy evidence
Trunk failure
ad48e06bc8cdbf3a35e9cbf9486d0dcde27c23d2dc2858ae-b983-4cfe-8a7c-ad4d88dbfd34/Users/chubes/.local/share/homeboy/artifacts/dc2858ae-b983-4cfe-8a7c-ad4d88dbfd34/cc43b89c-e68d-438e-b850-d69cb14a8b1f-trace.jsonhomeboy observe \ --path /var/folders/lr/c_cmmt7s0592m4njz99v5yb40000gn/T/opencode/studio-trunk-password-evidence \ --duration 1s \ --probe '{"type":"cmd.run","command":"node","args":["apps/cli/dist/cli/main.mjs","site","create","--name","Homeboy Password Evidence Trunk","--path","/var/folders/lr/c_cmmt7s0592m4njz99v5yb40000gn/T/opencode/studio-password-evidence-trunk-site","--no-start","--skip-browser","--skip-log-details"]}'Observed trace excerpt:
Candidate success
7290bb06ccd8a8325bb89c21854bd3b58a0786a0b398ab5b-0749-483b-a4e2-659b5c60a239/Users/chubes/.local/share/homeboy/artifacts/b398ab5b-0749-483b-a4e2-659b5c60a239/4fecf13b-3fed-4e23-b430-68a821bef220-trace.jsonObserved trace excerpt:
Expected behavior
The CLI should be able to generate a default WordPress admin password without requiring a browser
windowglobal.Notes
A runtime-neutral implementation can use
globalThis.crypto.getRandomValues(...), which is available in the Node CLI runtime and browser-like runtimes.Related