fix(prompt_size): search volatile tier for skills block after the stable->volatile move

CI-caught: compute_prompt_breakdown still looked for <available_skills> in the stable tier, but #37117 moved it to volatile. Search volatile first, fall back to stable for older sessions.
This commit is contained in:
kshitij
2026-08-03 23:19:42 +05:30
committed by kshitij
parent 9555525a7d
commit efbfe0842f

View File

@@ -252,8 +252,9 @@ def compute_prompt_breakdown(platform: str = "cli") -> Dict[str, Any]:
volatile = parts.get("volatile", "")
# Skills index — the <available_skills> block (the largest single block
# when many skills are installed). Measured inside the stable tier.
skills_match = _SKILLS_BLOCK_RE.search(stable)
# when many skills are installed). Lives in the volatile tier (moved from
# stable so skill edits don't invalidate the cached identity prefix).
skills_match = _SKILLS_BLOCK_RE.search(volatile) or _SKILLS_BLOCK_RE.search(stable)
skills_index = skills_match.group(0) if skills_match else ""
# Memory + user profile live in the volatile tier. We re-derive their