perf(mcp): optimize semantic note reads - #1255
Conversation
31861cc to
76f1fe6
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 76f1fe6ef3
ℹ️ 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".
76f1fe6 to
7f0ae4e
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7f0ae4ea18
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7f0ae4ea18
ℹ️ 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".
Signed-off-by: phernandez <paul@basicmachines.co>
7f0ae4e to
9fa61b7
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Why
Core JSON note reads currently perform avoidable resolve and resource requests, and ordinary semantic cache entries expire after only 60 seconds. The read paths also need enough bounded telemetry to distinguish lookup failures from store failures without weakening Redis fail-open behavior.
This change gives Cloud a reviewable Core commit to pin while keeping deployment work out of scope.
What Changed
Implementation Details
The new note-read helper depends on narrow typed entity/resource reader protocols. It reads the accepted entity exactly once and only falls back to the resource route when content is None; an accepted empty string remains authoritative. Title, permalink, and file path come from the accepted entity response, while frontmatter is parsed from the same canonical Markdown so indexed or normalized entity metadata cannot fabricate or alter the existing JSON payload.
Generic JSON routing now selects the minimum deterministic request sequence before calling the helper. Syntactically valid UUID identifiers are exact external IDs in JSON mode, so misses do not enter an ambiguous resolver fallback. Text mode retains its prior resolve/resource flow.
Read-cache telemetry uses bounded outcome names and hashes generation values before reporting them. Redis availability exceptions remain bypasses, while malformed Lua results, persistent payload keys, and invalid cached model JSON are reported as corrupt and re-raised.
Testing
Automated
Risks / Follow-ups