Skip to content

[q] fix: remove run_id from trending cache key to enable cross-run cache restoration #28386

@github-actions

Description

@github-actions

Root Cause

The cache-memory key in shared/trending-charts-simple.md included $\{\{ github.run_id }}:

key: trending-data-$\{\{ env.GH_AW_WORKFLOW_ID_SANITIZED }}-$\{\{ github.run_id }}

Because run_id is unique per run, every daily run wrote to a different cache key and could never restore from the previous run's cache. The result: history.jsonl always contained exactly 1 entry (today's data only), regardless of how many days the workflow had been running.

Evidence from live run logs: all 5 recent api-consumption-report runs had exactly 1 data point in history.jsonl, and the discussion report itself noted "This is the first day of tracking, establishing a baseline" on every run.

Changes

shared/trending-charts-simple.md

  • Removed -$\{\{ github.run_id }} suffix from the cache key
  • The stable key trending-data-$\{\{ env.GH_AW_WORKFLOW_ID_SANITIZED }} now allows each run to restore the cache written by the previous run

api-consumption-report.md

  • Added an explicit cache-validation step at the start of Step 3 so the agent logs whether the cache was restored (detects first-run vs cache-hit)
  • Added Cache restored from previous run field to the discussion's Cache Memory Status section

Expected Behaviour After Fix

  • First run: creates history.jsonl with 1 entry, saves to cache
  • Second run: restores cache (1 entry), appends today's entry → 2 entries
  • Nth run: accumulates up to 90 days of history, enabling trend charts with real data

Validation

api-consumption-report.md compiled successfully (no errors).


Warning

Protected Files — Push Permission Denied

This was originally intended as a pull request, but the patch modifies protected files. A human must create the pull request manually.

Protected files

The push was rejected because GitHub Actions does not have workflows permission to push these changes, and is never allowed to make such changes, or other authorization being used does not have this permission.

Create the pull request manually
# Download the patch from the workflow run
gh run download 24920151268 -n agent -D /tmp/agent-24920151268

# Create a new branch
git checkout -b fix/trending-cache-key-round-robin-8f771b4bbf882807 main

# Apply the patch (--3way handles cross-repo patches)
git am --3way /tmp/agent-24920151268/aw-fix-trending-cache-key-round-robin.patch

# Push the branch and create the pull request
git push origin fix/trending-cache-key-round-robin-8f771b4bbf882807
gh pr create --title '[q] fix: remove run_id from trending cache key to enable cross-run cache restoration' --base main --head fix/trending-cache-key-round-robin-8f771b4bbf882807 --repo github/gh-aw

🎩 Equipped by Q · ● 2.2M ·

  • expires on Apr 27, 2026, 2:20 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