Skip to content

Clear the three Swift warning buckets over the CI budget on main - #10905

Merged
austinywang merged 1 commit into
mainfrom
fix/main-warning-budget
Aug 27, 2026
Merged

austinywang merged 1 commit into
mainfrom
fix/main-warning-budget

Conversation

@austinywang

@austinywang austinywang commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

tests-build-and-lag on main fails its warning-budget gate with three buckets over budget:

  • Sources/Mobile/MobileHostIrxRuntime.swift ×2 — enabledDefaultsKey/forceRelayDefaultsKey are main-actor-isolated statics read from the nonisolated activation gate (inherited from irx: from-scratch iroh transport for cmux mobile (dev-gated), 15-min relay-only soak PASS #10782). Marked nonisolated (they are string constants).
  • Sources/Surfaces/SurfaceSocketCommands.swift ×2 — worker-lane handlers read SurfaceCatalog.shared synchronously; now awaited like the surrounding calls.

No behavior change. Verified with swiftc -parse; the gate is python3 scripts/swift_warning_budget.py on the CI build log.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Summary by cubic

Clears the three Swift warnings pushing the tests-build-and-lag CI job over its warning-budget gate on main. No behavior change.

  • Marks the two UserDefaults key constants in Sources/Mobile/MobileHostIrxRuntime.swift as nonisolated so the nonisolated activation gate can read them without a main-actor warning.
  • Awaits SurfaceCatalog.shared in Sources/Surfaces/SurfaceSocketCommands.swift instead of touching the main-actor property synchronously.

Written for commit 9f1d87e. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Bug Fixes
    • Improved compatibility with Swift concurrency when accessing runtime configuration settings.
    • Ensured terminal and socket operations correctly wait for shared surface data to become available.

- MobileHostIrxRuntime: the UserDefaults key constants are nonisolated (read from the
  nonisolated activation gate).
- SurfaceSocketCommands: the worker-lane vm.port_open / surface.new_terminal paths await
  SurfaceCatalog.shared instead of touching the main-actor property synchronously.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@cursor

cursor Bot commented Aug 27, 2026

Copy link
Copy Markdown

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@coderabbitai

coderabbitai Bot commented Aug 27, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 69570316-68cc-407e-9754-b2bbc06341f4

📥 Commits

Reviewing files that changed from the base of the PR and between f7f61ef and 9f1d87e.

📒 Files selected for processing (2)
  • Sources/Mobile/MobileHostIrxRuntime.swift
  • Sources/Surfaces/SurfaceSocketCommands.swift

Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The change updates Swift concurrency access in the mobile runtime and surface socket commands. Runtime preference keys are nonisolated. Two surface catalog lookups now use asynchronous access.

Changes

Swift concurrency access updates

Layer / File(s) Summary
Nonisolated runtime keys
Sources/Mobile/MobileHostIrxRuntime.swift
enabledDefaultsKey and forceRelayDefaultsKey are marked as nonisolated static let.
Asynchronous surface catalog access
Sources/Surfaces/SurfaceSocketCommands.swift
socketWorkerVMPortOpenResponse and surfaceNewTerminal now await SurfaceCatalog.shared.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Merge Risk: ⚪ Minimal · up to 9f1d8

This PR makes localized Swift concurrency-warning fixes to clear the CI warning budget without changing intended behavior; no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 25
✅ Passed checks (25 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly states what changed, why it changed, and how it was verified. The Demo Video section is not required because the PR reports no behavior change. The review trigger and checklist…
Title check ✅ Passed The title clearly identifies the primary change: clearing three Swift warning buckets that exceed the CI warning budget on main.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Cmux Swift Actor Isolation ✅ Passed PASS. The diff fixes actor-isolation diagnostics and does not introduce a listed mistake. MobileHostIrxRuntime remains @MainActor, while its two immutable String keys are now explicitly `nonisol…
Cmux Swift Blocking Runtime ✅ Passed The diff adds no semaphore, blocking wait, sleep, delayed dispatch, polling, main-queue sync, or manual lock. It only marks two string constants nonisolated and changes two existing `SurfaceCatalog.…
Cmux Browser Automation Off-Main ✅ Passed PASS: The pull request does not change browser.* socket automation routing. The diff changes only two UserDefaults string constants and adds await when obtaining the @MainActor SurfaceCatalog in vm.po…
Cmux Expensive Synchronous Load ✅ Passed PASS. The commit changes only four declarations/usages: two string constants become nonisolated, and two SurfaceCatalog.shared accesses change to await. SurfaceCatalog is an in-memory `@MainAc…
Cmux Cache Substitution Correctness ✅ Passed PASS — The diff does not substitute a cached value for a fresh authoritative read. It only marks two string constants nonisolated and changes two accesses to the existing @MainActor `SurfaceCatalo…
Cmux No Hacky Sleeps ✅ Passed PASS. The pull request changes only two Swift files. The exact diff changes actor isolation declarations and adds await to SurfaceCatalog.shared; it introduces no TypeScript, JavaScript, shell, or…
Cmux Algorithmic Complexity ✅ Passed PASS — The pull request changes only two isolation annotations and two SurfaceCatalog.shared accesses. The diff introduces no loops, collection scans, sorting, filtering, joins, or slower algorithms…
Cmux Swift Concurrency ✅ Passed PASS. The diff changes only two string constants to nonisolated and adds await when obtaining the @MainActor-isolated SurfaceCatalog.shared. The added lines introduce no background Dispatch …
Cmux Swift @Concurrent ✅ Passed PASS. The diff only makes two synchronous string constants nonisolated, which the rule explicitly allows. The two other edits add await when worker-lane code obtains the @MainActor `SurfaceCatal…
Cmux Swift Package Boundaries ✅ Passed PASS. The diff changes only actor-isolation annotations on two string constants and adds await before two existing SurfaceCatalog.shared accesses. It introduces no feature, provider, protocol, par…
Cmux Swiftpm Lockfiles ✅ Passed PASS: The pull-request diff changes only Sources/Mobile/MobileHostIrxRuntime.swift and Sources/Surfaces/SurfaceSocketCommands.swift. It changes actor isolation and SurfaceCatalog.shared access o…
Cmux Swift Logging ✅ Passed PASS. The commit changes only two static let declarations to nonisolated static let and adds await to two SurfaceCatalog.shared accesses. The zero-context diff contains no added or materially …
Cmux User-Facing Error Privacy ✅ Passed The PR changes only Swift isolation access. It marks two existing string-key constants as nonisolated and awaits the existing SurfaceCatalog.shared accesses. The committed diff adds or changes no …
Cmux Full Internationalization ✅ Passed PASS: The diff changes only Swift isolation/concurrency syntax. It adds nonisolated to two existing UserDefaults key constants and adds await to two existing SurfaceCatalog.shared accesses. It i…
Cmux Swiftui State Layout ✅ Passed PASS: The diff changes only two static let constants to nonisolated static let and changes two SurfaceCatalog.shared reads to await. The changed files contain no SwiftUI view changes, new `Obs…
Cmux Architecture Rethink ✅ Passed PASS. The diff changes only two string constants to nonisolated and adds await when obtaining the existing @MainActor SurfaceCatalog.shared. It introduces no sleep, delayed dispatch, polling, …
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed The pull request changes only actor-isolation annotations and asynchronous access to SurfaceCatalog.shared. It does not add or materially change any NSWindow, NSPanel, NSWindowController, Swif…
Cmux Source Artifacts ✅ Passed PASS. The commit changes only Sources/Mobile/MobileHostIrxRuntime.swift and Sources/Surfaces/SurfaceSocketCommands.swift. Both are intentional hand-written Swift source files. The diff adds no log…
Cmux No Test Or Debug Seam In Production Source ✅ Passed PASS: The PR changes only two constant declarations from static let to nonisolated static let and adds await before two existing SurfaceCatalog.shared accesses. Neither change adds a test/debu…
Cmux No Ambient Global State ✅ Passed The diff introduces no ambient global state. It only changes two existing string constants to nonisolated static let, which the rule explicitly permits. The two SurfaceCatalog.shared changes only …
Full details: Description check

Explanation

The description clearly states what changed, why it changed, and how it was verified. The Demo Video section is not required because the PR reports no behavior change. The review trigger and checklist are not included, but these omissions are non-critical.

Full details: Cmux Swift Actor Isolation

Explanation

PASS. The diff fixes actor-isolation diagnostics and does not introduce a listed mistake. MobileHostIrxRuntime remains @MainActor, while its two immutable String keys are now explicitly nonisolated, matching the rule's preferred shape for value-only utilities. SurfaceCatalog remains an explicitly @MainActor observable reference type. The two changed worker paths now use await SurfaceCatalog.shared before accessing the catalog, which establishes the required main-actor boundary from the nonisolated socket worker. The parent-versus-HEAD diff contains no other isolation changes.

Full details: Cmux Swift Blocking Runtime

Explanation

The diff adds no semaphore, blocking wait, sleep, delayed dispatch, polling, main-queue sync, or manual lock. It only marks two string constants nonisolated and changes two existing SurfaceCatalog.shared accesses to await. SurfaceCatalog is @MainActor, so these are actor hops, not blocking synchronization. Existing Task.sleep and polling code in MobileHostIrxRuntime.swift is unchanged from HEAD~1.

Full details: Cmux Browser Automation Off-Main

Explanation

PASS: The pull request does not change browser.* socket automation routing. The diff changes only two UserDefaults string constants and adds await when obtaining the @MainActor SurfaceCatalog in vm.port_open and surfaceNewTerminal. It adds no WebKit/AppKit calls, browser callbacks, browser state mutations, worker-router changes, or policy changes. Existing browser commands remain in the socket-worker router, and ControlCommandExecutionPolicyTests already assert worker classification for browser automation methods. Existing debt is not worsened.

Full details: Cmux Expensive Synchronous Load

Explanation

PASS. The commit changes only four declarations/usages: two string constants become nonisolated, and two SurfaceCatalog.shared accesses change to await. SurfaceCatalog is an in-memory @MainActor type with an empty initializer. The diff adds no RestorableAgentSessionIndex.load(), agent-store or transcript read, JSON/JSONL parsing, directory scan, or per-record syscall. Therefore it does not introduce or move an expensive synchronous agent-history load onto a socket handler or the main actor.

Full details: Cmux Cache Substitution Correctness

Explanation

PASS — The diff does not substitute a cached value for a fresh authoritative read. It only marks two string constants nonisolated and changes two accesses to the existing @MainActor SurfaceCatalog.shared singleton to use await. The changed handlers perform terminal or surface projection operations, not persistence, history, undo, or snapshot storage. No cold-cache or stale-cache failure condition is introduced.

Full details: Cmux No Hacky Sleeps

Explanation

PASS. The pull request changes only two Swift files. The exact diff changes actor isolation declarations and adds await to SurfaceCatalog.shared; it introduces no TypeScript, JavaScript, shell, or build/runtime-script delay. Existing Task.sleep calls in MobileHostIrxRuntime.swift are unchanged, and Swift timing is explicitly out of scope for this check.

Full details: Cmux Algorithmic Complexity

Explanation

PASS — The pull request changes only two isolation annotations and two SurfaceCatalog.shared accesses. The diff introduces no loops, collection scans, sorting, filtering, joins, or slower algorithms. Existing scans in SurfaceSocketCommands.swift and SurfaceCatalog.swift are unchanged. The changed socket paths still perform direct dictionary lookups and catalog operations.

Full details: Cmux Swift Concurrency

Explanation

PASS. The diff changes only two string constants to nonisolated and adds await when obtaining the @MainActor-isolated SurfaceCatalog.shared. The added lines introduce no background Dispatch APIs, Combine state, completion-handler APIs, or fire-and-forget Task work. Existing Task usages in MobileHostIrxRuntime.swift are unchanged.

Full details: Cmux Swift `@Concurrent`

Explanation

PASS. The diff only makes two synchronous string constants nonisolated, which the rule explicitly allows. The two other edits add await when worker-lane code obtains the @MainActor SurfaceCatalog.shared; they do not add or change an async function's isolation or execution cost. surfaceNewTerminal remains an existing nonisolated async helper, and its catalog/provider operations are explicit actor-bound coordination. No invalid or missing @concurrent condition is introduced by this diff.

Full details: Cmux Swift Package Boundaries

Explanation

PASS. The diff changes only actor-isolation annotations on two string constants and adds await before two existing SurfaceCatalog.shared accesses. It introduces no feature, provider, protocol, parsing, persistence, or reusable domain logic in the app target, and it does not materially expand either implementation. The changed files remain app integration and socket-handler glue.

Full details: Cmux Swiftpm Lockfiles

Explanation

PASS: The pull-request diff changes only Sources/Mobile/MobileHostIrxRuntime.swift and Sources/Surfaces/SurfaceSocketCommands.swift. It changes actor isolation and SurfaceCatalog.shared access only. No Package.swift, Package.resolved, .gitignore, workflow, or Xcode project package-reference file changed, so the SwiftPM lockfile conditions do not apply.

Full details: Cmux Swift Logging

Explanation

PASS. The commit changes only two static let declarations to nonisolated static let and adds await to two SurfaceCatalog.shared accesses. The zero-context diff contains no added or materially changed print, debugPrint, dump, NSLog, file logging, or Logger statements. Existing IrxJournal calls remain unchanged.

Full details: Cmux User-Facing Error Privacy

Explanation

The PR changes only Swift isolation access. It marks two existing string-key constants as nonisolated and awaits the existing SurfaceCatalog.shared accesses. The committed diff adds or changes no user-facing errors, alerts, command output, API error bodies, recovery copy, or diagnostic payloads. Existing environment-variable references and generic error messages are outside the changed lines.

Full details: Cmux Full Internationalization

Explanation

PASS: The diff changes only Swift isolation/concurrency syntax. It adds nonisolated to two existing UserDefaults key constants and adds await to two existing SurfaceCatalog.shared accesses. It introduces or changes no user-facing text, localization key, catalog entry, web message, metadata, API copy, or rendered content. The existing literal keys and socket error messages remain unchanged.

Full details: Cmux Swiftui State Layout

Explanation

PASS: The diff changes only two static let constants to nonisolated static let and changes two SurfaceCatalog.shared reads to await. The changed files contain no SwiftUI view changes, new ObservableObject/@Published state, geometry measurement, lazy/list row store references, or render-time state mutation. Existing Task uses in MobileHostIrxRuntime.swift are outside the changed lines and are incidental legacy code.

Full details: Cmux Architecture Rethink

Explanation

PASS. The diff changes only two string constants to nonisolated and adds await when obtaining the existing @MainActor SurfaceCatalog.shared. It introduces no sleep, delayed dispatch, polling, lock, observer, side channel, duplicate entrypoint, or UI lifecycle owner. SurfaceCatalog remains the documented single owner of surface identities and projections. These are small local Swift isolation corrections, which the rule allows.

Full details: Cmux Swift Auxiliary Window Close Shortcuts

Explanation

The pull request changes only actor-isolation annotations and asynchronous access to SurfaceCatalog.shared. It does not add or materially change any NSWindow, NSPanel, NSWindowController, SwiftUI Window, or WindowGroup code. The auxiliary-window close-shortcut check is therefore not applicable.

Full details: Cmux Source Artifacts

Explanation

PASS. The commit changes only Sources/Mobile/MobileHostIrxRuntime.swift and Sources/Surfaces/SurfaceSocketCommands.swift. Both are intentional hand-written Swift source files. The diff adds no logs, images, recordings, caches, temporary directories, build output, dependency checkouts, or broad artifact directories.

Full details: Cmux No Test Or Debug Seam In Production Source

Explanation

PASS: The PR changes only two constant declarations from static let to nonisolated static let and adds await before two existing SurfaceCatalog.shared accesses. Neither change adds a test/debug member, accessor, visibility-widening wrapper, or test-build guard. The existing #if DEBUG blocks in MobileHostIrxRuntime.swift gate the real developer-only IRX activation behavior and are unchanged by the diff.

Full details: Cmux No Ambient Global State

Explanation

The diff introduces no ambient global state. It only changes two existing string constants to nonisolated static let, which the rule explicitly permits. The two SurfaceCatalog.shared changes only add await; the singleton already existed and was touched incidentally. No new free function, mutable global, static-only namespace, or singleton appears in the diff.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/main-warning-budget

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@austinywang

Copy link
Copy Markdown
Contributor Author

Status: the warning-budget step passes on this branch. The job then fails at Run display UI regressions (DisplayResolutionRegressionUITests.testRapidDisplayResolutionChangesKeepTerminalResponsive: 0 terminal presents during display churn, both attempts). That is a pre-existing main regression from #10815, not this PR: a baseline dispatch on the pre-#10887 commit plus only these budget fixes (run 33034886551, job 98396168329) fails the identical step with the identical assertion ("0" < "6"); the step last passed on main on 2026-08-19, before #10815. A separate fix PR is being prepared (fix/renderer-occlusion-headless-window). This PR is safe to merge on its own.

austinywang added a commit that referenced this pull request Aug 27, 2026
…atics/captured self, surfaces socket shared access)

Same fixes as #10905, carried here so the warning-budget gate lets the display step run.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@austinywang
austinywang merged commit 5cacd70 into main Aug 27, 2026
31 of 45 checks passed
austinywang added a commit that referenced this pull request Aug 27, 2026
…occlusion .visible bit (fixes the display-liveness CI regression from #10815) (#10922)

* Present terminal renderers in on-screen windows that never report an occlusion .visible bit

#10815 gates renderer presentation on NSWindow.occlusionState.contains(.visible). On the
CI display-churn harness the app runs on a CGVirtualDisplay where AppKit never raises that
bit for a window that is ordered in and drawing, so the renderer was never presented and
DisplayResolutionRegressionUITests counted 0 terminal presents (the step last passed before
#10815 landed). One rule now decides window visibility (TerminalRendererWindowVisibility):
the occlusion bit or key window wins; until a window has reported .visible at least once
its ordinary on-screen state (visible, not miniaturized, on the active Space) is trusted.
Once the bit has been seen the occlusion verdict is honored, so miniaturized, covered, and
inactive-Space windows still release GPU as #10815 intended. Key/main transitions and
screen changes re-evaluate the rule.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* test: irx keepalive waits for the first pong with a deadline (reintroduced by #10889; the determinism gate blocks main)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix: clear the Swift warning buckets over budget on this base (irx statics/captured self, surfaces socket shared access)

Same fixes as #10905, carried here so the warning-budget gate lets the display step run.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
rustybret pushed a commit to rustybret/bmux that referenced this pull request Aug 27, 2026
525352e ios: match launch screen logo to the App Store icon glyph (manaflow-ai#10913)
a1f0cf9 Present terminal renderers in on-screen windows that never report an occlusion .visible bit (fixes the display-liveness CI regression from manaflow-ai#10815) (manaflow-ai#10922)
86061c8 iOS: show the unread count on workspace indicators, in parity with macOS (manaflow-ai#10791)
5cacd70 fix: clear three Swift warning buckets over the CI budget on main (manaflow-ai#10905)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant