Conversation
- Modified generateCacheMemorySteps to only upload artifacts when threat detection is enabled - Added if: always() condition to artifact upload when threat detection is enabled - Updated tests to reflect new behavior: no artifacts when detection disabled - All cache-related tests now pass Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Implement cache update logic for disabled detection
Skip cache-memory artifact upload when threat detection is disabled
Dec 8, 2025
pelikhan
reviewed
Dec 8, 2025
Comment on lines
-434
to
-438
| - name: Upload cache-memory data as artifact | ||
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5 | ||
| with: | ||
| name: cache-memory | ||
| path: /tmp/gh-aw/cache-memory |
Contributor
There was a problem hiding this comment.
@copilot Upload cache-memory as artifact should be done after executing the agent steps
Contributor
Author
There was a problem hiding this comment.
Fixed in ccf3443. The cache-memory artifact upload now happens after agent execution steps (specifically after "Upload Agent Stdio").
The implementation splits the cache setup into two phases:
- Cache restore/directory creation (early, before agent execution)
- Artifact upload (after agent execution completes)
This ensures artifacts are uploaded after the agent has finished modifying the cache.
- Split generateCacheMemorySteps into setup and artifact upload functions - Cache restore/setup happens early (before agent execution) - Artifact upload now happens after agent execution (after Upload Agent Stdio) - This ensures artifacts are uploaded after the agent has finished modifying the cache Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
Skip cache-memory artifact upload when threat detection is disabled
Handle cache updates when detection is disabled and move artifact upload after agent execution
Dec 8, 2025
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 threat detection is disabled, cache-memory artifacts are unnecessary since
actions/cacheauto-saves via post-action. Artifacts are only needed for the threat detection flow whereupdate_cache_memoryjob requires them after validation.Additionally, when threat detection is enabled, the artifact upload now happens after agent execution steps to ensure the cache is uploaded after the agent has finished modifying it.
Changes
Modified artifact upload logic by splitting
generateCacheMemorySteps()into two functions:generateCacheMemorySteps(): Handles cache directory creation and restore (called early)generateCacheMemoryArtifactUpload(): Handles artifact upload (called after agent execution)threatDetectionEnabledis trueif: always()to artifact upload when threat detection is enabledUpdated test expectations across cache-memory test files to reflect new behavior
Repositioned artifact upload to occur after agent execution steps (specifically after "Upload Agent Stdio")
Behavior
Threat detection disabled:
actions/cache(auto-saves on post-action)update_cache_memoryjobThreat detection enabled:
actions/cache/restore(restore-only) during setupif: always()after agent execution completesupdate_cache_memoryjob to save after detection succeedsOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.