Skip to content

[Code Quality] Implement real-time log streaming with gh aw logs --follow #12594

@github-actions

Description

@github-actions

Description

Add real-time log streaming capability to gh aw logs command to enable developers to watch workflow execution live instead of waiting for completion. This reduces debugging time from 10-30 minutes to real-time.

Current Behavior

  • Users run gh aw logs workflow-name and wait for workflow completion
  • Logs downloaded only after workflow finishes
  • No visibility into in-progress workflows
  • Significant wait time before debugging can begin

Desired Behavior

  • gh aw logs workflow-name --follow streams logs as workflow executes
  • Updates appear in real-time with minimal latency (< 5 seconds)
  • Supports existing filtering options (--error-only, --mcp-only)
  • Gracefully handles workflow completion or user interrupt (Ctrl+C)

Files Affected

  • pkg/cli/logs_command.go - Add --follow flag
  • pkg/cli/logs_download.go - Implement streaming logic
  • pkg/cli/logs_github_api.go - Add polling mechanism

Suggested Changes

  1. Add --follow / -f flag to logs command
  2. Implement GitHub Actions Logs API polling (5-10 second intervals)
  3. Stream new log lines to console as available
  4. Store last-read position to fetch only new lines
  5. Implement exponential backoff for completed workflows
  6. Handle Ctrl+C cleanly with proper cleanup

Success Criteria

  • --follow flag implemented and tested
  • Real-time streaming works with <5 second latency
  • Existing filtering options work with streaming
  • Graceful handling of completion and interrupts
  • Progress indicator during poll intervals
  • Unit tests for polling logic
  • Integration tests for end-to-end behavior
  • Documentation updated (debugging skill, CLI reference)

Implementation Notes

  • Use GitHub Actions Logs API with polling to avoid rate limits
  • Consider goroutines for non-blocking updates
  • Add timeout protection for long-running workflows
  • Include "Waiting for logs..." indicator between polls

Priority

High - Critical for debugging long-running workflows, significantly improves developer experience

Source

Extracted from Repository Quality Improvement Report - Workflow Health Monitoring #12540 - Task 1

AI generated by Discussion Task Miner - Code Quality Improvement Agent

  • expires on Feb 12, 2026, 5:15 PM UTC

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions