Description
I noticed that the logfire remote MCP server tools/list API returns the response in a slightly different order about 6% of the time.
I don't know how the schema is being serialized, but my guess is that whatever you're using for a hashmap is not a stable, ordered map.
This matters because Claude Code, GitHub Copilot, Codex etc. give a 90% discount to cached input tokens, but the logfire schema changes every few calls which invalidates a ~2,000 token chunk of the cache (and costs more money).
Python, Logfire & OS Versions, related packages (not required)
Description
I noticed that the logfire remote MCP server tools/list API returns the response in a slightly different order about 6% of the time.
I don't know how the schema is being serialized, but my guess is that whatever you're using for a hashmap is not a stable, ordered map.
This matters because Claude Code, GitHub Copilot, Codex etc. give a 90% discount to cached input tokens, but the logfire schema changes every few calls which invalidates a ~2,000 token chunk of the cache (and costs more money).
Python, Logfire & OS Versions, related packages (not required)