Skip to content

fix(desktop): prevent-sleep spawn convention + expiry badge#487

Merged
wesbillman merged 1 commit intomainfrom
prevent-sleep
May 5, 2026
Merged

fix(desktop): prevent-sleep spawn convention + expiry badge#487
wesbillman merged 1 commit intomainfrom
prevent-sleep

Conversation

@wesbillman
Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #484, addressing two findings from the Codex adversarial review:

  • Use tauri::async_runtime::spawn instead of tokio::spawn for the 4-hour cap timer. Follows the codebase convention for spawning from non-async contexts (see huddle/models.rs:381 rationale). Stores the JoinHandle directly instead of extracting an AbortHandle.
  • Fix "Active" badge after 4-hour expiry. The active derivation now includes && !expired, so the status badge correctly shows "Inactive" after the cap fires and the IOKit assertion is released.

Test plan

  • cargo check passes
  • pnpm typecheck passes
  • Toggle on, verify badge shows "Active" when agents run
  • After expiry (or simulated), badge shows "Inactive" and yellow banner appears

🤖 Generated with Claude Code

…ter expiry

Two fixes from Codex adversarial review of #484:

1. Replace tokio::spawn with tauri::async_runtime::spawn for the 4-hour
   cap timer. Follows the codebase convention for spawning from non-async
   contexts (see huddle/models.rs:381 rationale).

2. Include !expired in the active derivation so the status badge shows
   "Inactive" after the 4-hour cap fires, matching the actual backend
   state where the IOKit assertion has been released.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@wesbillman wesbillman merged commit 3d585dc into main May 5, 2026
23 of 24 checks passed
@wesbillman wesbillman deleted the prevent-sleep branch May 5, 2026 21:44
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