feat: identify skill loads in _meta.codex.skill - #390
Closed
nikita-ashihmin wants to merge 1 commit into
Closed
Conversation
Codex has no skill tool: it loads a skill by reading that skill's SKILL.md, so a load was indistinguishable from any other file read and clients rendered it as one. Index the skills Codex reports from `skills/list` by the path of their SKILL.md, and when a read command action hits one, name the skill in `_meta.codex.skill` and point at the file with `_meta.codex.skillPath`. Resolving through Codex's own registry rather than the shape of the path keeps the name authoritative: a skill whose directory differs from its registered name is still named correctly, and skills outside a `skills` directory are still recognized. The lookup is optional, so history replay — which has no live registry — leaves such reads as ordinary file reads rather than guessing.
Collaborator
Author
|
Closing: this belongs on the client side instead. A skill load is recognizable from the read itself — the |
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.
Problem
Codex has no skill tool. It loads a skill by reading that skill's
SKILL.md, which reaches the client as an ordinaryreadcommand action — so a skill load is indistinguishable from any other file read, and clients render it asRead file '/…/skills/commits/SKILL.md'.A client can guess from the path's shape (
<…>/skills/<name>/SKILL.md), but that guess is wrong whenever a skill's directory name differs from its registered name, and it misses skills that don't live under askillsdirectory at all.Change
skills/listalready returns each skill'snameand absolutepath, andrefreshSkillsalready calls it — the response was just discarded. This indexes it bySKILL.mdpath, and when areadcommand action hits a known skill file, the tool call carries:{ "_meta": { "codex": { "skill": "commits", "skillPath": "/…/.agents/skills/commits/SKILL.md" } } }The title also becomes
Read skill 'commits'instead of the raw path, andlocationsstill points at the file so existing navigation keeps working.Because the name comes from Codex's own registry rather than from the path, it stays authoritative in both cases above.
The lookup is threaded in as an optional parameter, so history replay — which has no live registry — leaves such reads as ordinary file reads instead of guessing. No existing snapshot changes.
Client side
This mirrors
_meta.claudeCode.skill/skillPathin claude-agent-acp. JetBrains AIR consumes both to render a skill load as its own block, with the skill name linking toSKILL.md.Testing
npm run typecheckcleannpm test— 404 pass, 28 skipped, no snapshot churncommand-action-events.test.ts(known skill file → named load; unknown file → plain read; no registry → plain read) and one inCodexAcpClient.test.ts(skills/listpopulates the index, unrelated paths miss)