Repository navigation
Conversation
`Desktop Swift Static & Test Contracts` has been red on every desktop PR since 15a51fb — 77 assertion failures — so no desktop change could reach main. main reads green only because the lane is path-filtered: it skips the test job on every commit that does not touch desktop/macos/**. 75 of the 77 are one cause. `InkGlassHitRegionReporter` mounts a zero-drawing AppKit marker so a transparent window can tell visible content from air. `ImageRenderer` cannot rasterise an `NSViewRepresentable` and substitutes an opaque placeholder for it, so every pixel-truth test of a surface that mounts one measured the placeholder covering the marker's whole host: the modal dim read as painting to the window's edge — which on this window is the user's wallpaper — and the glass panel's rounded corner read as filled. Mount the marker at zero opacity. The placeholder then contributes no pixels, while the AppKit view stays mounted, unhidden and registered: SwiftUI applies opacity to the host layer, not to the view's own `alphaValue`, which is what `InkGlassHitRegions.containsPoint` reads. Both halves are pinned by `InkGlassHitRegionReporterTests`, because dropping the reporter would satisfy the paint half and silently return the shell to passing clicks through its own modals. The remaining 2, in `testLaterShorterRetryWindowDoesNotShortenActiveCooldown` (ff97490), were never reachable: the test issued its two 429s sequentially, but an armed cooldown short-circuits the network before the second request is built, so the shorter `Retry-After` was never parsed and the request count could not reach the 2 it asserted. The two attempts now overlap on a rendezvous — the only way a second window is ever observed — so the max-deadline preservation it is named for is actually exercised. Verification: `swift test` — the 5 affected suites go 77 failures -> 26/26 passing, and `ShellClickThroughPolicyTests` plus the new registration test confirm a surface mounting the marker still owns the pointer. Failure-Class: none
…nner's defaults The fourth failure in the red lane, and the last one: `testRewindCitationFocusIsOneShotAndPreservesExactScreenshotID` has failed on every CI run since #11519 landed while passing locally. `RewindCaptureOwnerSnapshot` resolves an owner id two different ways. `capture()` prefers the authorization snapshot's owner, which comes from the persistent `auth_userId` default; `isCurrent()` compares against `RewindDatabase.currentUserId ?? "anonymous"`, which is in-memory and starts nil in a fresh process. `swift-test-suites.sh` runs each suite in its own process, but UserDefaults is on disk and outlives all of them, so on a runner where an earlier suite left `auth_userId` set the focus request captured owner "X" and `consume()` compared it against "anonymous" and refused — one-shot handoff lost, on an assertion that has nothing to say about owner plumbing. Reproduced exactly, locally: setting `auth_userId` before the same test turns it red with CI's message ("nil" is not equal to "Optional(42)"). Pinning `RewindDatabase.currentUserId` to `currentOwnerId()` for the duration turns it green with that default still set — 18/18 — and green again with it cleared. The divergence between the two owner sources is a real product defect (any snapshot captured before `currentUserId` is resolved at launch can never validate), but narrowing a fail-closed ownership fence is not a change to make alongside a CI unblock; filed separately. Verification: `swift test --filter` on all four suites the lane reports — ChatCitationTests 18/18, ShellModalScrimTests 7/7, GlassSurfaceReviewRegressionTests 3/3, ProactiveLaneClientTests 11/11, InkGlassHitRegionReporterTests 2/2. 77 failures -> 0. Failure-Class: none
There was a problem hiding this comment.
1 issue found across 4 files
Confidence score: 5/5
- In
desktop/macos/Desktop/Tests/InkGlassHitRegionReporterTests.swift(testTheReporterPaintsNothing), the early return whenrenderer.cgImageis nil can let the test pass without assertions, which risks masking regressions in hit-region rendering on macOS—replace the early return with a failing assertion (or otherwise guarantee rasterization) so the test verifies behavior consistently.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="desktop/macos/Desktop/Tests/InkGlassHitRegionReporterTests.swift">
<violation number="1" location="desktop/macos/Desktop/Tests/InkGlassHitRegionReporterTests.swift:30">
P3: In `testTheReporterPaintsNothing`, when `renderer.cgImage` is nil the test returns early and passes without asserting anything. If `ImageRenderer` fails to rasterize the content (which on macOS can happen for `NSViewRepresentable` content), the whole point of this test — proving the marker contributes no pixels — never runs, and a regression that repaints the marker would ship undetected. Use `XCTFail` (and bail out of the rest of the test) instead of silently returning.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| .frame(width: size.width, height: size.height)) | ||
| renderer.scale = 1 | ||
|
|
||
| guard let image = renderer.cgImage else { return } |
There was a problem hiding this comment.
P3: In testTheReporterPaintsNothing, when renderer.cgImage is nil the test returns early and passes without asserting anything. If ImageRenderer fails to rasterize the content (which on macOS can happen for NSViewRepresentable content), the whole point of this test — proving the marker contributes no pixels — never runs, and a regression that repaints the marker would ship undetected. Use XCTFail (and bail out of the rest of the test) instead of silently returning.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At desktop/macos/Desktop/Tests/InkGlassHitRegionReporterTests.swift, line 30:
<comment>In `testTheReporterPaintsNothing`, when `renderer.cgImage` is nil the test returns early and passes without asserting anything. If `ImageRenderer` fails to rasterize the content (which on macOS can happen for `NSViewRepresentable` content), the whole point of this test — proving the marker contributes no pixels — never runs, and a regression that repaints the marker would ship undetected. Use `XCTFail` (and bail out of the rest of the test) instead of silently returning.</comment>
<file context>
@@ -0,0 +1,73 @@
+ .frame(width: size.width, height: size.height))
+ renderer.scale = 1
+
+ guard let image = renderer.cgImage else { return }
+ let width = image.width
+ let height = image.height
</file context>
| guard let image = renderer.cgImage else { return } | |
| guard let image = renderer.cgImage else { | |
| return XCTFail("ImageRenderer produced no image; paints-nothing assertion never ran") | |
| } |
|
Closing without merging — CI cannot go green for reasons that have nothing to do with this diff, and an open PR nobody will merge is worse than a closed one with the evidence written down. The branch What this PR proved. All four assertion suites go to zero, confirmed by CI run 31809160446: Why it is still red. Three suites crash with Reopen this the moment #11573 lands — the diff is rebased, the manifest checks pass, and the four suites are proven. |
|
Hey @kodjima33 👋 Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request. After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:
Before your next PR, please skim:
If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing. Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out. Thank you for being part of the Omi community! |
Bug
Desktop Swift Static & Test Contractshas been red on every desktop PR since15a51fb985(2026-08-14 02:10 EDT), so no desktop change could reachmainand the release train had no qualification signal.mainreads green only because the lane is path-filtered:Detect Desktop Swift Changesskips the test job on every commit that does not touchdesktop/macos/**, so the red only appears on desktop PRs. Filed as #11563.ShellModalScrimTestsGlassSurfaceReviewRegressionTestsProactiveLaneClientTestsChatCitationTestsRoot causes
1. 75 of the 77 — the hit-region marker paints.
InkGlassHitRegionReportermounts a zero-drawing AppKit marker so a transparent window can tell visible content from air.ImageRenderercannot rasterise anNSViewRepresentableand substitutes an opaque placeholder for it, so every pixel-truth test of a surface that mounts one measured the placeholder covering the marker's whole host: the modal dim read as painting to the window's edge — which on this window is the user's wallpaper — and the glass panel's rounded corner read as filled. Measured directly:Color.clear.background(InkGlassHitRegionReporter())rendered at 40×40 came back fully opaque (centre RGBA255,56,60,255), whereColor.clearalone is0,0,0,0.Fix: mount the marker at zero opacity. The placeholder contributes no pixels while the AppKit view stays mounted, unhidden and registered — SwiftUI applies opacity to the host layer, not to the view's own
alphaValue, which is whatInkGlassHitRegions.containsPointreads.InkGlassHitRegionReporterTestspins both halves, because simply dropping the reporter would satisfy the paint half and silently return the shell to passing clicks through its own modals.2. The 2 in
ProactiveLaneClientTests.testLaterShorterRetryWindowDoesNotShortenActiveCooldown(ff974901b6) asserted a request count an armed cooldown makes unreachable: the two 429s were issued sequentially, but the cooldown short-circuits the network before the second request is built, so the shorterRetry-Afterwas never parsed. The two attempts now overlap on a rendezvous — the only way a second window is ever observed — so the max-deadline preservation the test is named for is actually exercised.3. The 1 in
ChatCitationTests— a fourth failure #11563 did not record.testRewindCitationFocusIsOneShotAndPreservesExactScreenshotIDhas failed on every CI run of this lane since #11519 landed, and passes locally.RewindCaptureOwnerSnapshotresolves an owner id two different ways:capture()prefers the authorization snapshot's owner (from the persistentauth_userIddefault), whileisCurrent()compares againstRewindDatabase.currentUserId ?? "anonymous", which is in-memory and starts nil in a fresh process.swift-test-suites.shruns each suite in its own process, but UserDefaults is on disk and outlives all of them — so on a runner where an earlier suite leftauth_userIdset, the focus request captured owner"X"andconsume()compared it against"anonymous"and refused.Fix: pin the two owner sources together for the duration of the test. The assertion is about the one-shot handoff contract, not owner plumbing.
What I tested
auth_userIdin the test process before the unmodified test turns it red with CI's exact message —XCTAssertEqual failed: ("nil") is not equal to ("Optional(42)"). With the fix and that default still set: 18/18 green. With it cleared: 18/18 green.xcrun swift test --filteron all four suites the lane reports, 77 failures → 0:ChatCitationTests18/18ShellModalScrimTests7/7GlassSurfaceReviewRegressionTests3/3ProactiveLaneClientTests11/11InkGlassHitRegionReporterTests2/2 (new)scripts/pre-pushbounded gate passed.Follow-up, deliberately not in this PR
The divergence between the two owner sources in
RewindCaptureOwnerSnapshotis a real product defect — any snapshot captured beforeRewindDatabase.currentUserIdis resolved at launch can never validate, so frames and citation handoffs are silently dropped in that window. Narrowing a fail-closed ownership fence is not a change to make alongside a CI unblock; filed as #11572.🤖 automated by hourly watchdog — tested and merged
Failure-Class: none