Skip to content

ci(cache-impact): watch desktop session prompt swap and environment probes#6079

Merged
SivanCola merged 1 commit into
esengine:main-v2from
SivanCola:ci/cache-impact-desktop-watchlist
Jul 6, 2026
Merged

ci(cache-impact): watch desktop session prompt swap and environment probes#6079
SivanCola merged 1 commit into
esengine:main-v2from
SivanCola:ci/cache-impact-desktop-watchlist

Conversation

@SivanCola

Copy link
Copy Markdown
Collaborator

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.go prompt 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 explicit System-prompt-review: note), since both shape the provider-visible system prompt.

Verification

  • bash -n scripts/check-cache-impact.sh
  • Scenario runs: desktop/session_prompt.go without the lines → fails listing the file; with lines but System-prompt-review: N/A → fails demanding a named review; with a named review → passes listing both files; desktop/tabs.go alone → "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.

…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.
@SivanCola SivanCola requested a review from esengine as a code owner July 6, 2026 07:33
@github-actions github-actions Bot added the v2 Go rewrite (1.x) — main-v2 branch, active development label Jul 6, 2026
@SivanCola SivanCola merged commit 790d06c into esengine:main-v2 Jul 6, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant