Skip to content

chore: add agentic fraction & action minutes tracking#23074

Merged
mnkiefer merged 3 commits intomainfrom
add-cogs-stats
Mar 26, 2026
Merged

chore: add agentic fraction & action minutes tracking#23074
mnkiefer merged 3 commits intomainfrom
add-cogs-stats

Conversation

@mnkiefer
Copy link
Copy Markdown
Collaborator

@mnkiefer mnkiefer commented Mar 26, 2026

  • Better COGS (Cost of Goods Sold) visibility for agentic workflow runs and updated canonical signals/assessment kinds in the Agentic Observability Kit workflow:

    • ActionMinutes: New action_minutes field on runs and total_action_minutes on the logs summary. Makes the runner-time component of COGS visible in JSON output. Estimates are at run level, not per-job, so this slightly underestimates for multi-job workflows since Actions bills each job rounded up independently.
    • AgenticFraction: New agentic_fraction field (0.0–1.0) on BehaviorFingerprint. Measures what share of a workflow's turns are actual reasoning vs. data-gathering that could be shell scripts, etc. (Inspired by chemical engineering's conversion fraction: what proportion of input has been transformed into product). Uses write actions as the primary signal: turns producing output require reasoning, turns only fetching context are reduction candidates.
    • partially_reducible: New assessment that fires when agentic_fraction < 0.6 on non-trivial runs. Recommends moving data-fetching turns to steps: writing to /tmp/gh-aw/agent/. Selectively reduce some phases to deterministic while keeping the reasoning core agentic.
    • model_downgrade_available: New assessment that fires for simple domains (triage, maintenance, issue response) with moderate resource usage. Suggests gpt-4.1-mini or claude-haiku-4-5.

@mnkiefer mnkiefer self-assigned this Mar 26, 2026
Copilot AI review requested due to automatic review settings March 26, 2026 08:02
@mnkiefer mnkiefer changed the title chore: add agentic fraction and action minutes tracking chore: add agentic fraction & action minutes tracking Mar 26, 2026
Copy link
Copy Markdown
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

Adds COGS/efficiency visibility to the Agentic Observability Kit by tracking billable GitHub Actions minutes and introducing an “agentic fraction” signal with new optimization-oriented assessments.

Changes:

  • Add action_minutes per run and summary.total_action_minutes in logs/audit outputs.
  • Add behavior_fingerprint.agentic_fraction and new assessments: partially_reducible and model_downgrade_available.
  • Extend workflow documentation and add tests for the new signals/assessment kinds.

Reviewed changes

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

Show a summary per file
File Description
pkg/cli/logs_report.go Adds per-run and aggregate action-minutes fields to logs JSON/console output.
pkg/cli/logs_orchestrator.go Computes ActionMinutes from run duration using a ceil-to-minutes heuristic.
pkg/cli/logs_models.go Extends WorkflowRun model to store ActionMinutes.
pkg/cli/audit_report.go Adds action_minutes to audit metrics output.
pkg/cli/audit_agentic_analysis.go Adds agentic_fraction, new assessments, and agentic-fraction computation heuristic.
pkg/cli/audit_agentic_analysis_test.go Adds tests covering agentic fraction, new assessments, and kind prettification.
.github/workflows/agentic-observability-kit.md Documents new canonical signals and assessment kinds.
Comments suppressed due to low confidence (2)

pkg/cli/audit_agentic_analysis.go:372

  • computeAgenticFraction’s doc comment says it classifies “tool sequences” and that data-gathering turns use only read-oriented tools, but the implementation currently only uses Turns and SafeItemsCount and doesn’t look at tool usage at all. Update the comment to reflect the current heuristic, or pass in tool usage data and implement the described classification.
// computeAgenticFraction classifies tool sequences into reasoning vs. data-gathering
// turns and returns the ratio of reasoning turns to total turns.
// Reasoning turns are those where the agent makes decisions, writes output, or uses
// multiple tool types. Data-gathering turns use only read-oriented tools.
func computeAgenticFraction(processedRun ProcessedRun) float64 {

pkg/cli/audit_agentic_analysis.go:290

  • The comment says the model-downgrade suggestion applies to a “heavy resource profile”, but the condition is fingerprint.ResourceProfile != "lean", which includes both moderate and heavy. Either tighten the condition to == "heavy" or adjust the comment to match the actual behavior.
	// Model downgrade suggestion: the run uses a heavy resource profile but
	// the task domain is simple enough that a smaller model would likely suffice.
	if fingerprint.ResourceProfile != "lean" &&
		(domain.Name == "triage" || domain.Name == "repo_maintenance" || domain.Name == "issue_response") &&
		fingerprint.ActuationStyle != "write_heavy" {

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

@mnkiefer
Copy link
Copy Markdown
Collaborator Author

@copilot open a new pull request to apply changes based on the comments in this thread

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 26, 2026

@mnkiefer I've opened a new pull request, #23075, to work on those changes. Once the pull request is ready, I'll request review from you.

@mnkiefer mnkiefer merged commit 5423055 into main Mar 26, 2026
55 checks passed
@mnkiefer mnkiefer deleted the add-cogs-stats branch March 26, 2026 08:47
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.

3 participants