fix(session): hide skill template text from chat and terminal UIs#28239
Open
louiswilliams wants to merge 1 commit into
Open
fix(session): hide skill template text from chat and terminal UIs#28239louiswilliams wants to merge 1 commit into
louiswilliams wants to merge 1 commit into
Conversation
Contributor
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
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.
Issue for this PR
Closes #27686
Closes #26185
Type of change
What does this PR do?
When a skill is invoked via slash command (e.g.
/my-skill), the full contents ofSKILL.mdwere being stored as a non-synthetic text part of the user message and rendered verbatim in both the web/desktop and terminal UIs. The user typed/my-skillbut the chat displayed something they never wrote.The fix is in
SessionPrompt.command: for commands withsource === "skill", a short non-synthetic text part (/<command-name>) is prepended and all template text parts are markedsynthetic: true. Both UIs already respect thesyntheticflag — the web UI'stextPart()memo skips synthetic parts, and the terminal UI'sformatPartdoes the same. The LLM is unaffected sincebuildMessagesdoes not filter onsynthetic, so the full skill content is still delivered as context.As a side effect, this also fixes the double-loading issue described in #26185: since the skill content is now marked synthetic rather than injected as a visible user message, well-behaved models are less likely to re-invoke the
skilltool thinking the content hasn't been loaded yet.How did you verify your code works?
I tested this locally in the desktop and TUI.
Screenshots / recordings
720.Screen.Recording.2026-05-18.at.5.36.56.PM.mov
Checklist