cmux NEXT: await FolderChanges.events() in MachineConsentChanges (build fix)
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 callsFolderChanges(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()andMachineConsentChanges.eventscall site inPackages/; - isolation under the package settings;
- ordering;
- cancellation: a cancelled
FolderChangeswait 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
6d8838a09200fails to compile on the fleet (job549a2bfa50c634b6131799d8, error above). - Pending:
scripts/ci/package-test-lane.sh suite Packages/macOS/CmuxNext JoinConsentTestsat the head (cmux-ci step22cfe1759689444cd520dd0e). The result will be posted here beforeready-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](https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v3-3x.png)
![Autofix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
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) nowawaitthe call.