Skip to content

fix(bin): read FM_HOUSEKEEPING_TICK for the daemon idle sleep - #2895

Open
harmeet-1337 wants to merge 2 commits into
kunchenguid:mainfrom
harmeet-1337:fm/fm-fix-tick
Open

fix(bin): read FM_HOUSEKEEPING_TICK for the daemon idle sleep#2895
harmeet-1337 wants to merge 2 commits into
kunchenguid:mainfrom
harmeet-1337:fm/fm-fix-tick

Conversation

@harmeet-1337

Copy link
Copy Markdown

Summary

Implements accepted fleet-wide simplification audit finding F-S08-2-incidental (P0).

The away-mode supervise daemon's non-wake idle sleep read an unprefixed ${HOUSEKEEPING_TICK}, while the housekeeping-age gate and the file header both use the documented FM_HOUSEKEEPING_TICK. The documented knob therefore never governed the idle-loop cadence; it silently fell back to the 15s default.

Changes

  • bin/fm-supervise-daemon.sh: the non-wake idle sleep now reads FM_HOUSEKEEPING_TICK, so one documented knob controls both the idle sleep and the housekeeping-age gate. No unprefixed ${HOUSEKEEPING_TICK reads remain.
  • tests/fm-daemon.test.sh: added a behavioral regression test that drives the real daemon binary through its non-wake idle branch (stub watcher exiting on a singleton-collision line, plus a PATH sleep recorder) and asserts the idle sleep honors FM_HOUSEKEEPING_TICK (=3) and never the 15s default. Verified it fails pre-fix and passes post-fix.
  • docs/configuration.md and the script header/comment: documented that FM_HOUSEKEEPING_TICK also paces the idle sleep.

Validation

  • Full tests/fm-daemon.test.sh suite passes (104/104).
  • bin/fm-lint.sh clean locally (ShellCheck 0.11.0, actionlint 1.7.12).
  • Validated through the no-mistakes pipeline (intent, rebase, review, test, document); lint was skipped only because the pipeline sandbox lacked ShellCheck on PATH, verified clean locally.

Minimal diff scoped to the finding; all existing messages, output, and exit codes preserved.

The away-mode daemon's non-wake idle sleep read an unprefixed
HOUSEKEEPING_TICK, so the documented FM_HOUSEKEEPING_TICK knob (used by
the housekeeping-age gate and file header) never governed the idle-loop
cadence; it silently fell back to the 15s default. Read the prefixed
name so the one documented knob controls both paths.

Add a behavioral case that drives the daemon through its non-wake idle
branch and asserts the idle sleep honors FM_HOUSEKEEPING_TICK.
@greptile-apps

greptile-apps Bot commented Aug 23, 2026

Copy link
Copy Markdown

Confidence Score: 5/5

The PR appears safe to merge with no actionable changed-code defects identified.

The runtime change consistently applies the already documented housekeeping setting to the idle branch, and the added regression test exercises that corrected path without introducing a concrete supported-environment failure.

Reviews (1): Last reviewed commit: "no-mistakes(document): document FM_HOUSE..." | Re-trigger Greptile

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