dsh-keep-awake: Keeping DSH Hosts Awake During Task Execution

Introduction

When running long tasks with DeepSeek Harness (DSH), a common scenario is: the browser is in the foreground, but the operating system will still turn off the screen or enter sleep mode after a period of inactivity. If tasks continue to execute on the DSH backend, the host going into sleep mode can affect network and process behavior, making troubleshooting non-intuitive. Relying on manually modifying system power policies or installing global anti-sleep tools often requires administrator privileges and doesn’t align with the need to “keep awake only when tasks are running.”

Below we introduce a community plugin dsh-keep-awake (npm package name @zi7tian/dsh-keep-awake): When DSH determines there are active tasks, it keeps the device running the DSH backend awake through native power assertions on each platform; when all tasks complete, it automatically releases, without long-term occupying system policies.

What Is This

dsh-keep-awake is a client-side plugin for DSH, maintained by zi7tian. It solves: During AI task execution, preventing the host running the DSH backend from being interrupted or becoming difficult to observe due to system sleep; the keep-awake logic is coordinated by the DSH backend, rather than depending on whether the current webpage is in the foreground.

The current version of the plugin is 0.4.1 (MIT license), developed for DSH 0.2.0-rc.2. Directory page: SkillHub - dsh-keep-awake; Source code and documentation: GitHub - zi7tian/dsh-keep-awake.

Core Features

Backend-Driven Keep-Awake Scope

Keep-awake is controlled by the DSH backend, supporting multiple sessions and sub-agents. Closing the webpage or switching the browser to the background will not stop the keep-awake for running tasks; unlike the approach of “only preventing sleep in the foreground tab.”

After installation and enabling in the Web interface, a sun icon appears in the same row as settings in the sidebar. Clicking it shows the status, the number of currently running tasks, and allows manual enabling or disabling of keep-awake.

Native APIs, Standard User Privileges

The plugin uses temporary power assertions under standard user privileges, requiring no administrator privileges, not modifying global power settings, and not simulating mouse or keyboard:

Platform Mechanism
Windows Power Request
macOS IOKit
Linux D-Bus ScreenSaver and logind

If system interfaces are unavailable, the UI will reflect partially effective or failed status. The protected object is the device running the DSH backend; manual screen locking, closing the lid, and system-enforced policies may still override the keep-awake effect.

Lifecycle

The keep-awake scope is the current DSH process; after process restart, keep-awake is enabled by default again. The plugin releases power requests when stopped or when the DSH host exits.

Documentation notes: Linux has been verified on real hardware; Windows and macOS are implemented but await real hardware verification.

Installation and Enabling

In the DSH ecosystem, plugins can be installed via npm, GitHub, or local links; the following commands are from the project README.

dsh plugin --profile web add @zi7tian/dsh-keep-awake

Install from GitHub

dsh plugin --profile web add github:zi7tian/dsh-keep-awake

Local Development and Linked Installation

If you need to install from a linked source directory, first clone the repository locally and complete dependency installation, then replace the link: path with your absolute path (use the corresponding local path on Windows):

git clone https://github.com/zi7tian/dsh-keep-awake.git
cd dsh-keep-awake
npm ci
dsh plugin --profile web add link:/absolute/path/to/dsh-keep-awake

The plugin depends on Koffi (3.3.2 in package.json), which will fetch native components suitable for the current platform during installation. Linux also requires the system to provide libdbus-1 and corresponding session services.

After installation or upgrade, wait for the current task to complete, then restart dsh web and refresh the page. The sun icon next to settings indicates the control panel has been loaded. For desktop version, install through its plugin manager.

Uninstall

dsh plugin --profile web remove @zi7tian/dsh-keep-awake

Typical Usage

In daily use, no additional configuration files are usually needed: after installation and restarting the Web interface, the backend automatically applies for keep-awake when there are active tasks and releases when tasks complete.

When manual intervention is needed:

  1. Open the DSH Web sidebar, find the sun icon in the same row as settings.
  2. Click to view the current keep-awake status and number of running tasks.
  3. Enable or disable keep-awake according to the interface options (e.g., temporarily disable when debugging power behavior).

Suitable Scenarios and Notes

Who it’s for: Users running DSH backend locally on laptops or desktops, with long-running tasks, who don’t want to globally modify power schemes or use persistent third-party anti-sleep software.

Permissions and Security: The plugin runs with the permissions of the current dsh process and applies for temporary power assertions through native APIs. Before installation, it is recommended to read the repository source code and MIT license to ensure it complies with your environment policies.

Boundaries: Keep-awake targets system sleep/screensaver behavior and cannot replace constraints on screen locking, lid-close sleep, or enterprise MDM policies. Multi-platform implementation progress should refer to the README.

Ecosystem Note: DSH adopts an “everything is a plugin” extension approach; SkillHub and similar sites are community directory sites, with no official affiliation to DeepSeek / QuantumFactory. This article introduces a community-maintained plugin, not an official app store entry.

Conclusion

dsh-keep-awake connects “keep awake only when there are tasks, release when there are no tasks” to the DSH backend task lifecycle, and implements it using native power assertions on each platform. The sun icon in the sidebar provides status and controls. If you frequently run long tasks on local DSH, you can install it using the commands above, restart dsh web, and check if the icon appears next to settings.

  • Directory page: https://www.skillhub.cn/plugins/zi7tian/dsh-keep-awake
  • GitHub: https://github.com/zi7tian/dsh-keep-awake
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye