Repository navigation
Pack identical APM skill bundle across all reusable workflows - #136
Merged
Merged
Conversation
Every APM-importing reusable workflow in this repo currently caches its
skill bundle under the constant key `apm-copilot-` when called from
elastic/docs-content. The cache key formula
`apm-${engine}-${hashFiles('.github/workflows/*.lock.yml')}` is evaluated
in the caller's workspace, which has no lock files — so the hash segment
is empty for every workflow.
While only docs-review used APM this was benign. Once the sweeps landed
(#123-#125), every additional workflow with a different `packages:` list
started overwriting the same cache slot. The next workflow to run hit
the previous one's bundle and got `Skill not found` for the skills it
actually imports — with the agent ultimately falling back to manual
analysis ("All skills are unavailable. I'll review the changes using my
own judgment now.").
Workaround: align every APM-importing workflow's `packages:` to the
union of all skills used across the repo, so all five workflows pack
the same bundle and cache collisions are no-ops. Adds a small per-run
download cost (each workflow pulls all seven skills, uses one or two)
but restores correctness.
Filed upstream as github/gh-aw#30365 — when fixed there, we can revert
each workflow's `packages:` back to its minimum set.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
theletterf
force-pushed
the
fab/share-apm-skill-bundle
branch
from
May 5, 2026 14:14
59aa16b to
5ac7385
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Workaround for github/gh-aw#30365: every APM-importing reusable workflow in this repo currently caches its skill bundle under the same key
apm-copilot-when called fromelastic/docs-content, so they overwrite each other's caches.Why
The cache key formula in the lock files is:
That
hashFiles(...)is evaluated in the caller's workspace (elastic/docs-content), which has no.lock.ymlfiles — those live here. Hash segment evaluates to empty, so every APM-importing workflow ends up with the same key:apm-copilot-.While
docs-reviewwas the only APM-importing workflow, this was benign — same producer/consumer, same bundle. After the sweep workflows landed (#123–#125), every additional workflow with a differentpackages:list started clobbering the cache. The next workflow to run hit the previous bundle and emittedSkill not found— see the May 5 docs-review run https://github.com/elastic/docs-content/actions/runs/25379248158:Confirmed the regression is purely additive: an Apr 27 run on the same
apm-copilot-key (when onlydocs-reviewexisted) loaded all five skills cleanly.Fix
Align every APM-importing workflow's
packages:to the union of all skills used across the repo (7 packages). All five workflows now pack the same bundle, so cache collisions are no-ops.Trade: each workflow downloads the full 7-skill bundle even when it only invokes one. Skills are tiny — negligible cost — and we get correctness back until upstream lands the proper fix (cache key should hash the inlined
AW_APM_PACKAGESinstead of caller-side lock files).Filed upstream: github/gh-aw#30365. When that ships, revert this PR — each workflow goes back to its minimum
packages:list.Test plan
make compile→ 0 errors, 0 warnings.AW_APM_PACKAGESJSON literal (verified withgrep AW_APM_PACKAGES).apm-copilot-entry inelastic/docs-content(gh cache delete --repo elastic/docs-content apm-copilot-) and trigger one workflow at a time, checking the agent log for✓ skill(...)(real success) and absence ofSkill not foundandAll skills are unavailable.🤖 Generated with Claude Code