Summary
When running long Copilot CLI sessions (builds, tests, multi-step tasks), the computer may go to sleep, interrupting the work. A --caffeine flag would prevent the system from sleeping while a session is active.
Proposed Behavior
copilot-cli --caffeine — keeps the machine awake for the duration of the session, releasing on exit.
copilot-cli --caffeine=30m (or similar) — keeps the machine awake for a specified duration, with a sensible default (e.g., 2 hours) if no value is provided.
- On macOS, this could use
caffeinate under the hood.
- On Linux,
systemd-inhibit or similar.
- On Windows,
SetThreadExecutionState or equivalent.
Motivation
During long-running agent tasks (complex refactors, large test suites, background CI monitoring), the session can be interrupted if the machine sleeps. Users currently have to manually run caffeinate or adjust system settings. Integrating this into the CLI would be a nice quality-of-life improvement.
Open Questions
- Should this be opt-in per session or configurable as a default?
- What should the default timeout be if no duration is specified? (e.g., match session lifetime, or a fixed cap like 2h)
- Should it also prevent display sleep, or only system sleep?
Summary
When running long Copilot CLI sessions (builds, tests, multi-step tasks), the computer may go to sleep, interrupting the work. A
--caffeineflag would prevent the system from sleeping while a session is active.Proposed Behavior
copilot-cli --caffeine— keeps the machine awake for the duration of the session, releasing on exit.copilot-cli --caffeine=30m(or similar) — keeps the machine awake for a specified duration, with a sensible default (e.g., 2 hours) if no value is provided.caffeinateunder the hood.systemd-inhibitor similar.SetThreadExecutionStateor equivalent.Motivation
During long-running agent tasks (complex refactors, large test suites, background CI monitoring), the session can be interrupted if the machine sleeps. Users currently have to manually run
caffeinateor adjust system settings. Integrating this into the CLI would be a nice quality-of-life improvement.Open Questions