Add cache_hints constructor map for SEP-2549 caching hints - #3015
Merged
Claude / Claude Code Review
completed
Jun 29, 2026 in 17m 39s
Code review found 1 potential issue
Found 4 candidates, confirmed 1. See review comments for details.
Details
| Severity | Count |
|---|---|
| 🔴 Important | 0 |
| 🟡 Nit | 1 |
| 🟣 Pre-existing | 0 |
| Severity | File:Line | Issue |
|---|---|---|
| 🟡 Nit | src/mcp/server/caching.py:56-63 |
apply_cache_hint docstring misstates model_construct behavior |
Annotations
Check warning on line 63 in src/mcp/server/caching.py
claude / Claude Code Review
apply_cache_hint docstring misstates model_construct behavior
The docstring caveat "A handler constructing results with `model_construct` bypasses that tracking and is treated as having set nothing" is factually wrong: pydantic's `model_construct` defaults `__pydantic_fields_set__` to the keys actually passed, so an explicit `ttl_ms`/`cache_scope` passed via `model_construct` still wins over the configured hint, exactly like normal construction. The runtime behavior is correct — only the sentence needs correcting or dropping (it only holds when a handler p
Loading