From 479d5b6b1593ce29c57531dd3d919fd51ce6208c Mon Sep 17 00:00:00 2001 From: Victor Vazquez Date: Sat, 20 Jun 2026 00:37:21 +0000 Subject: [PATCH] fix: eliminate cache-memory dependency in update-instructions workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the cache-memory tool (used to store last-run.txt) with a GitHub API query for the last successful workflow run. This fixes the false-positive cache-miss failure on first run, where the agent correctly reported missing_data/cache_memory_miss but gh-aw's detection layer interpreted it as a prompt misconfiguration. The workflow run history is the natural, always-available source of truth for "when did this last succeed" — no external state to seed, evict, or misread. This also avoids the 7-day cache eviction risk that could cause repeated first-run behavior on a weekly schedule. Fixes #8702 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../update-instructions-from-pr-reviews.md | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/.github/workflows/update-instructions-from-pr-reviews.md b/.github/workflows/update-instructions-from-pr-reviews.md index 0fd36fd2f27..921546da66e 100644 --- a/.github/workflows/update-instructions-from-pr-reviews.md +++ b/.github/workflows/update-instructions-from-pr-reviews.md @@ -54,6 +54,7 @@ permissions: copilot-requests: write pull-requests: read issues: read + actions: read engine: copilot @@ -64,9 +65,6 @@ tools: toolsets: [pull_requests, issues, repos] # Lets the agent read and edit the local .github/ customization files. edit: - # Remembers the last successful run date so "since last run" works with no - # external state. The agent reads/writes a small marker here each run. - cache-memory: safe-outputs: create-pull-request: @@ -154,11 +152,13 @@ Decide which merged PRs to examine, in this order of preference: 1. If the **Since** run parameter above is a real date (not `not set`), mine PRs merged on/after that date. -2. Otherwise, read the **cache memory** for a marker file named - `last-run.txt`. If it exists, mine PRs merged after that timestamp ("since - last run"). -3. Otherwise (first ever run, no marker), mine PRs merged within the last 6 - months, capped at the **Max PRs** run parameter. +2. Otherwise, use the GitHub tools to list recent workflow runs for **this + workflow** (`Update Instructions From PR Reviews`) in the repository this + workflow runs in. Find the most recent **successful** (completed with + `conclusion: success`) run and use its `updated_at` timestamp as the + starting point — mine PRs merged after that date. +3. Otherwise (no previous successful run found), mine PRs merged within the + last 6 months, capped at the **Max PRs** run parameter. The **Source repository** run parameter above already resolves to the repository this workflow runs in when no override was supplied, so mine PRs from whatever @@ -280,11 +280,6 @@ link to the pushed branch, so the proposed edits are never lost and Copilot can open the PR from there. You don't need to do anything special — write the body the same way; it's reused for the fallback issue. -## 8. Record the run - -Write the current date (the high-water mark of mined PRs) to `last-run.txt` in -**cache memory** so the next scheduled run only processes newer PRs. - ## Guardrails - Never commit or push directly — all changes flow through the safe output.