Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 20, 2025

Noop Stats Implementation - Complete ✅

Summary

Successfully implemented noop message parsing for the logs and audit commands. The implementation follows the same pattern as the existing missing-tool feature.

Recent Updates

Fixed missing JobDetails fields (commit: addressing code review feedback)

  • Added JobDetails to ProcessedRun initialization from DownloadResult
  • Added JobDetails to DownloadResult initialization from cached summary
  • Ensures job details are properly propagated through data structures

Implementation Complete

  • Add NoopReport struct similar to MissingToolReport in pkg/cli/logs.go
  • Add NoopCount field to WorkflowRun struct
  • Add Noops field to RunSummary, ProcessedRun, DownloadResult structs
  • Create extractNoopsFromRun function in pkg/cli/logs_metrics.go
  • Update logs command to call extractNoopsFromRun and populate data
  • Add "Noops" column to overview table headers and rows
  • Update total row calculation to include noops
  • Add tests for noop extraction (logs_noop_test.go)
  • Update audit command to include noop messages in report
  • Add noops to audit report JSON output (AuditData struct)
  • Fix missing JobDetails field propagation (code review feedback)
  • All tests passing ✅
  • Code formatted and linted ✅

Testing Status

All tests pass

  • Unit tests: make test-unit
  • Noop extraction tests: TestExtractNoopsFromRun
  • Missing tool tests: TestExtractMissingToolsFromRun ✅ (compatibility check)
  • Logs/Audit tests: All passing ✅
  • Build succeeds: make build
  • Lint passes: make lint
  • Format validated: make fmt

Changes Made

Files Modified:

  • pkg/cli/logs.go - Added NoopReport struct, NoopCount field, Noops column, fixed JobDetails propagation
  • pkg/cli/logs_metrics.go - Added extractNoopsFromRun function
  • pkg/cli/audit.go - Added noop extraction and reporting
  • pkg/cli/audit_report.go - Added noops to AuditData struct

Files Created:

  • pkg/cli/logs_noop_test.go - Comprehensive tests for noop extraction

How It Works

  1. The extractNoopsFromRun function reads the agent_output.json artifact file
  2. It parses items with type === "noop" from the structured JSON
  3. Each noop message is stored with its timestamp and workflow metadata
  4. The logs command displays noop count in the overview table
  5. The audit command includes noop messages in the report
  6. JSON output from both commands includes complete noop data

Example Output

Logs Overview Table:

Run ID | Workflow | Status | Duration | Tokens | Cost ($) | Turns | Errors | Warnings | Missing | Noops | Created    | Logs Path
-------|----------|--------|----------|--------|----------|-------|--------|----------|---------|-------|------------|----------
123456 | test     | success| 2m30s    | 1.5k   | 0.003    | 3     | 0      | 0        | 0       | 2     | 2024-01-15 | ./logs/...

Audit Report (Markdown):

## No-Op Messages

### Message 1

This workflow is running in read-only mode. No changes will be made.

**Timestamp**: 2024-01-15T12:00:00Z

### Message 2

Analysis complete. See report above.

**Timestamp**: 2024-01-15T12:05:00Z

JSON Output:

{
  "noops": [
    {
      "message": "This workflow is running in read-only mode. No changes will be made.",
      "timestamp": "2024-01-15T12:00:00Z",
      "workflow_name": "test-workflow",
      "run_id": 123456
    },
    {
      "message": "Analysis complete. See report above.",
      "timestamp": "2024-01-15T12:05:00Z",
      "workflow_name": "test-workflow",
      "run_id": 123456
    }
  ]
}

Implementation Notes

  • Follows the exact same pattern as extractMissingToolsFromRun
  • Supports both file and directory forms of agent_output.json
  • Handles malformed JSON gracefully
  • Includes verbose mode with message previews
  • Properly tracks workflow metadata (workflow name, run ID)
  • Compatible with existing caching system (RunSummary)
  • Job details now properly propagated through all data structures
Original prompt

Update "logs" command (and the code that downloads the workflows) to parse the "noop" message and add a column with noop stats. The JSON result of logs/audit should contain parsed noop messages, similar to the missing-tools output type messages.


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

- Add NoopReport struct to track noop messages
- Add NoopCount field to WorkflowRun struct
- Add Noops field to ProcessedRun and RunSummary
- Create extractNoopsFromRun function in logs_metrics.go
- Update logs command to extract and display noop stats
- Add "Noops" column to logs overview table
- Update audit command to include noop messages
- Add tests for noop extraction (logs_noop_test.go)

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Update logs command to parse noop messages Add noop message parsing to logs and audit commands Nov 20, 2025
Copilot AI requested a review from pelikhan November 20, 2025 19:43
Copilot finished work on behalf of pelikhan November 20, 2025 19:43
@pelikhan pelikhan marked this pull request as ready for review November 20, 2025 20:23
Copilot AI review requested due to automatic review settings November 20, 2025 20:23
Copilot finished reviewing on behalf of pelikhan November 20, 2025 20:27
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds noop message parsing to the logs and audit commands. Noop messages are transparency indicators logged when safe-outputs are configured but produce no GitHub API actions (e.g., running in read-only or staged mode).

