Skip to content

fix(skills): require ttlMs and cacheScope on modern resources/directory/read results - #2747

Merged
olaservo merged 1 commit into
v2/mainfrom
v2/fix/2740-directory-read-cacheable
Oct 20, 2026
Merged

olaservo merged 1 commit into
v2/mainfrom
v2/fix/2740-directory-read-cacheable

Conversation

@olaservo

Copy link
Copy Markdown
Member

Closes #2740

The stable ext-skills spec (ext-skills#157) makes ReadResourceDirectoryResult a CacheableResult, so a modern (2026-07-28+) result must carry ttlMs and cacheScope, as skills/list and skills/get already do. The Inspector parsed both eras with one permissive schema and reported a modern server omitting them as clean; the test server's fixture sent resultType alone and was itself non-conformant on the modern leg.

  • core/mcp/skillsSchemas.ts: add ModernDirectoryReadResultSchema and replace the "no modern variant" note with the new citation.
  • core/mcp/inspectorClient.ts: readResourceDirectory picks the schema from the negotiated era, as listSkills and getSkillResult do. The result is returned whole, so the CLI's --method resources/directory/read output gains the two fields on modern connections.
  • test-servers/src/skills.ts: readDirectoryPage and DirectoryReadResultShape send and type the full modern envelope.
  • Tests mirror the Modern skills/get results must carry ttlMs and cacheScope (ext-skills stable spec) #2404 coverage for skills/get: schema unit cases, client era cases, and an integration case on both eras.
  • docs/test-servers.md and the roadmap no longer describe the old asymmetry.

Not a UI change, so no screenshots.

🤖 Generated with Claude Code

…ry/read results (#2740)

The stable ext-skills spec (ext-skills#157) makes ReadResourceDirectoryResult a CacheableResult, so a modern (2026-07-28+) result must carry ttlMs and cacheScope, as skills/list and skills/get already do. The Inspector parsed both eras with one permissive schema and reported a modern server omitting them as clean; the test server's fixture sent resultType alone and was itself non-conformant on the modern leg.

- core/mcp/skillsSchemas.ts: add ModernDirectoryReadResultSchema and replace the "no modern variant" note with the new citation.
- core/mcp/inspectorClient.ts: readResourceDirectory picks the schema from the negotiated era, as listSkills and getSkillResult do.
- test-servers/src/skills.ts: readDirectoryPage and DirectoryReadResultShape send and type the full modern envelope.
- Tests mirror the #2404 coverage for skills/get: schema unit cases, client era cases, and an integration case on both eras.
- docs: test-servers.md and the roadmap no longer describe the old asymmetry.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: olaservo <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused changes satisfy the specified requirements, preserve legacy behavior, and include regression coverage with no identified blocking issues.

No open issues 🎉

What changed in this PR

Aligns Inspector’s modern directory-read validation with the stable ext-skills specification while preserving legacy compatibility.

Changes:

  • Requires ttlMs and cacheScope on modern resources/directory/read results.
  • Updates fixtures and adds schema, client, and integration coverage.
  • Revises documentation to reflect the caching requirements.
File Description
test-servers/​src/​skills.ts Supplies the full modern result envelope.
docs/​test-servers.md Documents updated fixture behavior.
docs/​inspector-roadmap-2026-h2.md Includes directory reads in cache-hint planning.
core/​mcp/​skillsSchemas.ts Adds the modern directory-read schema.
core/​mcp/​inspectorClient.ts Selects validation by negotiated protocol era.
clients/​web/​src/​test/​integration/​mcp/​inspectorClient-skills.test.ts Checks cache attributes over real transports.
clients/​web/​src/​test/​core/​mcp/​skillsSchemas.test.ts Tests required fields and invalid values.
clients/​web/​src/​test/​core/​mcp/​inspectorClient-skills.test.ts Tests era-specific validation and field preservation.

Review effort: Balanced

@olaservo

Copy link
Copy Markdown
Member Author

Copilot review loop closed after round 1: the round posted with approval recommended, no inline comments, no headline finding and no suppressed comments, so nothing to answer and no further round requested.

@olaservo
olaservo merged commit fefe074 into v2/main Oct 20, 2026
11 checks passed
@olaservo
olaservo deleted the v2/fix/2740-directory-read-cacheable branch October 20, 2026 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Issues and PRs for v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Modern resources/directory/read results must carry ttlMs and cacheScope (ext-skills stable spec)

2 participants