Skip to content

[cli-tools-test] logs: Inconsistent run metadata schema — older runs missing engine, actor, organization fields #39030

@github-actions

Description

@github-actions

Problem Description

The logs tool returns runs with inconsistent metadata schemas. Newer runs include a full set of fields (engine, engine_id, actor, agent, organization, etc.), while older runs are missing these fields entirely — the key is absent from the JSON object rather than being set to null.

Tool

  • Tool: logs
  • MCP Command: agenticworkflows logs --workflow_name "smoke-pi" --count 3 --max_tokens 3000

Steps to Reproduce

  1. Run agenticworkflows logs --workflow_name "smoke-pi" --count 3 --max_tokens 3000
  2. Inspect the returned runs array
  3. Run ID 27385890627 (created 2026-06-12T00:15:57Z) has ~22 keys
  4. Newer runs (27448590215, 27451267852) have ~30 keys

Expected Behavior

All runs returned by logs should have a consistent set of top-level fields. Missing fields should be explicitly set to null (or an appropriate zero value) rather than being absent from the JSON object. This allows consumers to safely access run["engine"] without risking a KeyError.

Actual Behavior

Run 27385890627 is missing: engine, engine_id, actor, agent, organization, ref, repository, run_attempt, sha, event_name.

Older run keys (22):

action_minutes, aic, avg_time_between_turns, branch, classification, conclusion,
created_at, display_title, duration, event, github_api_calls, head_sha,
logs_path, number, run_id, started_at, status, turns, updated_at, url,
workflow_name, workflow_path

Newer run keys (30):

action_minutes, actor, agent, aic, branch, classification, conclusion, created_at,
display_title, duration, engine, engine_id, event, event_name, github_api_calls,
head_sha, logs_path, number, organization, ref, repository, run_attempt, run_id,
sha, started_at, status, updated_at, url, workflow_name, workflow_path

Side Effects

  • summary.engine_counts reports {"pi": 2} for 3 returned runs — the older run is not counted because engine_id is absent, creating a misleading discrepancy between total_runs and the sum of engine_counts.
  • Code iterating over runs and accessing run["engine"] directly will crash with KeyError.

Environment

  • Repository: github/gh-aw
  • Run ID (test session): 27459182079
  • Date: 2026-06-13
  • Affected older run date: 2026-06-12T00:15:57Z (run 27385890627)

Impact

  • Severity: Medium
  • Frequency: Affects any logs query that returns runs from before the log schema was extended
  • Workaround: Use .get("engine", "") with a default value when accessing run metadata fields

Suggested Fix

Normalize the run metadata object during log loading/parsing to ensure all expected fields are always present (as null or appropriate zero value). This normalization should happen in the log parser/enricher before returning results from the MCP tool.

References: §27459182079

Generated by 🧪 Daily CLI Tools Exploratory Tester · 1K AIC · ⌖ 27.7 AIC · ⊞ 30.5K ·

  • expires on Jun 19, 2026, 10:49 PM UTC-08:00

Metadata

Metadata

Assignees

No one assigned

    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