| title | Running the Worker Unattended |
|---|---|
| description | Choose when the worker picks up tasks and keep unattended runs healthy |
| section | Automation |
| order | 5 |
| sidebarHidden | true |
| dateModified | 2026-11-26 |
The worker is the unattended path for DevIntern Code. It keeps running, picks up ready tasks, watches the agent's pull requests, and receives instant events through the relay. You do not need cron or another scheduler around the CLI.
devintern worker init # workspace, ready-tasks query, relay pairing, and a user service
devintern workerWhere to find the details:
| Topic | Page |
|---|---|
| Polling, retries, and actioned tickets | Worker: Polling mode |
| Installing as a systemd or launchd service | Worker: Running as a service |
| Worker Pilot and automation licenses | Worker: Worker Pilot and licenses |
| Failure comments and crash recovery | Re-running a task, Interrupted runs |
| Scheduled story-point estimation | Story Points Estimation |
| Sandboxing unattended agent runs | Sandboxing the Agent |
Limit new-task pickup to chosen wall-clock windows, for example nights only, with [worker.schedule] in workspace.toml. Restart the worker after changing it.
[worker.schedule]
active = ["22:00-06:00"] # pick up ready tasks only inside these windows
blocked = ["12:00-13:00"] # optional; always wins over active
timezone = "" # optional IANA name, e.g. "Europe/Berlin"; blank = machine local time
catch_up_missed = true # drain once at startup if a whole window passed unused- Only new-task pickup pauses. Review replies, @mentions, recurring automations, and relay events keep running. A task that already started finishes even if its window closes.
- Windows may cross midnight and combine when you list several. A start equal to the end is rejected.
- Nothing is missed. While paused, the worker does not query the tracker, so tasks created overnight are picked up on the first tick after the window opens.
- Daylight saving. Windows follow the clock: a start time skipped by "spring forward" fires at the next valid moment; a time repeated by "fall back" uses its second occurrence.
- Catch-up. If the machine slept through an entire window, the next worker start drains once. Set
catch_up_missed = falseto wait for the next window instead.
To drain once now, ignoring the windows:
devintern worker run-now
devintern worker run-now --workspace /path/to/workspace.tomlThe running worker serves the request on its next poll (within [defaults].poll_interval, 60 seconds by default). If no worker is running, the request waits for the next worker start.
The startup banner shows the windows, timezone, and whether pickup is open. Each open/close change is logged once, and the dashboard header shows when the window next opens or closes.
- Git push over SSH: the service has no interactive SSH agent. Point the host at a key in
~/.ssh/config(Host github.com/IdentityFile ~/.ssh/your_key), or use an HTTPS remote withGITHUB_TOKEN. - Git over HTTPS: for
https://github.comremotes the worker handsGITHUB_TOKENto git itself, so a fresh machine needs no credential helper (GitLab remotes useGITLAB_CODE_HOST_TOKENthe same way). If git already has a credential helper for the host, such asgh auth setup-gitor a system keychain, that helper is used instead.devintern worker doctorfails the repository check when the API accepts the token but git cannot read the repository, and says whether the token lacksContentsaccess or your own helper is the one failing. - Git commit identity: a host with no
git config user.name/user.emailstill delivers. Commits use thegit_author_name/git_author_emailworkspace setting, else theGITHUB_TOKENuser, else a genericDevInternidentity; nothing is written to git config.devintern worker doctorwarns when only the generic identity is left. See Commit identity. If a commit still fails for a host reason (no identity, broken commit signing), the run fails at once with the fix in the log and the ticket comment; the agent is not asked to fix it. - Leftover processes: dev servers and watchers the agent starts are stopped when each run ends, times out, or is interrupted. No setup needed.
- Hand-written service units: pin
PATHto include the directory withbun(dirname "$(which bun)"), or the service fails withbun: command not found.