Skip to content

fix(doctor): GENIE_WATCHDOG_SKIP + auto-skip for bundle installs (PR-B G7) - #1638

Merged
automagik-genie merged 1 commit into
devfrom
fix/watchdog-skip-env-var
May 4, 2026
Merged

automagik-genie merged 1 commit into
devfrom
fix/watchdog-skip-env-var

Conversation

@automagik-genie

Copy link
Copy Markdown
Contributor

Summary

Cli-noise-and-hygiene-cleanup G7 — silence the recurring [!!] watchdog — auto-install failed warning that fires on every genie doctor --fix for bundle-mode installs.

Adds two short-circuits to checkWatchdog:

  1. Explicit opt-out: GENIE_WATCHDOG_SKIP=1 → {status: 'skipped', detail: 'GENIE_WATCHDOG_SKIP=1'}. installWatchdog never runs. report.ok stays true.
  2. Auto-skip for bundle installs: If resolveWatchdogCliPath() returns null AND GENIE_WATCHDOG_INSTALL_CMD is unset → skipped with informational hint. The install would have failed anyway; informational beats [!!].

Source-repo installs and operators using GENIE_WATCHDOG_INSTALL_CMD keep 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

  • typecheck clean
  • biome clean (after switching delete process.env.X → Reflect.deleteProperty to satisfy lint/performance/noDelete)
  • Smoke: GENIE_WATCHDOG_SKIP=1 skip path tested live; bundle-install path verified by absence of packages/watchdog/
  • CI green on GitHub

Wish

  • Parent: cli-noise-and-hygiene-cleanup PR-B G7

🤖 Generated with Claude Code

`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.
@coderabbitai

coderabbitai Bot commented May 4, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: a80e91ba-a09b-43d7-b1be-7966f099f21a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/watchdog-skip-env-var

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@automagik-genie
automagik-genie merged commit f0533d8 into dev May 4, 2026
16 checks passed

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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()) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

@automagik-genie
automagik-genie deleted the fix/watchdog-skip-env-var branch May 4, 2026 17:07
automagik-genie pushed a commit that referenced this pull request May 4, 2026
Add a 'Skipping the install' section to the watchdog README so the
two opt-outs introduced in #1638 are discoverable without grepping
source.

Wish: cli-noise-and-hygiene-cleanup G7 (deliverable #3 — docs).
automagik-genie added a commit that referenced this pull request May 4, 2026
…1642)

Add a 'Skipping the install' section to the watchdog README so the
two opt-outs introduced in #1638 are discoverable without grepping
source.

Wish: cli-noise-and-hygiene-cleanup G7 (deliverable #3 — docs).

Co-authored-by: Felipe <felipe@namastex.ai>
namastex888 added a commit that referenced this pull request May 7, 2026
…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>
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.

2 participants