Key changes:

  • Adds NoopReport struct and NoopCount field to track noop messages across workflow runs
  • Implements extractNoopsFromRun() function following the same pattern as extractMissingToolsFromRun()
  • Enhances logs overview table with a "Noops" column showing per-run and total counts
  • Adds "No-Op Messages" section to audit reports displaying full message text and timestamps

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pkg/cli/logs_noop_test.go Comprehensive unit tests for noop extraction including edge cases (malformed JSON, multiple noops, empty output)
pkg/cli/logs_metrics.go New extractNoopsFromRun() function that parses noop entries from agent_output.json artifact files
pkg/cli/logs.go Adds NoopReport struct, NoopCount field to WorkflowRun, integrates noop data into ProcessedRun, RunSummary, and DownloadResult, and updates logs overview table with "Noops" column
pkg/cli/audit_report.go Adds Noops field to AuditData struct and populates it from processed run data
pkg/cli/audit.go Extracts noops during audit workflow run processing and includes them in ProcessedRun and RunSummary

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

FirewallAnalysis: result.FirewallAnalysis,
MissingTools: result.MissingTools,
Noops: result.Noops,
MCPFailures: result.MCPFailures,
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ProcessedRun struct is missing the JobDetails field in its initialization. The JobDetails field exists in the struct (line 71) and is populated in result.JobDetails from cached summaries (line 900), but when constructing a ProcessedRun from a fresh download result, the field is not being assigned.

This should be:

processedRun := ProcessedRun{
	Run:              run,
	AccessAnalysis:   result.AccessAnalysis,
	FirewallAnalysis: result.FirewallAnalysis,
	MissingTools:     result.MissingTools,
	Noops:            result.Noops,
	MCPFailures:      result.MCPFailures,
	JobDetails:       result.JobDetails,
}

Note: This is a pre-existing bug not introduced by this PR, but should be fixed for completeness.

Suggested change
MCPFailures: result.MCPFailures,
MCPFailures: result.MCPFailures,
JobDetails: result.JobDetails,

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in commit 3db46d7. Added JobDetails field to ProcessedRun initialization.

FirewallAnalysis: summary.FirewallAnalysis,
MissingTools: summary.MissingTools,
Noops: summary.Noops,
MCPFailures: summary.MCPFailures,
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The JobDetails field is missing from the DownloadResult initialization when loading from cached summary. The RunSummary struct contains JobDetails (see line 140), but it's not being transferred to the result here.

This should include:

result := DownloadResult{
	Run:              summary.Run,
	Metrics:          summary.Metrics,
	AccessAnalysis:   summary.AccessAnalysis,
	FirewallAnalysis: summary.FirewallAnalysis,
	MissingTools:     summary.MissingTools,
	Noops:            summary.Noops,
	MCPFailures:      summary.MCPFailures,
	JobDetails:       summary.JobDetails,
	LogsPath:         runOutputDir,
}

Note: This is a pre-existing bug not introduced by this PR, but should be fixed for completeness.

Suggested change
MCPFailures: summary.MCPFailures,
MCPFailures: summary.MCPFailures,
JobDetails: summary.JobDetails,

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in commit 3db46d7. Added JobDetails field to DownloadResult initialization when loading from cached summary.

@pelikhan
Copy link
Contributor

@copilot lint

…alizations

Address code review feedback by adding missing JobDetails field to:
- ProcessedRun initialization from DownloadResult (line 718)
- DownloadResult initialization from cached summary (line 899)

This ensures job details are properly propagated through the data structures.

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

Copilot AI commented Nov 20, 2025

@copilot lint

Lint completed successfully. All validations passed ✅

Copilot AI requested a review from pelikhan November 20, 2025 20:41
Copilot finished work on behalf of pelikhan November 20, 2025 20:41
@pelikhan
Copy link
Contributor

@copilot fix JavaScript tests

Copy link
Contributor Author

Copilot AI commented Nov 20, 2025

@copilot fix JavaScript tests

JavaScript tests are already passing ✅

All 1067 tests in 58 test files pass successfully:

  • make test-js completes without errors
  • make test-unit passes all Go unit tests
  • make agent-finish completes full validation successfully

No fixes needed - the test suite is healthy.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/user
    • Triggering command: /usr/bin/gh gh api user --jq .login (http block)

If you need me to access, download, or install something from one of these locations, you can either:

@pelikhan pelikhan merged commit 2e2e420 into main Nov 20, 2025
60 of 63 checks passed
@pelikhan pelikhan deleted the copilot/update-logs-command-noop branch November 20, 2025 21:27
github-actions bot added a commit that referenced this pull request Nov 21, 2025
Updated documentation based on merged pull requests from the last 24 hours.

Features documented:
- --progress flag for run command (PR #4450)
- Noop message parsing in logs/audit commands (PR #4428)
- close-discussion safe output type (PR #4411)
- debug-agentic-workflow custom agent (PR #4449)
- Audit command suggestion in run output (PR #4445)

Changes:
- Updated docs/setup/cli.md to document --progress flag and noop parsing
- Updated docs/reference/safe-outputs.md to add close-discussion safe output
- Updated docs/reference/custom-agents.md to mention debug-agentic-workflow

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
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