fix: address embeddings cache review threads#11
Conversation
Show 1 previous deployments
|
There was a problem hiding this comment.
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 unusedwroteNewcounter.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
📝 WalkthroughWalkthroughPR 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)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
Fixes the remaining unresolved review threads left on PR #10.
MAX_RETRIES) while keeping behavior the same.wroteNewcounter.Validation:
deno task fmtdeno task lintdeno task test