keep-awake
The built-in Policy keep-awake, against the machine sleeping while the agent works: its defaults, its options and a configuration that writes it.
To learn what it guards against and see it at work, read the guide: Keep awake.
Defaults
| Default | Value |
|---|---|
| On by default | no: an entry turns it on |
| Fail mode | open |
| Timeout | 5000 ms |
| Events | Stop, UserPromptSubmit |
| Tools | every tool, or as its options set |
| Agent types | every agent, or as its options set |
Options
| Option | Type | Default | Description |
|---|---|---|---|
command | string[] | — | The keep-awake command, its program and arguments; when absent, the first the machine has of caffeinate -i -t 3600 and systemd-inhibit --what=idle … sleep 3600. |
rearmOnStopBlock | boolean | — | Whether a stop that a stop check blocks keeps the machine awake for the turn that goes on (true when absent); false releases it at every stop. |
Example
A configuration that writes every option, a comment above each:
import { defineConfig } from '@microeinhundert/harness-kit';
export default defineConfig({
// The Policy entries, in the order their Decisions merge in.
policies: [
{
// The Policy's name, unique in the configuration; messages and logs name the Policy by it.
id: 'keep-awake',
// The constructor's options, which it decodes.
options: {
// The keep-awake command, its program and arguments; when absent, the first the machine has
// of `caffeinate -i -t 3600` and `systemd-inhibit --what=idle … sleep 3600`.
command: ['caffeinate'],
// Whether a stop that a stop check blocks keeps the machine awake for the turn that goes on
// (`true` when absent); `false` releases it at every stop.
rearmOnStopBlock: true,
},
// The name of the kit's Policy constructor that builds the Policy.
use: 'keep-awake',
},
],
});worktree-health
The built-in Policy worktree-health, against a checkout that loads another checkout’s packages, a stale worktree, a full disk: its defaults, its options and a configuration that writes it.
toolchain
The built-in Policy toolchain, against a session on the wrong tool versions, rules missing from the agent’s context: its defaults, its options and a configuration that writes it.