Skip to content

health(github-workflow): reproduce gh-absent #7713

@MannXo

Description

@MannXo

Summary

Reproduce startup behavior when the GitHub CLI (gh) is entirely absent or not on the PATH; add unit tests for HealthService, implement an explicit ENOENT detection and a small non-blocking retry/backoff so the server recovers when gh becomes available, and add a short runbook/docs snippet with reproduction and remediation steps.
(see parent issue #7687)

To do

  • Add reproducible instructions and a short script to simulate gh being absent (e.g., PATH modification) under ai/mcp/server/github-workflow/docs/gh-absent.md.
  • Add unit tests for HealthService that mock child_process.exec / execAsync to simulate these states:
    • ENOENT (gh not installed / not in PATH)
    • stdout empty + stderr-only output
    • gh present but unauthenticated
    • gh present but old version
  • Implement code changes in ai/mcp/server/github-workflow/services/HealthService.mjs to:
    • Detect ENOENT explicitly and log a clear, actionable message ("gh CLI not found in PATH; tools will be disabled until installed")
    • Return a consistent health status (degraded/unhealthy) without crashing the server
    • Add a small non-blocking retry/backoff (configurable) for auth/version checks so the server can recover without restart
  • Add a short runbook/docs entry with reproduction steps and remediation commands.

Acceptance criteria

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions