Repository navigation
perf: uloop launch presses Ignore on the Safe Mode prompt sooner - #3634
Conversation
The launch wait looked for a dialog first after five seconds and then at most once per ten seconds, so Unity's Safe Mode prompt could stay up for about ten seconds before launch pressed Ignore. A launch with compile errors meets the prompt every time, so its wait now looks one second in and then two seconds after each look ends. - Readiness waits take a DialogLookSchedule; the project runner's reload wait and the V2 launch keep the five/ten-second default. - The gap is counted from the end of a look instead of its start: a look runs between probes and takes one to two seconds on macOS, so a start-based two-second gap would run looks back to back and delay noticing that the Editor became ready.
uloop launch found the prompt with one look and pressed Ignore with a second osascript call, which reads the dialog again and takes about as long as the look (1.3 s each, measured on macOS). The new Inspector.InspectAndAnswer reads every modal dialog and, in the same call, presses the answer's label when the frontmost dialog has the answer's title and exactly its buttons; Windows presses from the one listing it returns. - The exact-button check moves into the script, since Go no longer sees the dialog between reading and pressing; Go still checks the script's verdict against the dialogs it read and refuses a contradictory result. - A failed look does not count as launch's one press: it read nothing, so a slow look while Unity starts must not turn the press off. - PressInDialogTitled lost its only caller and is removed, together with the title argument it added to the press script.
The launch skill said launch stops at a blocking dialog after about five seconds; the V3 launch wait now looks one second in and every two seconds after that.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
No test failed when the V3 launch waited on the default five and ten second schedule instead of its own one and two: every launch test replaces the readiness wait, and the schedule was chosen inside the wrapper they replace. The launch now hands the schedule to the wait, so a test can see which one it asked for, and the wrapper is gone.
Summary
uloop launchpresses Ignore on Unity's "Enter Safe Mode?" prompt within a few seconds of the prompt appearing, instead of leaving it up for up to about ten seconds.User Impact
Changes
Inspector.InspectAndAnswerreads every modal dialog and, in the same osascript call (one window listing on Windows), presses the answer's label only when the frontmost dialog has the answer's title and exactly its buttons in order. Go checks the script's verdict against the dialogs it read and refuses a contradictory result.PressInDialogTitledlost its only caller and is removed with the title argument it added to the press script.Trade-off
Verification
scripts/check-go-cli.shwithGOFLAGS=-count=1(format, vet, golangci-lint v2.15.0, all Go tests, dist check)go run ./cmd/check-skill-sizeandgo run ./cmd/sync-tool-docs --checkuloop launchon a project with a compile error:SafeModePromptIgnored: true, the prompt found and pressed in one callcommonmeasures 93.1% on macOS both on this branch and onmain, so the gap to the Linux baseline is not from this change