Repository navigation
Description
#11454 merged with its own Desktop Swift contract job red; BYOKPaywallTests/AgentRuntimeProcessTests have been broken on main since, undetected
TL;DR
PR #11454 ("feat: simplify BYOK LLM provider setup") merged to main as fb67ca9dc9 with its own required Desktop Swift Static & Test Contracts check showing fail, six minutes after that check finished. The failing suites — BYOKPaywallTests, AgentRuntimeProcessTests — are still failing on main today. Nobody has seen this because of #12275: the SILGen crash landed 8 minutes earlier by d49f978512 blocked every subsequent real compile, and once that crash cleared the path-filter masked four more pushes as green. main's desktop Swift tests have not genuinely passed or failed for real since eb4146bf3c (2026-08-26T14:42Z) until our rebase forced a real run just now. This is the second instance of the #11832 merged-on-red pattern.
This currently blocks every desktop-touching PR, including three unrelated telemetry fixes (#12267, #12269, #12271) that have nothing to do with BYOK.
The merge-on-red timeline
| when (UTC) | what |
|---|---|
| 2026-08-26T18:06–18:32 | PR #11454's own Desktop Swift Static & Test Contracts check runs for real and fails: run 32996234889, job 98266471810, 44m25s, conclusion fail. |
| 2026-08-26T18:22:55Z | PR #11454 merges to main as fb67ca9dc9 — six minutes after the failing check completed. |
Log evidence from that exact run (job 98266471810):
--- FAILED: AgentRuntimeProcessTests ---
Executed 70 tests, with 3 failures (0 unexpected)
--- FAILED: BYOKPaywallTests ---
Executed 12 tests, with 7 failures (0 unexpected)
FAILED Swift suites: AgentRuntimeProcessTests AgentSyncRecoveryTests BYOKPaywallTests
(AgentSyncRecoveryTests also failed in this specific run; it did not reproduce in the later confirmation below, so it may be independently flaky — flagging for completeness, not asserting it's related.)
Sample assertions, exactly reproduced below:
BYOKPaywallTests.swift:106: XCTAssertEqual failed: ("nil") is not equal to ("Optional("sk-test-deepgram")")
BYOKPaywallTests.swift:40: XCTAssertTrue failed
BYOKPaywallTests.swift:116: XCTAssertFalse failed - BYOK-active user must NOT be paywalled even with the flag set
AgentRuntimeProcessTests.swift:1236: XCTAssertEqual failed: ("nil") is not equal to ("Optional("sk-agent-openrouter")")
The nil-where-a-key-was-expected shape across both suites is consistent with #11454's stated change — replacing the four-key BYOK form with an LLM-provider picker and separate Deepgram key, and moving key storage/lookup through DefaultsKey.swift — landing without updating (or without correctly satisfying) the paywall/entitlement test expectations that read those keys back.
Why nobody caught this until now (cross-ref #12275)
main has had no real desktop Swift test execution since eb4146bf3c (2026-08-26T14:42:37Z, last confirmed real pass) — 12 commits before current HEAD:
| commit | touches desktop/** for real |
job result |
|---|---|---|
eb4146bf3c |
yes | success (last real pass) |
907e4bcb43 … af8a490afc (5 commits) |
no | skipped → vacuous green (#12275 mechanism) |
d49f978512 |
yes | failure — unrelated SILGen crash (signal 11), never reaches test execution |
fb67ca9dc9 (#11454) |
yes | PR's own pre-merge check: failure (this issue). Its main-push run also crashes at the same SILGen point before reaching tests, so main itself never re-confirmed it either. |
50cf0641e2 |
yes | failure — same SILGen crash, still never reaches tests |
d06e2205f7 … current HEAD (4 commits) |
no | skipped → vacuous green (#12275 mechanism) |
So: #11454 merged on a real red. The very next real-compile attempts (its own subsequent main pushes) never got far enough to re-confirm pass or fail, because an unrelated compiler crash landed 8 minutes before it. Once that crash is fixed, path-filter skips took back over. The BYOK test break has been silently sitting on main this entire time.
Confirmation after the SILGen crash was worked around
Three unrelated telemetry PRs (#12267, #12269, #12271) carry a mechanical workaround for the SILGen crash (tracked in #12275) and were rebased onto current main. The first one to get a real compile-through-to-tests run reproduced the identical failure:
- run 33032240032, job 98387289466 —
BYOKPaywallTestsandAgentRuntimeProcessTestsfail with the same assertions as feat: simplify BYOK LLM provider setup #11454's original run.
This confirms the break is on main, not specific to #11454's own branch state, and blocks any desktop PR that manages to get past the SILGen crash.
Impact
Every desktop-touching PR is currently blocked from a genuinely green Desktop Swift Static & Test Contracts, including #12267, #12269, #12271 (unrelated telemetry fixes). None of those PRs can merge until this is fixed on main — moving the BYOK fix onto their branches is out of scope and not something a telemetry change should carry.
What I have not done
- Not diagnosed whether the fix belongs in
BYOKPaywallTests/AgentRuntimeProcessTests(stale expectations against the new capability-scoped BYOK model) or in the implementation (DefaultsKey.swift,APIKeyService.swift,SettingsPage.swift,backend/utils/byok.py) — that's a call for whoever owns BYOK, and is being looked at separately. - Not touched any BYOK code, test, or the failing PR's branch.
- Not re-litigated main's Desktop Swift CI has read green since 08-26 18:24Z while the alertPresenter SILGen crash from d49f978512 sits unfixed #12275's masking-mechanism fix — this issue is about the specific regression it hid, not the mechanism itself.
Activity
Git-on-my-level commentedon Aug 27, 2026
Root-caused and fix filed: all 10 failing assertions are stale tests, zero implementation bugs.
#11454 changed
APIKeyService.isByokActivefrom "all five keys present inUserDefaults" to "selected provider's key present AND its SHA-256 fingerprint in the persisted enrollment map" (persistEnrolledFingerprints, written byactivateBYOKreconciliation afterBYOKValidatorsucceeds) — stated in #11454's own PR body and correctly asserted by its own new tests. 5BYOKPaywallTests+ 2AgentRuntimeProcessTestsnever learned about the new contract: they still set up rawUserDefaultskeys with no enrollment, soisByokActivecorrectly returnsfalseagainst them and every downstream assertion built on it fails.Verdict: safe to ship as a test-only fix — this transcribes an already-merged, already-tested decision into the tests that didn't get updated, it doesn't make a new one.
Fix: #12277 (test-only, no
Sources/change). Also flags — but does not fix — two other tests (testBuildHeadersCanExplicitlyExcludeByokKeys,testLowLevelTransportDefaultsToExcludingByokKeys) that currently pass vacuously against the same gap, for whoever owns BYOK to decide on separately.test(desktop): enroll BYOK fingerprints so paywall/agent tests match B…