ci(cache-impact): watch desktop session prompt swap and environment probes#6079
Merged
SivanCola merged 1 commit intoJul 6, 2026
Merged
Conversation
…robes The cache-impact gate watched only internal/ prompt surfaces, but two cache-sensitive surfaces lived outside it: - desktop/session_prompt.go rewrites the persisted leading system message with the freshly composed prompt on every tab resume/rebind; any byte difference there invalidates the whole conversation's prefix cache and persists the rewrite. - internal/environment/* composes the environment section embedded in the cached system prefix; probe output changes shift the prefix bytes for every session. Add both to the cache-sensitive list and to the system-prompt-sensitive list so changes require Cache-impact/Cache-guard lines and an explicit System-prompt-review note.
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
The cache-impact gate watched only
internal/prompt surfaces, leaving two cache-sensitive surfaces unguarded:desktop/session_prompt.go— rewrites the persisted leading system message with the freshly composed prompt on every tab resume/rebind (sessionWithFreshSystemPrompt). Any byte difference there invalidates the whole conversation's prefix cache and persists the rewrite; it is exactly the class of change this gate exists for, and today a PR touching it sails through with no Cache-impact note.internal/environment/*— composes the environment probe section embedded in the cached system prefix (boot.goprompt assembly). Probe output changes shift prefix bytes for every session on upgrade.Both are added to the cache-sensitive list (requires
Cache-impact:/Cache-guard:lines) and to the system-prompt-sensitive list (requires an explicitSystem-prompt-review:note), since both shape the provider-visible system prompt.Verification
bash -n scripts/check-cache-impact.shdesktop/session_prompt.gowithout the lines → fails listing the file; with lines butSystem-prompt-review: N/A→ fails demanding a named review; with a named review → passes listing both files;desktop/tabs.goalone → "No cache-sensitive prompt/tool files changed" (no new noise for general desktop PRs).Cache impact
Cache-impact: none - CI gate configuration only; no runtime behavior change.
Cache-guard: scenario runs above exercise the new watchlist entries in both pass and fail directions.
System-prompt-review: N/A
Context: follow-up from the desktop-vs-CLI cost triage (#2945) — the desktop resume prompt-swap path was identified as an unguarded prefix-cache invalidation surface.