Skip to content

[Code Quality] Restore gh-aw MCP logs tool access for audit agent #13412

@github-actions

Description

@github-actions

Description

The Agentic Workflow Audit Agent cannot access the gh-aw MCP server logs tool, preventing comprehensive workflow analysis including token usage, cost tracking, and error pattern identification.

Current Impact

From the 2026-01-27 Workflow Audit Report:

Cannot analyze:

  • ❌ Detailed workflow execution logs
  • ❌ Token usage statistics
  • ❌ Actual costs
  • ❌ Missing tool requests
  • ❌ Specific error patterns from logs

Audit quality: Significantly degraded - relying only on GitHub API metadata and historical cache data

Root Cause

The gh-aw MCP server tools (agentic_workflows/status and agentic_workflows/logs) are not accessible during audit execution, either due to:

  1. MCP server not configured for audit workflow
  2. Permission/authentication issues
  3. Tool registration not working

Suggested Changes

1. Verify MCP Configuration

Check audit workflow frontmatter (.github/workflows/audit-workflows.md):

tools:
  gh-aw:
    mode: remote  # or local
    toolsets: [logs, status]  # Ensure logs toolset is enabled

2. Add Fallback Error Handling

If MCP tools fail, the audit should:

  • Log clear error message about missing tools
  • Continue with available data sources
  • Report degraded audit quality in summary

3. Validate MCP Server Health

Add a health check at audit start:

# Pseudo-code
if ! check_mcp_tool_available("agentic_workflows/logs"); then
    log_warning("MCP logs tool unavailable - audit will be incomplete")
fi

Files Affected

  • .github/workflows/audit-workflows.md - audit workflow configuration
  • pkg/cli/workflows/audit-*.md - if audit uses local workflow
  • MCP server configuration files

Success Criteria

  • Audit agent can successfully call agentic_workflows/logs tool
  • Token usage and cost data available in audit reports
  • Error patterns extracted from workflow logs
  • Audit quality returns to "Complete" status
  • Test with next scheduled audit run

Testing

# Manual test
gh aw run audit-workflows --engine copilot

# Verify logs access in output
# Should see token usage, cost data, and error patterns

Impact

High - Without this, audit reports lack critical data:

  • Cannot track token usage trends
  • Cannot calculate costs
  • Cannot identify recurring error patterns
  • Cannot provide actionable recommendations based on logs

Historical average success rate is only 12.7% - log access is critical for root cause analysis.

Source

Extracted from Agentic Workflow Audit Report discussion #11992 (2026-01-27).

Issue listed as #1 immediate action: "Restore MCP Logs Access".

Priority

High - Critical for comprehensive workflow health monitoring and debugging

AI generated by Discussion Task Miner - Code Quality Improvement Agent

  • expires on Feb 17, 2026, 5:23 AM UTC

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions