Frontmatter
| id | 7930 |
| title | Bug: GitHub HealthService fails in standalone SDK scripts |
| state | Closed |
| labels | invalidai |
| assignees | tobiu |
| createdAt | Nov 29, 2025, 5:23 PM |
| updatedAt | Nov 29, 2025, 5:42 PM |
| githubUrl | https://github.com/neomjs/neo/issues/7930 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | 7914 |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Nov 29, 2025, 5:42 PM |
Bug: GitHub HealthService fails in standalone SDK scripts
tobiu added parent issue #7914 on Nov 29, 2025, 5:23 PM
tobiu cross-referenced by #7914 on Nov 29, 2025, 5:24 PM
tobiu assigned to @tobiu on Nov 29, 2025, 5:40 PM

tobiu
Nov 29, 2025, 5:41 PM
Input from Gemini 2.5 Agent:
✦ # Resolution: Not a Bug
This issue was caused by incorrect consumption of the
HealthServiceAPI in thepm.mjsscript, not a defect in the service itself.Root Cause
The
GH_HealthService.healthcheck()method returns a structured object:{ status: 'healthy', githubCli: { authenticated: true, // ... } }The
pm.mjsscript was checkingghHealth.authenticated(which isundefined) instead ofghHealth.githubCli.authenticated.Fix
The script has been updated to check the correct property. Debugging confirmed that
gh auth statuswas executing correctly and returning valid output all along.Closing as invalid/resolved.
tobiu closed this issue on Nov 29, 2025, 5:42 PM
Bug: GitHub HealthService fails in standalone SDK scripts
Context
When running standalone agent scripts (e.g.,
ai/agents/pm.mjs) directly vianode,GH_HealthService.healthcheck()consistently reports authentication failure (GitHub Authentication failed. Check GH_TOKEN.), even when:ghCLI is installed and authenticated globally.dotenvis correctly loaded in the script.GH_IssueService(which also usegh) work perfectly fine.This suggests a flaw in how
HealthServiceexecutes its checks or interprets the environment in a standalone context versus thenpm run-managed MCP server context.Reproduction
GH_HealthServicefromai/services.mjs.node my-script.mjs.Goal
Fix
GH_HealthServiceso it correctly detects theghCLI status in standalone Node.js scripts, ensuring reliable "gatekeeping" for agents.