Skip to content

feat: identify skill loads in _meta.codex.skill - #390

Closed
nikita-ashihmin wants to merge 1 commit into
agentclientprotocol:mainfrom
nikita-ashihmin:codex-skill-metadata
Closed

feat: identify skill loads in _meta.codex.skill#390
nikita-ashihmin wants to merge 1 commit into
agentclientprotocol:mainfrom
nikita-ashihmin:codex-skill-metadata

Conversation

@nikita-ashihmin

Copy link
Copy Markdown
Collaborator

Problem

Codex has no skill tool. It loads a skill by reading that skill's SKILL.md, which reaches the client as an ordinary read command action — so a skill load is indistinguishable from any other file read, and clients render it as Read 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 a skills directory at all.

Change

skills/list already returns each skill's name and absolute path, and refreshSkills already calls it — the response was just discarded. This indexes it by SKILL.md path, and when a read command 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, and locations still 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/skillPath in claude-agent-acp. JetBrains AIR consumes both to render a skill load as its own block, with the skill name linking to SKILL.md.

Testing

  • npm run typecheck clean
  • npm test — 404 pass, 28 skipped, no snapshot churn
  • New: three cases in command-action-events.test.ts (known skill file → named load; unknown file → plain read; no registry → plain read) and one in CodexAcpClient.test.ts (skills/list populates the index, unrelated paths miss)

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.
@nikita-ashihmin

Copy link
Copy Markdown
Collaborator Author

Closing: this belongs on the client side instead. A skill load is recognizable from the read itself — the SKILL.md filename plus its containing directory as the skill name — so the client can do it for any agent without codex-acp carrying skill metadata. Keeping the agent-side special case only where an agent genuinely has a skill tool (Claude's Skill).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant