gh-workflow-mcp: Error message and logging improvements

Resolved 💬 3 comments Opened Dec 25, 2025 by natb1 Closed Feb 14, 2026

Error Message and Logging Improvements

Tracking 2 error handling improvements identified in PR #432 all-hands-review (iteration 4) but deemed out-of-scope for immediate implementation.

Items from Silent Failure Hunter

Issue #6: Console Logging Levels Inconsistent

Priority: MEDIUM
Files: Multiple locations in gh-workflow-mcp-server/src/utils/gh-watch.ts

Description: The logging uses a mix of console.warn, console.error, and console.debug inconsistently:

  • Line 78: console.warn for timeout (appropriate)
  • Line 101: console.error for execution failure (appropriate)
  • Some locations use console.debug for normal operational events that should be visible

Recommendation: Standardize logging levels:

  • console.error: Unrecoverable failures
  • console.warn: Recoverable issues that need attention
  • console.info or console.log: Normal operational events
  • console.debug: Detailed diagnostics

Example: Change debug level to info for fail-fast detection - it's normal operation, not a debugging situation.

---

Issue #7: Unclear Error Message for Empty Run Results

Priority: MEDIUM
Files: Multiple files in gh-workflow-mcp-server

Description: When no workflow runs are found for a PR, the error message isn't actionable:

if (!Array.isArray(checks) || checks.length === 0) {
  throw new ValidationError(`No workflow runs found for PR #${input.pr_number}`);
}

This doesn't tell users:

  • Why there might be no runs (PR too new, workflows not configured, filters too restrictive)
  • What they can do about it
  • Whether they should wait or fix configuration

Recommendation: Provide more context:

if (!Array.isArray(checks) || checks.length === 0) {
  throw new ValidationError(
    `No workflow runs found for PR #${input.pr_number}. This could mean:\n` +
    `  - The PR was just opened and workflows haven't started yet\n` +
    `  - No workflows are configured to run on this PR\n` +
    `  - Check your repository's .github/workflows/ configuration`
  );
}

Apply this pattern to other "not found" error messages across the gh-workflow-mcp server.

---

Priority

Medium - These improvements would enhance user experience and debugging but don't affect core functionality.

Related Issues

  • #432 - Parent PR for gh watch implementation
  • #15372 - Documentation and comment quality improvements
  • #15373 - Additional test coverage for edge cases
  • #15374 - Type design improvements
  • #539 - Runtime validation improvements

Notes

  • This is a general quality improvement not specific to the watch implementation
  • Can be implemented independently of #432
  • Consider applying these patterns across all MCP servers for consistency

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