Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 18, 2025

Campaign orchestrators need workflow execution data accessible in subsequent steps without GitHub CLI. The gh aw logs command now writes a summary.json file containing complete metrics and run data.

Changes

  • New --summary-file flag (default: "summary.json")

    • Outputs complete LogsData struct as indented JSON
    • Includes aggregate metrics, individual runs, tool usage, errors/warnings, network/firewall logs
    • Disable with empty string value
  • Campaign orchestrator documentation in help text

    • Pre-step pattern: download with GitHub CLI (gh aw logs <worker> --start-date -1mo -o /tmp/logs)
    • Analysis step pattern: read from summary.json (GitHub CLI unavailable)
    • Explicit file paths and structure
    • Live tracking guidance: Use summary.json data to update campaign project boards via update-project safe output, treating issues/PRs (workers) on the board as the real-time view of progress, ownership, and status without modifying worker workflow files
    • Incremental updates: Pull data based on last pull time using --start-date (e.g., --start-date -1d for daily updates) and align with existing board items to update only changed workers
  • Implementation: writeSummaryFile() in logs_report.go

    • Creates parent directories automatically
    • Writes after all runs are processed, before console output

Example

steps:
  - name: Download logs (initial)
    env:
      GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    run: |
      mkdir -p /tmp/portfolio-logs
      gh aw logs worker --start-date -1mo -o /tmp/portfolio-logs
  
  - name: Download logs (incremental)
    env:
      GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    run: |
      gh aw logs worker --start-date -1d -o /tmp/portfolio-logs
  
  - name: Analyze and update board
    run: jq '.summary' /tmp/portfolio-logs/summary.json

Output structure:

/tmp/portfolio-logs/
├── summary.json              # Complete metrics (NEW)
├── run-{id}/
│   ├── run_summary.json      # Individual cache
│   ├── aw_info.json
│   └── workflow-logs/
Original prompt

Campaign orchestrators need clearer guidance on tracking worker workflows and generating comprehensive status reports. In a pre-step get the logs of each worker, something like:

tools:
  github:
    toolsets: [default]
  bash: ["*"]
steps:
  - name: Download logs from last 30 days
    env:
      GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    run: |
      mkdir -p /tmp/portfolio-logs
      gh aw logs <worker> --start-date ... -o /tmp/portfolio-logs --json > /tmp/portfolio-logs/summary.json

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@mnkiefer mnkiefer marked this pull request as ready for review December 18, 2025 16:48
Copilot AI and others added 2 commits December 18, 2025 16:51
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copilot AI changed the title [WIP] Add guidance for tracking worker workflows and logs Add summary.json output to gh aw logs for campaign orchestrators Dec 18, 2025
Copilot AI requested a review from mnkiefer December 18, 2025 16:58
@mnkiefer
Copy link
Contributor

@copilot: Here are some clearer campaign orchestrator instructions:

  • Use the project campaign board for live tracking only. Treat issues/PRs (workers) on the board as the real-time view of progress, ownership, and status for humans. How can this be achieved give than workers are tracked by the campaign and we don't want to modify/change the worker files by design.

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 18, 2025

@copilot: Here are some clearer campaign orchestrator instructions:

  • Use the project campaign board for live tracking only. Treat issues/PRs (workers) on the board as the real-time view of progress,...

Added guidance in commit c675a0e on using project boards for live tracking without modifying worker files.

The help text now includes a "Live Tracking with Project Boards" section explaining that:

  • The orchestrator uses summary.json data to update the campaign project board
  • Issues/PRs (workers) on the board serve as the real-time status view
  • The orchestrator workflow uses the update-project safe output to sync status fields
  • Worker workflow files remain unchanged while the board reflects current execution state

This approach keeps workers tracked by the campaign while preserving worker file integrity by design.

@mnkiefer
Copy link
Contributor

@copilot: For each worker, pull that data based on the last time you pulled and align with whats already on the board, etc.

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 18, 2025

@copilot: For each worker, pull that data based on the last time you pulled and align with whats already on the board, etc.

Added incremental update guidance in commit 8e37ae0.

The help text now includes instructions for:

  • Pulling data based on last pull time: Use --start-date flag (e.g., --start-date -1d for daily incremental updates)
  • Aligning with board state: Compare run data from summary.json with existing board status to update only changed workers, preserving board state

This enables efficient incremental synchronization between worker logs and the campaign project board.

@mnkiefer mnkiefer merged commit 6f33929 into main Dec 18, 2025
41 checks passed
@mnkiefer mnkiefer deleted the copilot/clarify-worker-workflow-logging branch December 18, 2025 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants