Promote ctx.data.staleWhileRevalidate as the primary cache-first pattern in builder prompt#70
Conversation
…first pattern - Add 'data' to the builder system prompt namespaces array - Add a data section describing staleWhileRevalidate as the preferred declarative pattern for cache-first views, replacing the manual ctx.storage.get/set + ctx.views.invalidate() antipattern - Also document ctx.data.loader() for non-cached lazy-loading views Closes #62
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
More reviews will be available in 15 minutes and 12 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. 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 |
Why
The AI builder defaults to manual cache-then-refresh patterns when building cache-first views, even though
ctx.data.staleWhileRevalidate()provides the same semantics declaratively in ~10 lines. This leads to 5-10x more turns and fragile ~180-line hand-rolled cache code.What
datato the builder system prompt'snamespaceslist so the builder knows the namespace exists before reaching for the full API referencedatahint section describingstaleWhileRevalidateas the primary pattern for cache-first views — covering fresh/stale/expired/error-fallback lifecycle — with explicit guidance to prefer it over manualctx.storage.get/set+ctx.views.invalidate()ctx.data.loader()for non-cached lazy-loading casesCloses #62