Skip to content

[cli-tools-test] audit: engine_config is null and token_usage/turns missing when aw_info.json artifact is absent #27504

@github-actions

Description

@github-actions

Problem Description

The audit tool returns engine_config: null, metrics.token_usage: null, and metrics.turns: null for certain workflow runs, even when agent_usage.json (which contains token counts) is available. This makes it impossible to understand what engine was used, how many tokens were consumed, or how many turns occurred.

Affected Runs

Confirmed affected: runs 24613802341, 24639023957, 24586650969 — all "Agentic Workflow Audit Agent" workflow runs.

Root Cause

The audit tool relies on aw_info.json to populate engine_config and structured token/turn metrics. When aw_info.json is missing, no fallback to agent_usage.json is attempted.

The agent_usage.json is present for these runs and contains usable token data:

{"input_tokens":5944,"output_tokens":8698,"cache_read_tokens":1170605,"cache_write_tokens":86049,"effective_tokens":243846}

But the audit output shows:

{
  "engine_config": null,
  "metrics": {
    "token_usage": null,
    "turns": null,
    "effective_tokens": 243845,
    "action_minutes": 6,
    "error_count": 0
  }
}

Note that effective_tokens (243845) is correctly populated from agent_usage.json, but token_usage and turns are null. The engine_config is entirely null.

Steps to Reproduce

# Audit a run that is missing aw_info.json
agenticworkflows audit --run_id_or_url 24613802341

Expected: engine_config populated from available artifacts, token_usage populated from agent_usage.json.
Actual: engine_config: null, token_usage: null, turns: null.

Also confirmed via logs command: filtering by --workflow_name audit-workflows returns runs with engine_id: None, token_usage: None, and turns: None.

Expected Behavior

When aw_info.json is absent, the audit tool should:

  1. Fall back to agent_usage.json to populate metrics.token_usage (sum of input+output tokens)
  2. Fall back to parsing agent-stdio.log or other available artifacts for turns
  3. Either report engine_config: null explicitly with a note, or attempt to infer engine from mcp-logs/agenticworkflows.log

Actual Behavior

engine_config: null, token_usage: null, turns: null — despite agent_usage.json being present with full token data.

Environment

  • Repository: github/gh-aw
  • Run ID: 24705633805 (this test run)
  • Date: 2026-04-21
  • gh-aw version: 1.0.21

Impact

  • Severity: Medium
  • Frequency: Affects all runs where aw_info.json is not generated (older workflow versions)
  • Workaround: Read agent_usage.json directly from the downloaded logs path

Logs/Diagnostics

Confirmed via ls /tmp/gh-aw/aw-mcp/logs/run-24613802341/:

agent-stdio.log  agent_output.json  agent_usage.json  github_rate_limits.jsonl
mcp-logs/  prompt.txt  run_summary.json  workflow-logs/

aw_info.json is absent. agent_usage.json contains token counts.

Generated by Daily CLI Tools Exploratory Tester · ● 2.1M ·

  • expires on Apr 28, 2026, 5:37 AM UTC

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions