3.0 KiB
RB-08 MAJOR: PowerAssertion is a non-functional stub on macOS
Severity: MAJOR (macOS only)
Path: src-tauri/src/commands/power.rs:41-121
Source: 2026-04-22 code review, originally deferred during A.1 #9
Labels: release-blocker, major, macos, platform
Current state (2026-04-23): objc2/objc2-foundation have been
added behind cfg(target_os = "macos"), and the NSProcessInfo
bridge now calls beginActivityWithOptions:reason: / endActivity:
with the retained activity handle. Isolated cargo check validation
passes for both x86_64-apple-darwin and aarch64-apple-darwin.
Remaining acceptance gap: manual runtime verification on a real macOS
machine (pmset -g assertions, background live session). Diagnostic
reports now also include a ## Power assertions section that lists any
currently active Kon assertion guards (reason, backend, acquired)
at report time, which gives the tester an in-app breadcrumb alongside
pmset.
Problem
begin_activity always returns Err on macOS, so PowerAssertion::begin converts to None and the guard never acquires an NSProcessInfo beginActivityWithOptions:reason: assertion. Live recording and LLM cleanup therefore run without App Nap protection on the one platform where it matters.
The stub was deliberate (A.1 #9 acceptance concession — untestable on Linux without a macOS build host). Re-flagged here so it is not forgotten before the first macOS ship.
Acceptance
objc2+objc2-foundationdeps added to the kon crate, gatedcfg(target_os = "macos").begin_activitycalls[NSProcessInfo processInfo] beginActivityWithOptions:(NSActivityUserInitiated | NSActivityLatencyCritical) reason:reason]and retains the returned activity handle.end_activitycallsendActivity:on the retained handle.- Manual-test on a real macOS box: 10-minute background live session completes without throttling;
pmset -g assertionsshows Kon's activity during capture.
Manual verification checklist
- Launch Kon on a real macOS machine and start a live transcription session.
- While capture is running, background the app for at least several minutes.
- In Terminal, run
pmset -g assertionsand confirm Kon appears with a user-initiated / no-idle-style assertion while the session is active. - While the session is still running, generate a Kon diagnostic report
and confirm the
## Power assertionssection lists an active entry such asreason=kon live dictation session,backend=macos,acquired=true. - Stop the session and rerun
pmset -g assertionsor regenerate the diagnostic report to confirm the assertion disappears. - Repeat once for the LLM cleanup path if desired
(
reason=kon LLM cleanup).
Fix scope
Medium. Dep addition + FFI glue + manual verification. Can be done from Linux with cargo check --target=aarch64-apple-darwin for compile validation, but runtime behaviour needs a macOS machine.
Dependencies
- Hard blocker: before first macOS build/ship.