Skip to content

feat: built-in prevention of machine sleep during overnight runs #16

@xKean

Description

@xKean

Feature Request

Currently, gnhf does not prevent the machine from going to sleep during long-running/overnight agent tasks. This means scheduled overnight runs could be interrupted if the system sleeps.

Proposed Solution

Add built-in sleep prevention, similar to what caffeinate (macOS) or systemd-inhibit (Linux) provide. This could be:

  • Automatically invoked when a run is started
  • Optionally toggled via a config flag or CLI option

Context

Discussed in the community — running agents overnight to avoid wasting weekly token limits is a popular use case. Reliable sleep prevention would make this much more practical.

Platform Notes

  • macOS: caffeinate -i (built-in, no install needed)
  • Linux: systemd-inhibit or xdg-screensaver
  • Windows: SetThreadExecutionState API or PowerShell [System.Windows.Forms.Application]::SetSuspendState

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions