fix(skills,sessions): strip frontmatter from injected skills, preserve skills across compaction#339
Merged
Merged
Conversation
Update version to 0.7.3 and add release notes for the manifest path normalization fix (#336).
…l content (#324) Skill files include metadata like version numbers in their YAML frontmatter. When injected raw into the LLM context, the model can mistake skill metadata (e.g., version: "0.8.2") for its own runtime version. Strip frontmatter using SkillScanner.ExtractBody so the LLM only sees the markdown body with behavioral guidance.
Previously, compaction cleared _autoLoadedSkills and _autoLoadedSkillContent, causing the bot to lose all skill context. Skills would only re-load if the next user message happened to score above the keyword threshold again — generic follow-up messages like "ok" or "what were we talking about" would not re-trigger them, causing apparent amnesia. Skills loaded during a session remain relevant after compaction. Keep the cache so they continue to be injected on subsequent turns. New skills can still be added via keyword matching on future messages.
2 tasks
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
Two fixes for skill auto-loading quality:
Strip YAML frontmatter before injection (feature: capability grounding — LLM must not claim actions it didn't verifiably execute #324) — skill files include metadata like
version: "0.8.2"in frontmatter. The LLM was mistaking this for its own runtime version. Now only the markdown body is injected viaSkillScanner.ExtractBody.Preserve auto-loaded skills across compaction (bug: skills cleared after compaction without guaranteed re-loading — causes amnesia #315) — compaction was clearing
_autoLoadedSkillsand_autoLoadedSkillContent, causing the bot to lose all skill context. Skills only re-loaded if the next user message scored above the keyword threshold. Generic follow-ups like "ok" would not re-trigger them, causing apparent amnesia.Closes #324, closes #315
Test plan
dotnet build— cleanturn_skill_auto_loadlogs)