GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — mcpx: surface ttlMs/cacheScope in mcpclient and expire pool catalogue cache (#1602) by dezren39 · Pull Request #1608 · developing-today/code

Conversation

@dezren39

@dezren39 dezren39 commented Oct 28, 2026 •
edited by blacksmith-sh Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Implements #1602 — Phase 1 of #1601, per triage task 1689 verdict (#1602 (comment)). Queue task 1704.

mcpclient

  • ttlMs/cacheScope decoded on all four list result types; resourceTemplatesListResult.NextCursor fixed to *string.
  • New CacheHints{TTLMs, HasTTL, Private} (min TTL across pages that declared one; private-if-any) and ListToolsWithHints / ListResourcesWithHints / ListPromptsWithHints; existing List* methods are unchanged wrappers.
  • ListResources now pages resources/templates/list, so templates beyond page 1 surface (test names this).

pool

  • Deadline + private scope stored beside schemaAt: earliest deadline among lists actually fetched in a refresh; absent/0/negative TTL = immediately stale; modern era only — legacy keeps a zero deadline and behaves exactly as before.
  • Schemas() falls through to refresh when expired; explicit refresh mutex + generation double-check collapses concurrent expired reads into one refresh (counting test).
  • SetSchemas untouched (Phase 2 / mcpx: Phase 2 of #1601 — cacheScope at the disk boundary: private never persists, expired seeds expired, stale on refetch error #1603 owns that plumbing); seeded caches keep no deadline.

Tests / register

  • New: mcpclient/cachehints_test.go (page aggregation, templates page 2, absent-vs-zero), pool/cachettl_test.go (ttl 0/negative/absent stale, positive fresh + expires, private stored, concurrent collapse, legacy never expires) using eramcp env knobs (ERAMCP_TTL_MS, ERAMCP_CACHE_SCOPE, ERAMCP_LIST_DELAY).
  • The five caching-* gaps in coverage_stateful.go are retired as C(...) entries naming these tests.

Verification is CI (go test ./... for pkgs/mcpx) per repo policy — no local builds were run.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@dezren39
mcpx: surface ttlMs/cacheScope in mcpclient and expire pool catalogue…
80f8fee
… cache (#1602)

Phase 1 of #1601. mcpclient gains CacheHints plus ListToolsWithHints/ListResourcesWithHints/ListPromptsWithHints (existing List* kept as wrappers), ttlMs/cacheScope on all four list result types, resourceTemplatesListResult.NextCursor becomes *string, and ListResources pages resources/templates/list so page-2 templates surface. Pool stores deadline+scope beside schemaAt (earliest deadline among lists actually fetched; modern only - legacy keeps zero deadline), Schemas() falls through to refresh when expired, and an explicit refresh mutex with generation double-check collapses concurrent expired reads into one refresh. SetSchemas unchanged (Phase 2 / #1603). Five caching-* conformance gaps retired as C entries naming the new tests; eramcp gains ERAMCP_TTL_MS/ERAMCP_CACHE_SCOPE/ERAMCP_LIST_DELAY for the pool tests.
@dezren39
dezren39 requested a review from a team as a code owner October 28, 2026 06:00
@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 5 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 79bd778f-2e39-4a00-9a8f-3d8c1f3f44d4
Commits

Reviewing files that changed from the base of the PR and between ed8e591 and ff81c52.

Files selected for processing: 7
  • pkgs/mcpx/docs/spec/conformance-matrix.md
  • pkgs/mcpx/internal/conformance/coverage_stateful.go
  • pkgs/mcpx/internal/mcpclient/cachehints_test.go
  • pkgs/mcpx/internal/mcpclient/client.go
  • pkgs/mcpx/internal/pool/cachettl_test.go
  • pkgs/mcpx/internal/pool/pool.go
  • pkgs/mcpx/internal/testsupport/eramcp/main.go
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
  • X
  • Mastodon
  • Reddit
  • LinkedIn

Comment @coderabbitai help to get the list of available commands.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

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-10-28T10:24:45.022284Z ff81c52 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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chatgpt-codex-connector[bot]
chatgpt-codex-connector Bot reviewed Oct 28, 2026
View reviewed changes

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 80f8fee81d

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pkgs/mcpx/internal/mcpclient/client.go
Comment on lines +198 to +202
if ttlMs != nil {
if !h.HasTTL || *ttlMs < h.TTLMs {
h.TTLMs = *ttlMs
}
h.HasTTL = true

@chatgpt-codex-connector chatgpt-codex-connector Bot Oct 28, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

P2 Badge Account for absent TTLs when aggregating list pages

When one page declares a positive TTL but another omits ttlMs, merge ignores the absent hint and retains the positive TTL. The pool consequently treats the entire combined catalogue as fresh, including the response that should be immediately stale. This also affects resources/list and resources/templates/list, which share an aggregate: a positive resource TTL can make templates without a TTL cacheable. Track absent hints across successful responses and make the effective aggregate TTL zero if any response omitted it, while retaining absence information separately if needed.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pkgs/mcpx/internal/pool/pool.go
if minTTL < 0 {
minTTL = 0
}
deadline = fetchedAt.Add(time.Duration(minTTL) * time.Millisecond)

@chatgpt-codex-connector chatgpt-codex-connector Bot Oct 28, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

P2 Badge Anchor cache expiry to each response's receipt time

When a modern upstream supplies a short tools TTL and subsequent resource or prompt listing is slow, adding the minimum TTL to fetchedAt extends freshness beyond the declared interval because fetchedAt is sampled only after all sequential calls finish. For example, tools with a 100 ms TTL followed by a two-second resources listing remain reusable for another 100 ms despite having expired during the refresh. Compute deadlines from each response's receipt time and take the earliest absolute deadline instead of adding the minimum duration to the refresh completion time.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pkgs/mcpx/internal/pool/pool.go
// expired cache collapse into a single refresh. A nil staleGen is an
// explicit refresh and always re-lists.
func (p *Pool) refreshSchemas(ctx context.Context, staleGen *time.Time) ([]mcpclient.Tool, []mcpclient.Resource, error) {
p.refreshMu.Lock()

@chatgpt-codex-connector chatgpt-codex-connector Bot Oct 28, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

P2 Badge Honor context cancellation while waiting for a refresh

When another catalogue refresh is running, this mutex wait cannot observe the waiting caller's cancellation or deadline. For example, Server.WarmAsync refreshes using an independent background timeout, so a concurrent request through handleRefresh or upstreamResourceURI can remain blocked until that background refresh finishes even after its own context expires. Previously, each caller reached the context-aware acquisition and RPC paths directly. Use a cancellable refresh gate or shared-result wait that selects on ctx.Done() so one slow upstream refresh cannot hold canceled requests open.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@dezren39 dezren39 mentioned this pull request Oct 28, 2026
mcpx: Phase 1 of #1601 — surface ttlMs/cacheScope in mcpclient and expire the pool catalogue cache (modern era) #1602
Closed
@github-actions github-actions Bot assigned dezren39 Oct 28, 2026
This was referenced Oct 28, 2026
mcpx: Phase 2 of #1601 — cacheScope at the disk boundary: private never persists, expired seeds expired, stale on refetch error #1603
Closed
mcpx: Phase 3 of #1601 — register truth-up, list_changed invalidation test, and nix#200 evidence #1604
Closed
@dezren39
fix(mcpx): qualify caching C() refs @2026-07-28 and regenerate confor…
9a0904c
…mance matrix (#1602)
@dezren39 dezren39 mentioned this pull request Oct 28, 2026
design(mcpx): honour upstream ttlMs and cacheScope — the pool catalogue cache gets a freshness deadline and a scope #1601
Closed
@dezren39
Merge remote-tracking branch 'origin/main' into queue/1704-1602-mcpx-ttl
ff81c52
# Conflicts:
#	pkgs/mcpx/docs/spec/conformance-matrix.md
#	pkgs/mcpx/internal/conformance/coverage_stateful.go
chatgpt-codex-connector[bot]
chatgpt-codex-connector Bot reviewed Oct 28, 2026
View reviewed changes

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ff81c5255b

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pkgs/mcpx/internal/pool/pool.go
Comment on lines +828 to 831
if !p.schemaAt.IsZero() && (p.schemaDeadline.IsZero() || time.Now().Before(p.schemaDeadline)) {
t, r, e := p.tools, p.resources, p.schemaErr
p.schemaMu.RUnlock()
return t, r, e

@chatgpt-codex-connector chatgpt-codex-connector Bot Oct 28, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

P2 Badge Apply expiry to the daemon's tool catalogue read paths

When a modern upstream's TTL expires after a live refresh, normal tool listings still serve the expired catalogue indefinitely because they never reach this check. Registry.Tools reads CachedSchemas directly (internal/daemon/registry.go:441), Namespaces marks any nonzero schemaAt as cached, and CLI ensureSchemas refreshes only when that cached flag is false. Warm(false) also skips those entries. Repository-wide search shows the only production call to Pool.Schemas is in resource-URI resolution (internal/daemon/routes_proto.go:1004). Wire tool catalogue reads through freshness-aware access, or expose expiry to their refresh decision, so the new TTL handling affects actual tool discovery.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@dezren39
dezren39 merged commit ab2ce7a into main Oct 28, 2026
17 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@dezren39
dezren39 deleted the queue/1704-1602-mcpx-ttl branch October 28, 2026 11:26
This was referenced Oct 28, 2026
fleet: laptop SSH unreachable since 2026-10-28 ~11:16Z — all laptop-worktree queue work blocked (MaxStartups pattern or laptop offline) #1667
Closed
design(mcpx): elicitation broker hygiene — owner-only store, bounded retention, redacted events, review-first answering #1675
Closed
feat(mcpx): enforce cacheScope at the disk boundary #1705
Merged
mcpx: Phase 3 of #1601 — list_changed invalidation test, register truth-up (#1604) #2181
Merged
mcpx client: cannot reach a conformant 2026-07-28 server dezren39/darwin-nix#200
Closed
@dezren39
dezren39 restored the queue/1704-1602-mcpx-ttl branch November 1, 2026 07:51
@dezren39
dezren39 deleted the queue/1704-1602-mcpx-ttl branch November 1, 2026 16:44
@dezren39 dezren39 mentioned this pull request Nov 3, 2026
Preserved branch: queue/1704-1602-mcpx-ttl — decision needed (merge / cherry-pick / drop) #3616
Closed
This was referenced Nov 12, 2026
docs(roadmap): program-tending drift fix (landed forward items) #9022
Merged
docs(roadmap): program-tending drift fix (landed forward items) #9601
Closed
@dezren39 dezren39 mentioned this pull request Nov 21, 2026
Closure audit: every closed issue/PR verified; unmerged branches + unpushed worktrees inventoried #7079
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@chatgpt-codex-connector chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@dezren39 dezren39

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@dezren39
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.