Repository navigation
Conversation
get_test_job focused Unity whenever a running job had reported no progress for 3 s and Unity was not the frontmost app. Any test longer than 3 s meets that condition, so polling a PlayMode run pulled Unity to the front over and over: AppleScript activate on macOS (which also switches Spaces), held for 3-12 s, then back to the previous app. Typing in another app lost focus repeatedly. The nudge isn't needed: TestRunnerNoThrottle puts the editor in No Throttling for every test run, so a backgrounded editor keeps running. The App Nap case it was written for comes with a sleeping display, which a focus nudge can't fix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
vbucc
marked this pull request as draft
October 7, 2026 04:13
This was referenced Oct 7, 2026
Collaborator
Author
|
Superseded by #61: upstream v10.3.0 skips the focus nudge when the editor reports run_in_background. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
get_test_jobpulled Unity to the front whenever a running job had reported no progress for 3 s and Unity wasn't the frontmost app. On macOS it does that with an AppleScriptactivate, which also switches Spaces. Any test longer than 3 s meets the condition, so polling a PlayMode run stole focus from whatever app you were typing in, over and over: 3–12 s in front each time, repeating on a 1/2/4/8/10 s backoff.This removes it:
utils/focus_nudge.py,tests/test_focus_nudge.py, and both call sites inget_test_job, along with the helpers only they used.Why it isn't needed:
TestRunnerNoThrottleputs the editor in No Throttling for every test run, so a backgrounded editor keeps running at full speed. The App Nap case the nudge was written for comes with a sleeping display, which a focus nudge can't fix. Measured in p005unity on macOS: a full PlayMode run of 1,251 tests finished in 827 s, 0 failures, with the editor in the background throughout andget_test_jobcalled once mid-run.Tests:
cd Server && uv run --extra dev pytest tests/: 1519 passed, 3 skipped.Takes effect after merge and an MCP server restart with
uvx --refresh(the Server code changed).🤖 Generated with Claude Code