Skip to content

fix: address embeddings cache review threads#11

Merged
0x4007 merged 1 commit intodevelopmentfrom
fix/embeddings-cache-review-comments
Feb 9, 2026
Merged

fix: address embeddings cache review threads#11
0x4007 merged 1 commit intodevelopmentfrom
fix/embeddings-cache-review-comments

Conversation

@0x4007
Copy link
Member

@0x4007 0x4007 commented Feb 9, 2026

Fixes the remaining unresolved review threads left on PR #10.

  • Retry cache writes after any eviction progress (including stale index key deletions).
  • Clarify quota retry semantics by renaming the constant (MAX_RETRIES) while keeping behavior the same.
  • Remove an unused wroteNew counter.
  • Tighten quota-error detection to avoid treating generic "limit exceeded" errors as quota.

Validation:

  • deno task fmt
  • deno task lint
  • deno task test

Copilot AI review requested due to automatic review settings February 9, 2026 17:49
@github-actions
Copy link

github-actions bot commented Feb 9, 2026

@0x4007 0x4007 merged commit cdc4a86 into development Feb 9, 2026
6 checks passed
@0x4007 0x4007 deleted the fix/embeddings-cache-review-comments branch February 9, 2026 17:50
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR resolves remaining review threads from PR #10 by refining the embeddings KV cache’s quota-driven eviction/retry behavior and removing unused bookkeeping, keeping the cache best-effort while reducing false-positive “quota” classifications.

Changes:

  • Retry cache writes after any eviction progress (including deleting stale index keys), not only after evicting embeddings.
  • Rename the retry constant to clarify semantics (EMBEDDINGS_CACHE_QUOTA_MAX_RETRIES) without changing behavior.
  • Tighten quota-error detection by removing the generic "limit exceeded" heuristic and remove an unused wroteNew counter.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@coderabbitai
Copy link

coderabbitai bot commented Feb 9, 2026

📝 Walkthrough

Walkthrough

PR modifies embeddings cache eviction logic in src/openai.ts. Renames constant EMBEDDINGS_CACHE_QUOTA_RETRY_ATTEMPTS to EMBEDDINGS_CACHE_QUOTA_MAX_RETRIES. Updates eviction termination condition to require both evicted_embeddings and deleted_stale_index_keys to be zero before stopping retries (previously only checked evicted_embeddings). Removes unused wroteNew variable from embeddings write path and adds clarifying comments.

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main objective: addressing unresolved review threads from a previous PR regarding embeddings cache fixes.
Description check ✅ Passed The description clearly relates to the changeset, detailing the specific fixes made: constant rename, eviction logic adjustment, unused variable removal, and quota-error detection tightening.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/embeddings-cache-review-comments

No actionable comments were generated in the recent review. 🎉


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants