Skip to content
Back to writing

Teaching an AI to Read GitHub Actions Logs Without Hallucinations

How PipelineHealer parses GitHub Actions logs and gates remediation on confidence.

hackathon · ai-agents · ci-cd · github-actions · observability · prompt-engineering · devops

Most CI logs are noisy. Pasting 500+ lines into one LLM call and asking for "the fix" usually yields vague summaries or unsafe recommendations.

PipelineHealer needed a path that was explainable and testable.

For system context, see the PipelineHealer architecture diagram and the repository.

This post covers the design: pattern-first analysis, typed handoffs, model fallback, and IO guardrails. Baseline at write time was v0.3.0.

Why Raw Logs Break AI Workflows

GitHub Actions logs are not a single narrative. They are many narratives interleaved:

  • install output
  • test runner output
  • lint tool diagnostics
  • shell script traces
  • platform retries and metadata

The failure signal is often 1-3 lines buried in install output, test traces, and retries.

Model choice matters less than sending a small, focused payload.

Step 1: Structured Extraction Before Diagnosis

PipelineHealer's Log Analyzer does not diagnose. It only extracts signal:

  • error lines
  • warning lines
  • key events
  • job context
  • compact summary

That extracted structure is then passed forward as typed data. No free-form agent-to-agent conversation.

This gave me two immediate benefits:

  1. reproducible test fixtures for log parsing
  2. debuggable boundaries between extraction and diagnosis

Step 2: Pattern-First, Model-Second

Before any model fallback, the diagnosis path checks deterministic patterns for the core failure taxonomy:

  • dependency failures
  • lint failures
  • test failures
  • build config failures
  • timeout failures If pattern confidence is high, PipelineHealer acts without a model call. Low confidence routes to the model with typed output constraints.

Use the model where ambiguity remains, not where string matching already works.

Step 3: Keep Prompt Context Budgeted and Useful

Another failure mode in CI remediation systems is prompt overloading.

To avoid this, PipelineHealer uses bounded log prompt budgets and preserves both head and tail segments instead of blindly truncating from one side.

Why head+tail matters:

  • the head often contains setup and environment context
  • the tail often contains the exact terminal failure

Losing either side can destroy diagnosis quality.

Step 4: Reliability Controls Around Log and API IO

Even perfect parsing fails if data retrieval is unstable.

I added reliability controls around the pipeline:

  • retries/backoff for transient GitHub API failures (429/5xx/network)
  • per-step timeouts in the orchestrator
  • explicit handling for timed_out workflows

Failures become observable: retries, timeouts, and safe fallback to issue creation when remediation cannot run.

What This Changed in Practice

After these changes:

  • dependency/lint paths open fix PRs
  • test/build_config/timeout paths file structured issues
  • dashboard activity traces the full chain

I can see why an outcome happened, not just that it happened.

What's Next

Next post: From Webhook to Pull Request - a concrete walkthrough of the end-to-end execution path from workflow_run.completed to persisted activity and remediation output.

Reusable Takeaway Checklist

  • Extract structure first: errors, warnings, key events, and job context.
  • Classify deterministically for known failure patterns before using AI.
  • Use model fallback only when ambiguity remains after pattern checks.
  • Gate remediation actions by confidence and explicit policy.
  • Degrade safely to structured issue creation when confidence is low.

Post 4 of 6 in the AI Dev Days Hackathon series.