Repository navigation
Fix the copy refusal race; cut the suite wall 2x - #254
Conversation
|
|
||
| for (int attempt = 0; attempt < WriteReadRetryDelaysMs.Length; ++attempt) | ||
| { | ||
| SpinWait(WriteReadRetryDelaysMs[attempt]); |
There was a problem hiding this comment.
Do we really want to busy wait this long? It's the sum total of the entire window. Is there a better, more reliable mechanism? I don't want to spin-wait, ever.
|
DISCLOSURE: LLM-GENERATED TEXT Fair - the spin is gone. Also swept the codebase for the same class (blocking waits in product paths): this was the only site. The random-pick do/while loops and error-queue drains terminate deterministically and are not waits. |
Why can't we sleep for a fixed duration, wakeup at fixed intervals in between, and check every tick? Like sleep for 450ms with a 10ms wait or similar? Are you sure there are any non sleeping solutions? Like not blocking and checking in the background? |
|
DISCLOSURE: LLM-GENERATED TEXT Both points landed (5c9ef03):
Also fixed Bugbot's finding: the paste fixture's health check now verifies the paste's own payload through Verified on the degraded host: BuiltinCommandsTests 19/19, TerminalUIPasteTests 5/5, CommandPaletteTests 55/55, editor lane 619/619, |
3474624 to
f68617e
Compare
|
DISCLOSURE: LLM-GENERATED TEXT Follow-up landed (3474624): the full-leg rerun exposed one more instance of the same class on this host - under full-suite load the read-back can stay stale past the whole budget, so a raw clipboard-content assert in EditMode (CopyLogKeepsTheCommandsYouRanInTheTranscript) raced even though its class run passed. Every clipboard-content fixture in BuiltinCommandsTests now reads through |
|
DISCLOSURE: LLM-GENERATED TEXT The blocking is gone entirely (6cd3f97): What carries the degraded-host race instead: the fixtures gate on the product's own answer. Also fixed Bugbot's second finding: the verdict gate fed Verified on the degraded host: built-ins 14 pass/5 skip/0 fail, copy-cut 2/8/0, paste 14/29/0, PlayMode paste 4/1/0, palette 55/55, testhost 619/619, preflight 18/18 (the new linter included). |
6cd3f97 to
b37e9d1
Compare
|
DISCLOSURE: LLM-GENERATED TEXT Bugbot's hole finding fixed (b37e9d1): All 8 CI workflows green at b37e9d1; node suite 648/647 + 1 skip; testhost 619/619; preflight 18/18. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b37e9d1. Configure here.
|
DISCLOSURE: LLM-GENERATED TEXT Bugbot's two findings on b37e9d1 fixed (d5ab13c):
Contract tests 9/9; the linter's sweep over the real tree stays clean; all 8 CI workflows green at d5ab13c. The text-io-boundaries skill carries the overload-coverage rule. |

DISCLOSURE: LLM-GENERATED TEXT
Why:
The copy/cut fixtures failed in full runs while passing filtered: the first read-back of a clipboard write races the OS write on the pinned host, so landed copies were reported as refused (#250).
What:
TerminalClipboard.TryWritewrite-plus-one-read-back; state the degraded-host race and the never-block rule.lint:blocking-waits(rule 26): no sleep, spin, or blocking await under Runtime/ and Editor/.Open().tooling~/node_modulesin CI.How we know:
Full EditMode leg on the degraded host: every clipboard fixture green or named-skip, 0 failures; CommandPaletteTests 55/55; testhost 619/619 pins the write-verify logic.
Note
Medium Risk
Changes clipboard copy semantics and broad test/CI behavior; production impact is documented false refusals on slow clipboards rather than waits, plus new linter enforcement on Runtime/Editor threading patterns.
Overview
Addresses #250: clipboard write-then-read-back can falsely report refusal when the host lags, without adding blocking waits on Unity’s main thread.
Product & policy:
TerminalClipboard.TryWritestays synchronous; docs accept occasional false refusals on degraded hosts. Copy refusal text moves toBuiltInCommands.ClipboardRefusalMessageso tests gate on the full logged line. Newlint:blocking-waits(pre-commit, CI, rule 26) bansThread.Sleep, spin,Task.Wait/.Result, etc. underRuntime/andEditor/, with reason-carrying allow markers;TerminalThemePersisteruses one. LINQ (and the new linter) now scan interpolation holes as code so$"{task.Wait()}"cannot slip through.Tests: EditMode/PlayMode clipboard fixtures arrange via
TerminalClipboard.TryWrite, ignore when arrange/caret/clipboard cannot be held (#250), and palette clipboard keys get retry + key-routing/clipboard verdict helpers (aligned with terminal paste tests).CI & tooling: New
content-gates.ymlruns markdown lint + package validate on md/meta-only changes so the heavy tooling matrix does not run unnecessarily;tooling-tests.ymldrops those paths and addstooling~/node_modulescaching. Preflight splitseditor-compile(dotnet lane) vseditor-run(testhost). MCP bridge/idle waits accept injectable sleep and shorter health probes in tests. Unity package export contract tests use a fixture package so the real tree exports once per suite.Reviewed by Cursor Bugbot for commit d5ab13c. Bugbot is set up for automated code reviews on this repo. Configure here.