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
- Run
agenticworkflows logs --workflow_name "smoke-pi" --count 3 --max_tokens 3000
- Inspect the returned
runs array
- Run ID
27385890627 (created 2026-06-12T00:15:57Z) has ~22 keys
- 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 · ◷
Problem Description
The
logstool 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 tonull.Tool
logsagenticworkflows logs --workflow_name "smoke-pi" --count 3 --max_tokens 3000Steps to Reproduce
agenticworkflows logs --workflow_name "smoke-pi" --count 3 --max_tokens 3000runsarray27385890627(created2026-06-12T00:15:57Z) has ~22 keys27448590215,27451267852) have ~30 keysExpected Behavior
All runs returned by
logsshould have a consistent set of top-level fields. Missing fields should be explicitly set tonull(or an appropriate zero value) rather than being absent from the JSON object. This allows consumers to safely accessrun["engine"]without risking aKeyError.Actual Behavior
Run
27385890627is missing:engine,engine_id,actor,agent,organization,ref,repository,run_attempt,sha,event_name.Older run keys (22):
Newer run keys (30):
Side Effects
summary.engine_countsreports{"pi": 2}for 3 returned runs — the older run is not counted becauseengine_idis absent, creating a misleading discrepancy betweentotal_runsand the sum ofengine_counts.run["engine"]directly will crash withKeyError.Environment
Impact
logsquery that returns runs from before the log schema was extended.get("engine", "")with a default value when accessing run metadata fieldsSuggested Fix
Normalize the run metadata object during log loading/parsing to ensure all expected fields are always present (as
nullor appropriate zero value). This normalization should happen in the log parser/enricher before returning results from the MCP tool.References: §27459182079