Skip to content

test(desktop): guard the chat streaming render test to debug builds - #13123

Open
aryanorastar wants to merge 1 commit into
BasedHardware:mainfrom
aryanorastar:fix/chat-streaming-probe-release-guard
Open

test(desktop): guard the chat streaming render test to debug builds#13123
aryanorastar wants to merge 1 commit into
BasedHardware:mainfrom
aryanorastar:fix/chat-streaming-probe-release-guard

Conversation

@aryanorastar

@aryanorastar aryanorastar commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

What changed

ChatStreamingRenderBudgetTests.swift is now #if DEBUG-guarded, matching the probe it measures.

Why

#13053 added ChatStreamingRenderProbe.swift entirely inside #if DEBUG — its own doc comment says so:

Compiled out of release builds: every call site is #if DEBUG, so a shipped bundle allocates nothing and does no extra work per flush.

The test landed in the same commit without that guard, and references the type ten times. In a release build the type does not exist, so the file cannot compile:

ChatStreamingRenderBudgetTests.swift:254: error: cannot find type 'ChatStreamingRenderProbe' in scope
error: fatalError

Why nobody has seen it

Two filters hide it. Desktop Swift CI is path-gated and its lanes are skipped on main's push runs — a current main run shows Desktop Swift Release Compile :: skipped. And the step that compiles tests in release, Test UserNotifications callback regression in release mode, is gated on should_notification_release_regression, so it only runs on a PR touching notification paths.

So main stays green while the release lane is broken for every PR that selects that step. It first fired on #11864, whose only change was to notification files.

Verification

  • swift build -c release --build-tests on this branch: zero errors mentioning ChatStreamingRenderProbe or ChatStreamingRenderBudgetTests, where CI reported nine on the unguarded file. (My local invocation stops later on an unrelated @testable import OmiWAL / ModuleNotTestable limitation that CI's own harness does not hit.)
  • Pinned swift-format lint --strict: clean.
  • git diff -w is four added lines — the guard, #endif, and a two-line comment. Everything else in the diff is the re-indent that indentConditionalCompilationBlocks: true requires, the same shape ChatStreamingRenderProbe.swift already uses.

Scope

Test-only, debug-only. No production code, no behavior change in any configuration: the file was already absent from release builds in every sense except that it failed to compile.

Failure-Class: none

Review in cubic

ChatStreamingRenderProbe is defined entirely inside `#if DEBUG` — its own
doc comment states it is compiled out of release builds — but the test added
alongside it references the type ten times without that guard, so a release
build cannot compile the file:

  ChatStreamingRenderBudgetTests.swift:254: error: cannot find type
  'ChatStreamingRenderProbe' in scope

Main does not catch this: the Desktop Swift lanes are skipped on push runs,
and the step that compiles tests in release mode is gated on
should_notification_release_regression, so only a PR touching notification
paths reaches it. The lane is therefore broken for those PRs while main
stays green.

The guard mirrors the probe's own file-level `#if DEBUG`; the large line
count is the re-indent that indentConditionalCompilationBlocks requires,
and `git diff -w` is four added lines.

Failure-Class: none

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@Git-on-my-level

Copy link
Copy Markdown
Collaborator

Verified the diagnosis end to end — this fixes a real, latent release-lane break.

  • ChatStreamingRenderProbe.swift on main is indeed entirely inside #if DEBUG (its own doc comment: "Compiled out of release builds"), and the unguarded test referenced the type throughout, so any release-mode build of the test module could not compile.
  • The gating story is accurate: run-swift-ci.sh --release-notification-regression runs swift test -c release --filter UserNotificationCallbackBridgeTests/, which still builds the whole test module, and pre_push_ci_prediction.py selects that lane for paths containing "Notification" — so the break only surfaced on notification-path PRs. Confirmed feat(desktop): withhold proactive notifications while other people are present #11864's head did fail "Desktop Swift Release Compile" exactly as described.
  • The diff itself is minimal: I reconstructed both sides and the change is exactly the two-line comment, #if DEBUG, and #endif — everything else is the re-indent that Desktop/.swift-format (indentConditionalCompilationBlocks: true) requires, the same shape the probe file already uses.
  • No compile-time references to the test class elsewhere (the mention in e2e/flows/chat-first-cohesive.yaml is a comment), so nothing else needs the same guard.

Debug test runs are unaffected — the guard is active there, so the budget test still runs in the normal lane. One possible follow-up for maintainers (not a request): the release test-module compile is only exercised on notification-path PRs today, so this class of break can recur silently; a broader release-mode --build-tests smoke could catch it. Thanks for the excellent root-cause write-up.

Automated maintainer review on behalf of the Omi maintainers — leaving formal approval and merge to a human maintainer.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@Git-on-my-level Git-on-my-level added positive-signal Automation verified a genuine fix/quality contribution macOS labels Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

macOS positive-signal Automation verified a genuine fix/quality contribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants