fix: eliminate cache-memory dependency in update-instructions workflow#8739
fix: eliminate cache-memory dependency in update-instructions workflow#8739vhvb1989 wants to merge 3 commits 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.
RickWinter
left a comment
There was a problem hiding this comment.
This replaces the cache-memory high-water mark with a query against the workflow's own successful-run history, which is the right direction and drops a fragile weekly-eviction dependency. The one thing blocking it is that the new step 2 relies on listing workflow runs, and the github tool only enables the pull_requests, issues, and repos toolsets. Listing workflow runs lives in the actions toolset, so the added actions: read permission has no tool to drive it, and step 2 will silently fall through to the 6 month scan (step 3) on every run, which is the exact redundant mining this PR is trying to remove. Enabling the actions toolset on the github: tool should close that gap. The updated_at of the last successful run is a reasonable starting point; there is a small window where PRs merged while the previous run was executing could be reprocessed, but for a weekly instruction-mining job that is harmless. Please address the toolset before merge.
jongio
left a comment
There was a problem hiding this comment.
Two things need fixing:
-
Missing actions toolset: toolsets: [pull_requests, issues, repos] doesn't include actions. The workflow-run listing API lives in that toolset, so step 2 will silently fail and the agent will always fall through to the 6-month scan. Add actions to the array.
-
Lock file stale: The .lock.yml still reflects old cache-memory logic. Run gh aw compile to regenerate.
The github MCP toolsets only had [pull_requests, issues, repos] but Step 1 requires listing workflow runs to find the last successful run date. Without the actions toolset, the agent would always fall through to the 6-month scan. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Recompile the lock file to reflect the cache-memory removal and actions toolset addition. Also upgrades gh-aw infrastructure from v0.79.8 to v0.81.6 with updated container images and SHA-pinned digests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Both issues from my previous review are addressed:
actionstoolset added to thetoolsetsarray in the .md source, and correctly reflected in the lock.yml (GITHUB_TOOLSETSnow includesactions).- Lock file regenerated with gh-aw v0.81.6.
No new issues in the incremental changes.
Automated review dismissed: verdict was submitted incorrectly by automated tooling.
|
/check-enforcer override |
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."