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.
Account for actions/cache branch scoping in cache-miss misconfiguration detection #39386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Account for actions/cache branch scoping in cache-miss misconfiguration detection #39386
Changes from 3 commits
904bdeded45819f6307e558127658cf9bfcf56ada42798a11dae0142File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cache_memory_missitems now flow into the generic missing-data section when cache was not restored — can triggermissingDataReportAsFailurefailure verdicts on expected first-run misses.💡 Explanation
In the old code,
cache_memory_misswas always stripped fromdisplayableMissingDatawhenevercacheMemoryEnabled && hasCacheMiss, regardless of restore status. The specialist template was then unconditionally shown.In the new code, when
cacheMemoryRestored=false,shouldShowCacheWarningisfalse, sodisplayableMissingDataincludes thecache_memory_missitem unfiltered. It flows into the"Missing Data Reported"block at line 1046 and is visible to the downstreammissingDataReportAsFailureguard.This means that if an operator has
missingDataReportAsFailure=true, a completely normal first-run or branch-scoped cache miss (expected behavior) now causes a failure-level verdict inhandle_agent_failure, which would have been a no-op before this PR.The PR description notes this is intentional ("kept in generic missing-data context"), but the downstream failure guard was not updated to exclude
cache_memory_missfrommissingDataReportAsFailureevaluation when!cacheMemoryRestored. A targeted fix:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[/diagnose] ✅ Positive highlight: the new
else ifbranch correctly logs why misconfiguration detection was skipped. This is exactly the right operator-facing signal — without it, a skipped detection would be invisible in the run logs.One small follow-up worth considering: the log message references "actions/cache branch scoping and first-run behavior" — consistent with the PR description. Consider also logging the specific number of
cache_memory_missitems (matching the style of thehasCacheMissMisconfigurationtrue-path log above) so operators can see the suppressed count if they need to audit:�� Optional log improvement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[/tdd] The "returns empty string" test covers
(false, false)and(true, false)but omits(true, true)— cache enabled AND restored, but no missing-data items. Adding this case explicitly documents and protects the early-return path for the most operationally-relevant argument combination.💡 One-line addition
This is the case that occurs every normal run where cache-memory is healthy and the agent produced no missing-data signals.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test now only covers
(true, false)for the "no output file" case —(true, true)is untested.💡 Details
The test was updated from
buildMissingDataContext(true)tobuildMissingDataContext(true, false), but the corresponding(true, true)variant (cache enabled AND restored, file absent) was not added. The early-return on emptymissingDataMessagesis not exercised whencacheMemoryRestored=true, so a regression that conditionally skips the early return in that branch would go undetected.Suggested addition:
This is low-risk but cheap to add alongside the existing cases.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.