Skip to content

mcpx: Phase 1 of #1601 — surface ttlMs/cacheScope in mcpclient and expire the pool catalogue cache (modern era) #1602

Closed

Description

@dezren39

Phase 1 of design #1601 (mcpx client cache hints). Design doc: files/designs/code-mcpx-client-cache-hints.md in the keep-the-four-repos-healthy goal workspace.

Scope

Surface upstream ttlMs/cacheScope in the client and make the pool's catalogue cache expire for modern upstreams.

  • internal/mcpclient: add ttlMs/cacheScope to toolsListResult, resourcesListResult, resourceTemplatesListResult, promptsListResult. Fix resourceTemplatesListResult.NextCursor to *string and page resources/templates/list in ListResources (PG-02/PG-07). Add hint-returning list variants used by the pool; keep ListTools/ListResources/ListPrompts signatures as wrappers over them.
  • Hint aggregation per list: TTL = minimum ttlMs across pages; scope = private if any page says private. ListResources aggregates across both its calls (resources/list + templates/list).
  • internal/pool: store a deadline + scope beside schemaAt (earliest deadline among tools/resources/prompts). Schemas() serves the cache only while fresh for a modern-era pool and otherwise falls through to RefreshSchemas. Legacy-era pools keep a zero deadline — behaviour byte-for-byte today's (cache until list_changed / refresh / restart).
  • Retire conformance gaps caching-ttl-zero-stale, caching-ttl-positive-fresh, caching-ttl-absent-zero, caching-ttl-negative-zero, caching-stale-refetch (internal/conformance/coverage_stateful.go).

Evidence (main 33a4e67, 2026-10-28)

  • List result types carry no hint fields (internal/mcpclient/client.go ~L183, ~L204, ~L209, ~L1117); list methods return bare slices.
  • Pool.Schemas (internal/pool/pool.go ~L815) returns the cache forever once schemaAt is set.
  • Conformance gaps at internal/conformance/coverage_stateful.go:113-121 (origin mcpx client: cannot reach a conformant 2026-07-28 server dezren39/darwin-nix#200).
  • Server side already emits the hints (internal/mcpserver/server.go ~L690-740) — this phase is client-only.

Acceptance

  • Fake modern upstream tests: ttl 0 / absent / negative → next Schemas() re-lists; positive ttl → served from cache until deadline, re-listed after; per-page min-TTL wins; any-page-private marks the catalogue private.
  • Concurrent reads of an expired cache collapse into one refresh.
  • Legacy upstream catalogue behaves exactly as before (no expiry).
  • Templates beyond page 1 now appear in ListResources, with a test naming the change.
  • The five named conformance gaps are retired; go test ./... for pkgs/mcpx passes in CI.

Out of scope

Disk persistence / scope enforcement (Phase 2), register truth-up (Phase 3), resources/read caching and discover TTL (open questions on #1601).

Activity

  1. added
    kind/featureNew feature or capability request
    task/triageQueue packet kind: verify, reproduce, and route this item
    priority/normalOrdinary priority (the default)
    on Oct 28, 2026
  2. developing-today commented on Oct 28, 2026

    @developing-today
    Contributor
  3. added
    queue/queuedHas a queued task in the Supabase agent queue
    app/mcpxPackage/app: mcpx (pkgs/ or apps/ in this repo)
    effort/lLarge: multi-day or open-ended; expect staged check-ins
    on Oct 28, 2026
  4. dezren39 commented on Oct 28, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · filed

  5. dezren39 commented on Oct 28, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  6. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Oct 28, 2026
  7. 76 remaining items

  8. added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    and removed
    queue/claimedQueue worker lifecycle state
    on Oct 28, 2026
  9. dezren39 commented on Oct 28, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · parked

  10. added
    queue/claimedQueue worker lifecycle state
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Oct 28, 2026
  11. dezren39 commented on Oct 28, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  12. dezren39 commented on Oct 28, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

app/mcpxPackage/app: mcpx (pkgs/ or apps/ in this repo)effort/lLarge: multi-day or open-ended; expect staged check-inskind/featureNew feature or capability requestpriority/normalOrdinary priority (the default)source/design-architectFiled by the repo design architect jobtask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions