Skip to content

feat(client): return merged cache hints from list_all_* methods - #1429

Open
DaleSeo wants to merge 1 commit into
mainfrom
DaleSeo/return-merged-cache-hints-from-list_all_-client
Open

DaleSeo wants to merge 1 commit into
mainfrom
DaleSeo/return-merged-cache-hints-from-list_all_-client

Conversation

@DaleSeo

@DaleSeo DaleSeo commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Closes #1411.

Motivation and Context

list_all_* follows the cursors across pages and returns only the items, so it loses the ttlMs and cacheScope from each page (SEP-2549). That means clients using list_all_* can't cache the merged list correctly.

This PR Adds *_with_cache_hint variants of the five Peer::list_all_* methods. They return a MergedList<T> with the items plus a ttl_ms and cache_scope that cover every page.

The client response cache now reports ttlMs as the time remaining before an entry expires, rather than the server's original value. If a re-fetch fails and the cache serves a stale entry, it reports 0. Otherwise, a walk that hits the cache, which is enabled by default, could make the list seem fresher than it is. If a response doesn't include ttlMs, it stays that way, so the cache's default_ttl isn't shown as a server hint.

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

Additional context

In the next major release, list_all_* could return MergedList<T> directly, and we could remove the five _with_cache_hint methods. Since that would be a breaking change, it’s being tracked separately in #1430.

@github-actions github-actions Bot added T-core Core library changes T-service Service layer changes labels Nov 3, 2026
@github-actions
github-actions Bot requested a review from jamadeo November 3, 2026 16:18
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

@jamadeo 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 force-pushed the DaleSeo/return-merged-cache-hints-from-list_all_-client branch from 71c0612 to 94a6ae8 Compare November 3, 2026 16:33
@DaleSeo
DaleSeo marked this pull request as ready for review November 3, 2026 16:35
@DaleSeo
DaleSeo requested a review from a team as a code owner November 3, 2026 16:35
@chatgpt-codex-connector

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

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T16:37:14.545374Z 94a6ae8 Draft marked ready
🔒 Security Review ✅ Completed 2026-11-03T16:37:57.121425Z 94a6ae8 Draft marked ready
ℹ️ 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.

This branch has not been deployed

No deployments
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-service Service layer changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Return merged cache hints from list_all_* client methods

1 participant