Return merged cache hints from list_all_* client methods

Đang mở
#1,411 1 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

@gocamille đang làm issue này rồi.

Từ ngày 29/10/2026.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

enhancement P2 ready for work T-service

The Peer::list_all_* methods (tools, prompts, resources, resource templates, skills) follow the cursor across pages and return only the items. On 2026-07-28 each page carries ttlMs and cacheScope, and the merged list drops them, so a client that uses list_all_* cannot cache the result correctly.

Proposal: also expose a cache hint for the merged list.

  • ttlMs: the earliest expiry across pages. Each page's hint is relative to when that page arrived, so take the minimum of requestTime + ttlMs and convert it back to a TTL relative to the end of the walk.
  • cacheScope: public only if every page is public, otherwise private.
  • A page without hints (legacy peers, or a server that omits them) makes the merged hint absent.

Changing the return type of the existing methods would be a breaking change, so this would add new API next to them, for example a ListAll<T> { items, ttl_ms, cache_scope } returned by new methods, or a single generic helper.

Suggested by @tsarlandie-oai in https://github.com/modelcontextprotocol/rust-sdk/pull/1392#discussion_r4416288583.

Ngôn ngữ chính
Rust
Star
4.1k
Fork
694
Merge trung bình
3 ngày 14 giờ
Pull request đã merge (30 ngày)
39

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của modelcontextprotocol/rust-sdk

Tất cả issue của modelcontextprotocol/rust-sdk

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.