cmux NEXT: await FolderChanges.events() in MachineConsentChanges (build fix)

Merged
AZ
8d ago
+6-6

Summary

feat-cmux-next does not compile. Two changes that landed an hour apart don't build together:

  • #27223 (15:42) added MachineConsentChanges.events(armed:), which calls FolderChanges(folders:).events() from a synchronous function.
  • #26517 (16:43) made FolderChanges.events() async, so it returns only after its watches are registered.

Fleet build 549a2bfa50c634b6131799d8 at 6d8838a09200 fails in swift_compile:

Packages/macOS/CmuxNext/Sources/CmuxNextApp/Remote/JoinConsent+App.swift:222:29: error: 'async' call in a function that does not support concurrency

This change makes MachineConsentChanges.events(armed:) async and awaits the folder watch. That ordering is what its doc comment already promised: folder watch registered, then file watches, then armed, then one yield. Its three callers (the model's watch task and two JoinConsentTests) now await it. The package runs with NonisolatedNonsendingByDefault, so the non-Sendable armed closure stays on the caller's actor.

Changelog

none

Review

A subagent did a correctness review of 8dec64d15a7b and found nothing blocking. It checked:

  • every FolderChanges.events() and MachineConsentChanges.events call site in Packages/;
  • isolation under the package settings;
  • ordering;
  • cancellation: a cancelled FolderChanges wait returns a finished stream, the detached loop exits, and the file watches are cancelled and the continuation finished. Nothing leaks.

It noted one older issue that this PR does not cause: watchFiles resumes its file sources without waiting for registration, the race #26517 fixed for folders. That's left for a follow-up.

Observed / Not run

  • Observed: base 6d8838a09200 fails to compile on the fleet (job 549a2bfa50c634b6131799d8, error above).
  • Pending: scripts/ci/package-test-lane.sh suite Packages/macOS/CmuxNext JoinConsentTests at the head (cmux-ci step 22cfe1759689444cd520dd0e). The result will be posted here before ready-to-land.
  • Not run: no runtime change beyond the ordering above, so no capture (No capture: build fix, no UI change).

šŸ¤– Generated with Claude Code


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


Summary by cubic

Fixes the feat-cmux-next build break by making MachineConsentChanges.events(armed:) async to match the now-async FolderChanges.events().

  • The folder watch is now awaited before file watches fire, matching the ordering the doc comment already promised.
  • The three callers (model watch task and two JoinConsentTests) now await the call.