Skip to content

fix(daemon): pause dispatch on low disk and carry workerSandbox to the runner (AGT-4785) - #845

Merged
unohee merged 1 commit into
mainfrom
fix/agt-4785-host-health
Oct 21, 2026
Merged

unohee merged 1 commit into
mainfrom
fix/agt-4785-host-health

Conversation

@unohee

@unohee unohee commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Disk gate (AGT-4785): the heartbeat measures free space (statfs, bavail) on every volume the daemon writes to and holds dispatch below autonomous.minFreeDiskGiB (default 10, 0 = off). It sits after the worktree sweep and before any fetch/claim, so cleanup keeps running. One notice per change of state. Reads fail open.
  • workerSandbox was never passed to the runner: core/service.ts builds the runner config by hand-picked mapping and omitted the field. The runner saw undefined; the bash tool fences only on an explicit 'on', so the worker shell ran unfenced while the boot log said "Worker sandbox: on". Now mapped.

Verification

  • npm run ci and npm run test:coverage (580 files / 7829 tests, thresholds met) pass locally.
  • Mutations: dropping either mapping line fails service.test.ts; removing the gate return or ignoring the configured floor fails autonomousRunner.hostHealth.test.ts.
  • Factory harness C6: 3/3 fail without hostHealth.ts, 3/3 pass with it.
  • Fixed a flaky assertion that compared two live statfs readings for exact equality.

Not done

  • Explicit dispatch (/api/work, exec --issue) is not held by the disk gate.
  • A run that already failed with ENOSPC is still classified as a plain infra_error.
  • Not checked: whether CLI entry points that build their own runner config carry workerSandbox.

…e runner (AGT-4785)

The heartbeat now measures free space on every volume the daemon writes to and
holds dispatch below autonomous.minFreeDiskGiB (default 10), after the worktree
sweep and before any fetch or claim. One notice per change of state.

service.ts also never passed autonomous.workerSandbox to the runner, so the
worker bash ran unfenced while the boot log said the sandbox was on.
@unohee
unohee merged commit a42ecd6 into main Oct 21, 2026
7 checks passed
@unohee
unohee deleted the fix/agt-4785-host-health branch October 21, 2026 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant