fix: strip skill XML from session auto-naming - #457
Open
isWittHere wants to merge 1 commit into
Open
Conversation
A new session whose first message is a /skill: invocation stores the SDK-expanded <skill> block as the message, so the no-name fallback (firstMessage.slice(0, 50)) leaked that XML into the sidebar title and the rename input. Collapse such blocks to the compact /skill:name args command via the existing skillExpansionToCommand helper before slicing, mirroring MessageView's rendering. The rename input seeds from the same collapsed form, so an untouched rename of a skill-invoked session stays a no-op instead of persisting the raw XML as the session name.
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.
Fix
A new session whose first message is a

/skill:invocation stores theSDK-expanded
<skill>block as the message, so the no-name fallback(
firstMessage.slice(0, 50)) leaked raw XML into the sidebar sessiontitle and the rename input.
Behavior
/skill:name argsinstead of the expanded<skill>XML block.rename stays a no-op instead of persisting the raw XML as the session
name.
Implementation
skillExpansionToCommandhelper inlib/slash-display.ts(the same one MessageView uses) before the50-char slice.
components/SessionSidebar.tsx(title + renameinitial value), ~15 lines.
lib/slash-display.test.mjs.Testing
node_modules/.bin/tsc --noEmit— passnpx eslint components/SessionSidebar.tsx lib/slash-display.test.mjs— passnode --experimental-strip-types --test lib/slash-display.test.mjs— 7/7 pass