Cache failed action resolutions per compilation run#16506
Merged
Conversation
Copilot stopped work on behalf of
pelikhan due to an error
February 18, 2026 02:23
Copilot stopped work on behalf of
pelikhan due to an error
February 18, 2026 02:23
Copilot stopped work on behalf of
pelikhan due to an error
February 18, 2026 02:23
- Add failedResolutions map to ActionResolver to track failed resolutions in current run - Check failed cache before attempting resolution to skip duplicate attempts - Mark resolution as failed when it fails to avoid retries - Add test TestActionResolverFailedResolutionCache to verify behavior Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix action pinning to avoid duplicate resolutions
Cache failed action resolutions per compilation run
Feb 18, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR optimizes action resolution by caching failures per compilation run, preventing redundant GitHub API calls for non-existent actions. When an action fails to resolve (e.g., github/gh-aw/actions/setup@v0.45.7), subsequent attempts to resolve the same action within the compilation run are skipped immediately, improving performance from ~45ms to ~10µs.
Changes:
- Added
failedResolutionsmap toActionResolverto track failures per compilation run - Modified
ResolveSHAto check the failure cache before attempting resolution and mark failures when they occur - Added comprehensive test coverage for the failed resolution caching behavior
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
pkg/workflow/action_resolver.go |
Added failedResolutions map field and logic in ResolveSHA to check/populate the failure cache |
pkg/workflow/action_resolver_test.go |
Added TestActionResolverFailedResolutionCache to verify skip behavior on subsequent failed resolution attempts |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
When action resolution fails (e.g., non-existent tag
github/gh-aw/actions/setup@v0.45.7), the resolver retries the same failing resolution on subsequent encounters during compilation, making redundant GitHub API calls that will fail identically.Changes
failedResolutions map[string]boolto track failures per compilation runTestActionResolverFailedResolutionCacheto verify skip behaviorImpact
Eliminates redundant API calls for failed resolutions:
The cache is scoped to the compilation run - failures are not persisted across compilations, only preventing duplicate attempts within a single run.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/graphql/usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw -ifaceassert -nilfunc git rev-�� --show-toplevel -tests om/testorg/testrepo.git(http block)https://api.github.com/repos/actions/ai-inference/git/ref/tags/v1/usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha atjTay5oJ -tests /home/REDACTED/.dotnet/tools/bash(http block)https://api.github.com/repos/actions/checkout/git/ref/tags/v3/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha /tmp/go-build1001111899/b145/_pkg_.a -trimpath sh -p github.com/cli/grev-parse -lang=go1.25 /opt/hostedtoolcache/go/1.25.0/xTest User -uns�� 2815-13432/test-1385094301/.github/workflows /tmp/go-build1001111899/b021/vet.cfg k/_temp/ghcca-node/node/bin/bash -c=4 -nolocalimports -importcfg /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet(http block)https://api.github.com/repos/actions/checkout/git/ref/tags/v4/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v4 --jq .object.sha g_.a /tmp/go-build1001111899/b261/vet.cfg ache/go/1.25.0/x64/pkg/tool/linux_amd64/compile(http block)/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v4 --jq .object.sha brave.md /tmp/go-build1001111899/b115/vet.cfg ache/go/1.25.0/x64/pkg/tool/linux_amd64/link(http block)/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v4 --jq .object.sha --show-toplevel x_amd64/vet /usr/bin/git(http block)https://api.github.com/repos/actions/checkout/git/ref/tags/v5/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha 1111899/b267/_pkg_.a user.email ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet(http block)/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha /tmp/go-build3783098560/b320/_pkg_.a l 0/x64/bin/node -p github.com/githurev-parse -lang=go1.25 0/x64/bin/node -o e: ${{ secrets.TOKEN }}(http block)/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha user.name om/owner/repo.git(http block)https://api.github.com/repos/actions/github-script/git/ref/tags/v8/usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha -c=4 -nolocalimports -importcfg /tmp/go-build3783098560/b334/importcfg -pack /home/REDACTED/go/pkg/mod/github.com/spf13/pflag@v1.0.10/bool.go /home/REDACTED/go/pkg/mod/github.com/spf13/pflag@v1.0.10/bool_func.go(http block)/usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha(http block)/usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha v1.0.1/lookpath.-errorsas(http block)https://api.github.com/repos/actions/setup-go/git/ref/tags/v4/usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha blog-auditor.md s/bot-detection.md s/brave.md s/breaking-changgit s/changeset.md s/chroma-issue-i--show-toplevel s/ci-coach.md s/ci�� s/claude-code-user-docs-review.md s/cli-consistency-checker.md 7744479/b293/vet.cfg(http block)https://api.github.com/repos/actions/setup-node/git/ref/tags/v4/usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha -bool -buildtags /home/REDACTED/work/_temp/ghcca-node/node/bin/git -errorsas -ifaceassert -nilfunc git ls-f�� 2815-13432/test-936919776 --others 0/x64/bin/node(http block)https://api.github.com/repos/github/gh-aw/actions/runs/1/artifacts/usr/bin/gh gh run download 1 --dir test-logs/run-1 .cfg 64/pkg/tool/linux_amd64/vet(http block)https://api.github.com/repos/github/gh-aw/actions/runs/12345/artifacts/usr/bin/gh gh run download 12345 --dir test-logs/run-12345 .cfg x_amd64/vet(http block)https://api.github.com/repos/github/gh-aw/actions/runs/12346/artifacts/usr/bin/gh gh run download 12346 --dir test-logs/run-12346 .cfg 64/pkg/tool/linux_amd64/vet(http block)https://api.github.com/repos/github/gh-aw/actions/runs/2/artifacts/usr/bin/gh gh run download 2 --dir test-logs/run-2 .cfg 64/pkg/tool/linu-buildmode=exe(http block)https://api.github.com/repos/github/gh-aw/actions/runs/3/artifacts/usr/bin/gh gh run download 3 --dir test-logs/run-3 .cfg 64/pkg/tool/linux_amd64/vet(http block)https://api.github.com/repos/github/gh-aw/actions/runs/4/artifacts/usr/bin/gh gh run download 4 --dir test-logs/run-4 .cfg 64/pkg/tool/linux_amd64/vet(http block)https://api.github.com/repos/github/gh-aw/actions/runs/5/artifacts/usr/bin/gh gh run download 5 --dir test-logs/run-5 .cfg 64/pkg/tool/linux_amd64/vet http.https://gitgit(http block)https://api.github.com/repos/github/gh-aw/actions/workflows/usr/bin/gh gh workflow list --json name,state,path(http block)/usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 100(http block)/usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 6(http block)https://api.github.com/repos/github/gh-aw/git/ref/tags/v1.0.0/usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha ty-test.md --local ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet credential.userngit(http block)https://api.github.com/repos/nonexistent/action/git/ref/tags/v999.999.999/usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha(http block)/usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha 1111899/b155/_pk--detach --local .cfg credential.userngit(http block)💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.