Skip to content

fix(skill): read the installed-skill entry list on any platform - #803

Merged
Ishaan Gangwani (ishaan1124) merged 2 commits into
synthetic-sciences:mainfrom
aniruddhaadak80:fix/skill-entry-flag-windows
Sep 29, 2026
Merged

Ishaan Gangwani (ishaan1124) merged 2 commits into
synthetic-sciences:mainfrom
aniruddhaadak80:fix/skill-entry-flag-windows

Conversation

@aniruddhaadak80

@aniruddhaadak80 ANIRUDDHA ADAK (aniruddhaadak80) commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #802.

What

Which installed skills count as user-facing commands is decided by splitting the scanned path on /:

// SKILL_GLOB matches <installedDir>/<ns>/skills/<name>/SKILL.md.
const rel = match.slice(installedDir.length + 1)
const segments = rel.split("/")
const ns = segments[0]
const skillName = segments[2]
const entrySet = entriesByNs.get(ns)
if (entrySet) { ... skill.entry = entrySet.has(skillName) || entrySet.has(skill.name) }

Bun.Glob.scan returns native separators. Measured on this machine:

Bun.Glob("**/SKILL.md").scan({ cwd: "<installedDir>", absolute: true, onlyFiles: true })
  -> ["C:\...\installed-skills\myns\skills\myname\SKILL.md"]

rel              = "myns\skills\myname\SKILL.md"
rel.split("/")   -> ["myns\skills\myname\SKILL.md"]   // one element
segments[0]      =  the whole relative path            // never matches a namespace
segments[2]      =  undefined

entriesByNs.get(ns) misses, the if (entrySet) body never runs, and skill.entry stays undefined.

Why it matters

Info.entry is documented as "Defaults to true. Driven by openscience-skills.json entries[] for URL-installed skills", and its consumer is frontend/workspace/src/atlas/skill-permissions.ts:67:

if (skill.entry === false || names.has(skill.name)) return false

undefined is not false — so on Windows every skill from a URL install is treated as an entry and offered in / autocomplete and the Skills library, including the internal helpers the manifest deliberately marked as not-entries. The identical install behaves correctly on a POSIX host.

bundle-format.ts:46 in the same subsystem already normalises with path.relative(...).replaceAll("\\", "/"), so this is an internal inconsistency rather than a platform impossibility.

Verification

The new test writes a real namespace under Global.Path.data/installed-skills — one skill listed in the manifest, one omitted — and asserts both halves of the contract.

Before the fix, on this Windows machine:

Expected: true
Received: undefined
(fail) the install manifest marks a listed skill as an entry and an unlisted one as not
 0 pass  1 fail

After:

(pass) the install manifest marks a listed skill as an entry and an unlisted one as not
 1 pass  0 fail

The change

         // SKILL_GLOB matches <installedDir>/<ns>/skills/<name>/SKILL.md.
-        const rel = match.slice(installedDir.length + 1)
-        const segments = rel.split("/")
+        // The glob yields native separators, so a hardcoded "/" reads one
+        // segment holding the whole relative path and the namespace misses.
+        const segments = path.relative(installedDir, match).split(path.sep)

path.relative also drops the manual slice prefix arithmetic, so the two can no longer disagree about the base directory.

bun run typecheck clean; touched files are Prettier-clean (checked on LF-normalized copies — this checkout has core.autocrlf=true, which makes Prettier flag every file in the repo).

Pre-existing failures in this area

test/skill/ has substantial pre-existing failures in this Windows checkout — 38 pass / 25 fail on main, 41 pass / 22 fail with this change, and the counts vary run to run because several of those tests are order- and timing-sensitive. The new test is green in both configurations; this change does not touch the paths those cases exercise.

Fixes #800

@vercel

vercel Bot commented Sep 28, 2026

Copy link
Copy Markdown

ANIRUDDHA ADAK (@aniruddhaadak80) is attempting to deploy a commit to the InkVell Team on Vercel.

A member of the Team first needs to authorize it.

The namespace and skill name were taken by splitting the relative path on /, but Bun.Glob yields native separators, so on Windows that is one segment holding the whole path. The namespace lookup missed, the entry flag was never applied, and every installed skill was surfaced as a command.
@ishaan1124
Ishaan Gangwani (ishaan1124) merged commit b561ab8 into synthetic-sciences:main Sep 29, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants