fix: eliminate cache-memory dependency in update-instructions workflow#8739
fix: eliminate cache-memory dependency in update-instructions workflow#8739vhvb1989 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the Update Instructions From PR Reviews agentic workflow definition to remove reliance on cache-memory and instead derive the “since last run” starting point from GitHub Actions workflow run history.
Changes:
- Removes the
cache-memorytool dependency and the “record the run” step (state now lives in workflow run history). - Adds
actions: readpermission and updates the range-determination logic to use the last successful run timestamp.
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>
29dfe2b to
479d5b6
Compare
📋 Prioritization NoteThanks for the contribution! The linked issue isn't in the current milestone yet. |
jongio
left a comment
There was a problem hiding this comment.
Clean fix. Replacing the cache-memory tool with a workflow-run-history query is the right call: you eliminate a 7-day eviction hazard and gain a source of truth that's always available. The fallback chain (explicit date > last successful run timestamp > 6-month cap) handles the edge cases well.
Two quick notes:
-
Lock file: the
.lock.ymlwasn't regenerated in this branch (same SHA asmain). You'll need agh aw compilepass before merge so the runtime picks up the new logic. -
Bot comment on workflow name is a false positive: the instruction says "list recent workflow runs for this workflow (
Update Instructions From PR Reviews)" and the lock.yml'sname:field is exactly that string, so the agent will resolve it correctly.
Good to go once the lock file is refreshed.
Summary
Fixes #8702
Replace the
cache-memorytool with a GitHub API query for the last successful workflow run in theupdate-instructions-from-pr-reviewsagentic workflow.Problem
On first run,
last-run.txtdidn't exist in cache. The agent correctly calledmissing_datawithcache_memory_miss(as instructed by the cache-memory system), but gh-aw's detection layer interpreted this as a prompt misconfiguration rather than a legitimate first-run condition.Fix
Eliminate the cache entirely. Instead of reading/writing
last-run.txtin cache-memory, the agent now queries the GitHub API for the most recent successful run of this workflow to determine the PR range starting point.Changes
cache-memory:tool from the workflow frontmatteractions: readpermission so the agent can list workflow runsWhy not just fix the prompt?
The cache-memory approach is inherently fragile for a weekly workflow:
Per richardpark-msft's comment: "If you can get it to just query that detail directly you can eliminate a dependency on that cache altogether."