Skip to content

fix(session): hide skill template text from chat and terminal UIs#28239

Open
louiswilliams wants to merge 1 commit into
anomalyco:devfrom
louiswilliams:fix/skill-display-desktop
Open

fix(session): hide skill template text from chat and terminal UIs#28239
louiswilliams wants to merge 1 commit into
anomalyco:devfrom
louiswilliams:fix/skill-display-desktop

Conversation

@louiswilliams
Copy link
Copy Markdown

@louiswilliams louiswilliams commented May 18, 2026

Issue for this PR

Closes #27686
Closes #26185

Type of change

  • Bug fix

What does this PR do?

When a skill is invoked via slash command (e.g. /my-skill), the full contents of SKILL.md were 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-skill but the chat displayed something they never wrote.

The fix is in SessionPrompt.command: for commands with source === "skill", a short non-synthetic text part (/<command-name>) is prepended and all template text parts are marked synthetic: true. Both UIs already respect the synthetic flag — the web UI's textPart() memo skips synthetic parts, and the terminal UI's formatPart does the same. The LLM is unaffected since buildMessages does not filter on synthetic, 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 skill tool 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

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. needs:issue labels May 18, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions github-actions Bot removed needs:issue needs:compliance This means the issue will auto-close after 2 hours. labels May 18, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant