Skip to content

fix(skills): require ttlMs and cacheScope on modern skills/get results - #2469

Merged
cliffhall merged 1 commit into
v2/mainfrom
v2/fix/2404-skills-get-cacheable
Sep 24, 2026
Merged

cliffhall merged 1 commit into
v2/mainfrom
v2/fix/2404-skills-get-cacheable

Conversation

@cliffhall

Copy link
Copy Markdown
Member

Closes #2404

What

The stable ext-skills spec settles the question SEP-2640 left open: GetSkillResult extends CacheableResult, so ttlMs and cacheScope are REQUIRED on skills/get, as they are on resources/read. Before this change the Inspector accepted a modern skills/get result without them, so a non-conforming server was reported as clean.

Changes

  • core/mcp/skillsSchemas.ts adds ModernGetSkillEnvelopeSchema: the { skill } envelope plus ttlMs (non-negative integer) and cacheScope (public | private). These are the same field shapes as ModernListSkillsResultSchema. The legacy GetSkillEnvelopeSchema stays permissive. I rewrote the "left open" / "not era-aware, settled" comments, including the module-level note on why only resources/directory/read has no modern variant.
  • core/mcp/inspectorClient.ts: getSkillResult now picks its schema from the negotiated era, the same way listSkills does. The SDK codec checks and lifts resultType (Inspector never declares the skills extension in its client capabilities #2373) but never checks the caching attributes of a consumer-owned method, so this schema is the only thing that validates them. When a modern result is rejected, it is still attributed to its Protocol entry through the existing decode-rejection path.
  • Tests
    • Schema unit tests: legacy accepts the fields whether present or absent; modern requires both, rejects ttlMs of -1 or 0.5, rejects an unknown cacheScope, and still requires the envelope.
    • Client unit tests: a modern result without the fields is rejected; a conforming one resolves; getSkillResult returns the fields whole.
    • A new integration case runs on both eras against the skills fixture, which already stamps the fields.
  • docs/inspector-roadmap-2026-h2.md: the two notes that listed this as an open gap now describe it as closed.

The skills fixture server already sends ttlMs: 0, cacheScope: "public" on skills/get, so the modern integration leg passes unchanged.

No UI change, so no screenshots.

npm run local:gate is green.

🤖 Generated with Claude Code

#2404)

The stable ext-skills spec settles the question SEP-2640 left open:
GetSkillResult extends CacheableResult, so ttlMs and cacheScope are
REQUIRED. Add ModernGetSkillEnvelopeSchema and select it from the
negotiated era in InspectorClient.getSkillResult, mirroring skills/list.
Legacy results stay permissive. Update the "left open" comments and the
roadmap's open-gap note.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: cliffhall <cliff@futurescale.com>
@cliffhall cliffhall added the v2 Issues and PRs for v2 label Sep 24, 2026
@cliffhall
cliffhall requested a balanced review from Copilot September 24, 2026 03:28

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.

Copilot review overview

🟢 Approval recommended

The implementation matches the specification and issue requirements with comprehensive era-aware coverage.

Review effort: Balanced
Findings: None

What changed in this PR

Enforces stable ext-skills cache metadata requirements for modern skills/get responses while preserving legacy compatibility.

Changes:

  • Adds era-aware skills/get result validation.
  • Covers schema, client, and real-transport behavior.
  • Updates roadmap documentation to close the validation gap.
File Description
core/​mcp/​skillsSchemas.ts Adds the modern cacheable envelope schema.
core/​mcp/​inspectorClient.ts Selects the schema by negotiated era.
clients/​web/​src/​test/​core/​mcp/​skillsSchemas.test.ts Tests modern and legacy schema rules.
clients/​web/​src/​test/​core/​mcp/​inspectorClient-skills.test.ts Tests client validation and returned metadata.
clients/​web/​src/​test/​integration/​mcp/​inspectorClient-skills.test.ts Verifies cache fields over real transports.
docs/​inspector-roadmap-2026-h2.md Marks the validation gap as resolved.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@cliffhall

Copy link
Copy Markdown
Member Author

Copilot review loop closed: round 1 came back clean ("Findings: None", no inline comments, no suppressed block), so I'm stopping on the first clean round per pr-flow step 7c.

@cliffhall
cliffhall merged commit 014621a into v2/main Sep 24, 2026
5 checks passed
@cliffhall
cliffhall deleted the v2/fix/2404-skills-get-cacheable branch September 24, 2026 03:43
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 skills/get results must carry ttlMs and cacheScope (ext-skills stable spec)

2 participants