Skip to content

fix(server): omit cache hints for legacy peers - #1465

Closed
DaleSeo wants to merge 2 commits into
mainfrom
DaleSeo/legacy-cache-hints
Closed

DaleSeo wants to merge 2 commits into
mainfrom
DaleSeo/legacy-cache-hints

Conversation

@DaleSeo

@DaleSeo DaleSeo commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Motivation and Context

The 2026-07-28 branch fills missing hints, but the older branch had no counterpart that removes explicit ones. This affects every cacheable result, not just skills.

How Has This Been Tested?

Added tests

Breaking Changes

None.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

@github-actions github-actions Bot added T-test Testing related changes T-core Core library changes T-handler Handler implementation changes labels Nov 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

@michaelneale is on triage rotation this week and is the reviewer for this one.

Labels come from the PR labeler. Please review the change.

Automated triage. Labels are a first pass and the assigned maintainer has the final say.

@DaleSeo
DaleSeo marked this pull request as ready for review November 16, 2026 20:09
@DaleSeo
DaleSeo requested a review from a team as a code owner November 16, 2026 20:09
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T15:04:43.755723Z 3e8ff9e New commits
🔒 Security Review ✅ Completed 2026-11-17T15:06:29.552585Z 3e8ff9e New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@DaleSeo DaleSeo self-assigned this Nov 16, 2026

@jokemanfire jokemanfire left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Verified at e6e719f.

What I ran

  • cargo test -p rmcp --all-features --test test_result_type_wire: 13 passed, including the new strip_removes_cache_hints_from_paginated_result.
  • cargo test -p rmcp --no-default-features --features "client,server,macros,schemars,skills-fs,base64" --test test_skills: 16 passed. This is the run that matters — test_skills.rs is #![cfg(not(feature = "local"))], so with --all-features it reports 0 tests. Both new cases pass: list_skills_should_omit_cache_hints_for_legacy_peers and list_skills_should_keep_cache_hints_the_handler_set_for_2026_07_28.

Code read

  • The strip is wired into the single post-processing point in handle_request (handler/server.rs:320-324), so every result that leaves a server handler — including router-generated tools/list, prompts/list, resources/list, resources/templates/list, resources/read — passes through it. There is no second response path that skips it.
  • strip_cache_hints_for_legacy_peer covers exactly the seven result variants that fill_missing_cache_hints touches (model.rs:5197-5215). I checked for ttl_ms/cache_scope holders elsewhere in model.rs: only the paginated result macro and ReadResourceResult, both already in the list, so no cacheable type is missed.
  • Stripping is placed before strip_non_object_output_for_legacy_peer, and the 2026-07-28 branch is untouched.

Asks

  1. The PR body is the OAuth text from #1467 ("accept an authorization server on the resource's own origin…"). It never mentions cache hints, so the squash message and review history will describe the wrong change. Please rewrite it: what shape a legacy peer used to receive, why ttlMs/cacheScope are post-2026-07-28 fields, and the wire evidence.
  2. Nit, not a blocker: fill_missing_cache_hints only acts on results whose resultType is absent or complete (model.rs:5217-5221), while the new strip is unconditional. A handler that sets hints on a non-complete result now has them removed and keeps its custom resultType. Either mirror the completeness guard or say in the doc comment that the strip is deliberately unconditional; right now the two functions read as if they should be symmetric.

I did not find a functional defect. Commenting rather than approving while the body still describes a different change.

@DaleSeo DaleSeo closed this Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-core Core library changes T-handler Handler implementation changes T-test Testing related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants