Repository navigation
feat(snapshot): cache and coalesce provider reads with diagnostics - #106
Merged
Merged
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 135c0f39e5
ℹ️ 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".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Every viewer currently repeats the same provider work. This implements delivery 1 of #105 with a per-node, in-memory snapshot cache keyed by provider, namespace, tool and canonical input. Identical concurrent requests share a call. The default TTL is
min(pollMs / 2, 2000)ms, with additive panel/inbox/Space overrides from 0 to 60000 ms. An explicitly declared panel owns its TTL; capability overrides apply only to enabled, undeclared reserved panels.The cache serves last-good data during one extra TTL while revalidating. Provider exceptions are not retained, and producer
{ok:false, error}replies pass through unchanged with status 200 and are not cached. LRU limits cover 256 retained entries and 4 MiB of serialized keys/values; pending unique loads and diagnostic histories are bounded separately. Console actions and mutating principal tools invalidate before execution and before returning, including late completion. Plugin-declared readOnly principal tools preserve entries. Reload detaches old provider entries and pending cache writes.Freshness metadata lives only in
X-Acon-Cache,X-Acon-Cache-Age-MsandX-Acon-Sampled-Atheaders, exposed to configured CORS origins. Producer bodies, including any producer-ownedstaleorsampledAt, remain intact. Existing cursor andchanged:falsehandling remain unchanged. System shows totals, hit/miss/stale counts and rolling provider p50/p95 by tool and panel. The timing script measures registered providers directly and was smoke-tested only against a synthetic registration.Principal snapshots use a separate namespace including authenticated principal identity. The current MCP
tools/callroute still invokes the principal action port. This adds no exposed snapshot method or tool-to-panel mapping.Validation at
68c8af73c59d9813d63e04c0c1a3838081f2654c:Related to #105. Delivery 2 (versions/known replies and adaptive/progressive polling), push transport and producer changes remain separate.