Repository navigation
Conversation
sniwas
force-pushed
the
fix/prioritize-stableid-unicode
branch
from
November 25, 2026 10:49
0a0e33a to
c8bc3ef
Compare
…ollide stableId() stripped every character outside [a-z0-9] before hashing, so a title written entirely in Cyrillic, CJK, Greek, Arabic, etc. hashed the empty string and every such recommendation in a category got the same id. validate() then dropped all but the first as duplicates, and dismissing one dismissed them all. Keep Unicode letters and digits (NFC-normalised) in the hash input. Ids of ASCII-only titles are unchanged, so existing dismissals keep working. Fixes danielmiessler#2920
sniwas
force-pushed
the
fix/prioritize-stableid-unicode
branch
from
November 26, 2026 06:56
c8bc3ef to
be9326e
Compare
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.
What was wrong
stableId()inskills/Prioritize/Tools/Prioritize.tsnormalised the title with.replace(/[^a-z0-9]+/g, " "), which deletes every non-ASCII letter. A title written only in Cyrillic, CJK, Greek, Arabic, etc. became the empty string, so every such recommendation in a category got the id<category>-e3b0c44298.validatethen dropped all but the first as duplicates, and dismissing one dismissed them all (#2920).What changed
One line: the hash input now keeps Unicode letters and digits (
title.normalize("NFC").toLowerCase().replace(/[^\p{L}\p{N}]+/gu, " ")), as suggested in the issue. The id itself stays ASCII (category + hex hash), so it still matchesID_RE.Compatibility: for ASCII-only titles the hash input is identical, so their ids and existing dismissals are unchanged. Titles that mix Latin with accented letters (e.g. "café") now hash the accented letter too, so those particular ids change once.
How it was checked
The repo has no test runner for skills, so I checked with a throwaway Node 26 script (not part of this diff) that imports
Prioritize.tsand callsstableId:stableId("work", "Купить датчик воздуха"),stableId("work", "Позвонить врачу")andstableId("work", "購入する")all returnedwork-e3b0c44298, and the distinctness assertion failed.work-25cc1f2099,work-36735b3e44,work-b702838d52), all matching/^[a-z0-9-]{6,64}$/.stableId("work", "Fix the roof leak!")=work-51055a1850,stableId("capture", "Call Dr. Smith @ 9am -- re: MRI (2nd)")=capture-d1bfcc7babon both revisions.Not run: the full Prioritize skill end to end (no inference backend here), and nothing under Bun.
Fixes #2920