fix(doctor): GENIE_WATCHDOG_SKIP + auto-skip for bundle installs (PR-B G7) - #1638
Conversation
`genie doctor --fix` ran the watchdog systemd-unit install on every
invocation for users without `packages/watchdog/` (bundle-mode npm/CDN
installs), surfacing as `[!!] watchdog — auto-install failed` noise
that no end user could resolve without changing their install layout.
Two new short-circuits in `checkWatchdog`:
1. GENIE_WATCHDOG_SKIP=1 → status=skipped (explicit opt-out for
managed-systemd or CI-like envs).
2. resolveWatchdogCliPath() returns null AND no override env var →
status=skipped with a hint pointing at the env var. Bundle
installs ship dist/genie.js only; the install would fail anyway.
Source-repo installs and operators using GENIE_WATCHDOG_INSTALL_CMD
are unchanged — both paths still hit the existing autoFix logic.
Wish: cli-noise-and-hygiene-cleanup G7.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request introduces an environment variable GENIE_WATCHDOG_SKIP to allow users to manually opt-out of watchdog checks. Additionally, it implements logic to automatically skip these checks in bundle-mode installs where the watchdog CLI path is unavailable. A review comment suggests refactoring the call to resolveWatchdogCliPath into the dependency injection interface to improve the testability of the bundle-mode skip logic.
| // override, the install will inevitably fail. Surface that as `skipped` | ||
| // (informational) instead of `refused` (warning), since the user can't | ||
| // recover without changing their install layout. | ||
| if (!process.env.GENIE_WATCHDOG_INSTALL_CMD && !resolveWatchdogCliPath()) { |
There was a problem hiding this comment.
The direct call to resolveWatchdogCliPath() bypasses the dependency injection (DI) pattern used for other external interactions in this module (like platform or installWatchdog). This makes it difficult to unit test the new 'bundle-mode' skip logic, as evidenced by the lack of a corresponding test case in ensure-ready.test.ts. Consider adding resolveWatchdogCliPath to the EnsureServeReadyDeps interface to maintain consistency and improve testability.
…coped per reviewer Lands the wish doc that scaffolds PR-A (#1634) and PR-B (#1636/#1637/#1638/ #1640/#1642), plus the 2026-05-07 PR-C draft + reviewer FIX-FIRST corrections. Why this is a separate docs commit: - The wish file was authored 2026-05-04 but only ever sat in a stash; never committed despite shipping work referencing it. This commit lands the reference document for completed + pending work in one place. - PR-C as originally drafted had three invalid premises against live 4.260507.1 (G3 amendment already implemented at scheduler-daemon.ts:1296; G9 line is on stderr not stdout; G10 design assumes binary-spawn that the HTTP probe doesn't do). Reviewer corrections folded in. - Only G8 (kill-path shadow+UUID dedup) survives intact — file path corrected to src/term-commands/agents.ts:2817 (handleWorkerKill). - G9 reframed as stderr-noise reduction (DEBUG=pgserve gating). - G10 deferred pending /trace into update.ts:362. QA dogfooding-72h artifacts (AUDIT.md, QA-PLAN.md) document the 72-h fix-audit sweep that surfaced the bugs and triggered the wish update. Refs: #1677 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Summary
Cli-noise-and-hygiene-cleanup G7 — silence the recurring
[!!] watchdog — auto-install failedwarning that fires on everygenie doctor --fixfor bundle-mode installs.Adds two short-circuits to
checkWatchdog:GENIE_WATCHDOG_SKIP=1→{status: 'skipped', detail: 'GENIE_WATCHDOG_SKIP=1'}.installWatchdognever runs.report.okstays true.resolveWatchdogCliPath()returns null ANDGENIE_WATCHDOG_INSTALL_CMDis unset → skipped with informational hint. The install would have failed anyway; informational beats[!!].Source-repo installs and operators using
GENIE_WATCHDOG_INSTALL_CMDkeep their existing autoFix path.Files
src/term-commands/serve/ensure-ready.ts(+23 / -0)src/term-commands/serve/ensure-ready.test.ts(+28 / -0)Test plan
delete process.env.X→Reflect.deletePropertyto satisfy lint/performance/noDelete)GENIE_WATCHDOG_SKIP=1skip path tested live; bundle-install path verified by absence ofpackages/watchdog/Wish
cli-noise-and-hygiene-cleanupPR-B G7🤖 Generated with Claude Code