fix(mcp): a cache hit and a round trip stop being one number #524

Closed
coilyco-ops wants to merge 1 commit from fix/a-cache-hit-is-not-a-round-trip into main
Member

closes #520

Found and filed by the other Angie seat. Their measurement is the whole argument and I did not re-derive it:

window 3h
  mcp.tools.list spans   16
  slower than 10ms        5
  community.turn         15

Eleven of sixteen never left the process. The span still reads one listing per turn — which is the original defect's signature — while the real behaviour is five round trips in three hours.

Why it matters more than a missing attribute

Kai filed #163 on exactly that count. Anyone re-running the query today gets 1:1 and concludes the cache did not work. The filer nearly concluded that themselves, and only the duration distribution changed their mind.

A number that means something different than it did last week, while reading identically, is worse than a wrong number.

The change

readyLocked reports whether it listed; the session counts both outcomes; the span carries mcp.tools.listed and mcp.tools.cached.

Their sum is the count the span reported before, so the old series is still derivable and nobody loses the graph they were watching.

The reporter is an optional interface, asserted the way spanTagger and traceRequester are, so a session with no roster contributes no attributes rather than claiming listings it never made — a test holds that in both directions.

ward exec gate green: build, policy-check, vet, test, test-skips, pre-commit.

closes #520 Found and filed by the other Angie seat. Their measurement is the whole argument and I did not re-derive it: ``` window 3h mcp.tools.list spans 16 slower than 10ms 5 community.turn 15 ``` **Eleven of sixteen never left the process.** The span still reads one listing per turn — which is the *original* defect's signature — while the real behaviour is five round trips in three hours. ## Why it matters more than a missing attribute Kai filed https://forgejo.coilysiren.me/coilyco-gaming/sirens-echo/issues/163 on exactly that count. Anyone re-running the query today gets 1:1 and concludes the cache did not work. The filer nearly concluded that themselves, and only the duration distribution changed their mind. **A number that means something different than it did last week, while reading identically, is worse than a wrong number.** ## The change `readyLocked` reports whether it listed; the session counts both outcomes; the span carries `mcp.tools.listed` and `mcp.tools.cached`. **Their sum is the count the span reported before**, so the old series is still derivable and nobody loses the graph they were watching. The reporter is an optional interface, asserted the way `spanTagger` and `traceRequester` are, so a session with no roster contributes no attributes rather than claiming listings it never made — a test holds that in both directions. `ward exec gate` green: build, policy-check, vet, test, test-skips, pre-commit.
fix(mcp): a cache hit and a round trip stop being one number
All checks were successful
ci / image-build (pull_request) Successful in 24s
ci / test (pull_request) Successful in 39s
ci / publish-echo-image (pull_request) Has been skipped
ci / publish-observed (pull_request) Has been skipped
89acd4d34a
The tools.list span wrapped the call site whether or not it went to the
network. Before the roster cache landed those were the same thing. They are
not now: eleven of sixteen listings in a three hour window never left the
process, while the span still read one listing per turn.

That is the signature of the original defect. Anyone re-running the query that
motivated it concludes the fix did not work, and the seat that found this
nearly did, with only the duration distribution changing their mind. A number
that means something different than it did last week, while reading
identically, is worse than a wrong number.

readyLocked now reports whether it listed, the session counts both outcomes,
and the span carries them as separate attributes. Their sum is the count the
span reported before, so the old series is still derivable and nobody loses
what they were watching.

The reporter is an optional interface, asserted the way every other session
capability is, so a session with no roster contributes no attributes rather
than claiming listings it never made.

Co-authored-by: Kai Siren <coilysiren@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
coilyco-ops 2026-08-13 15:11:52 +00:00
  • closed this pull request
  • requested review from coilysiren
All checks were successful
ci / image-build (pull_request) Successful in 24s
ci / test (pull_request) Successful in 39s
ci / publish-echo-image (pull_request) Has been skipped
ci / publish-observed (pull_request) Has been skipped

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
coilyco-gaming/sirens-echo!524
No description provided.