fix(config): coalesce preview config reads per source snapshot - #4522
Conversation
Preview hosted config reads used a fresh flight key per request, so a burst of preview requests for one project exhausted the shared source-read admission budget (2 active + 16 queued) and failed with evaluator-unavailable: worker-overloaded. Key preview reads on the adapter's source snapshot identity and generation instead. An edit advances the generation, so it still starts a new read; adapters that cannot name their snapshot keep the previous fresh key.
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
|
Warning Review limit reachedNext included review available in 7 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (5)
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 |
Codex Review SummaryThis 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. |
📦 Client bundle boundary
A server module in a client graph aborts hydration in the browser. New leaks fail CI; known leaks are tracked in |
Code Review — Score: 88/100 (good, minor suggestions)Well-scoped incident-driven fix that closes the exact gap it names, with strong test evidence and no production-path risk. Strengths
Minor suggestions (non-blocking)
Nothing here blocks approval on the code itself — the two points above are polish, not correctness concerns. Generated by Claude Code |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 78b4295d10
ℹ️ 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".
|
Addressed the abort finding: the loader rechecks the request signal after the snapshot probe and before creating a read flight. A new test aborts during an async |
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8f6530b834
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
Addressed the P1: the cold snapshot probe now runs behind source-read admission. Concurrent requests for one project share one admitted warm-up probe, and each request then takes its own observation. The new test |
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3205151bef
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
Addressed: the admitted warm-up key now includes a SHA-256 digest of the request credential, so each concrete adapter's cold initialization goes through source-read admission. The new test |
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b6e06d7c05
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
|
Addressed: the warm-up key now covers every request-context field that |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dc3e54e604
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
Addressed: the unadmitted second capture is gone. The admitted probe flight settles with the snapshot, and waiters with an identical adapter selector share it. A failed or unstable probe falls back to an unshared admitted read instead of probing again. The new test |
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e5987c363d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
Addressed: a shared preview read now runs in the creator's request context but without its request-scoped file cache ( |
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|



Fixes veryfront/veryfront-issue-inbox#1510
Fixes veryfront/veryfront-issue-inbox#1511
Cause
On 2026-09-19 03:40:30 UTC, 10 concurrent
GET /requests for one hosted project reached a production pod about 100s after it started. None completed. One request's trace made 1,044 calls to/projects/:id/cache/*: 998 individual/cache/getcalls (p50 1.0s, 312 hit the 10s timeout), 985 of them undermdx.fetch_module < utils.parallelMap < mdx.process_vf_modules. Theapi-cache-httpcircuit breaker opened at 03:41:02, about 2,000 fast failures followed, the MDX transform tree timed out at 47-66s (#1510), and the SSR pipeline hit its 60s deadline (#1511). The same pattern appeared on 2026-09-15 01:16 on another pod (2,076 request timeouts). Operator memory recycling (since 2026-09-12) replaces 11-26 production pods per day, so cold pods are now common.Two multipliers on a cold pod:
fetchAndCacheModulededuplicates in-flight modules only within oneprocessVfModuleImportscall (context.inFlightModules). N concurrent cold renders of the same page each walk the whole_vf_modulesgraph and repeat every distributed cache read./cache/getin one request) shows each_vf_modulessection recovering a graph of about 247 HTTP bundles.ensureHttpBundlesExistfetches the code in batches (get-batch), but then looks up each bundle's recovery identity with its owngetcalls (identity + import map, about 2 per bundle, which matches the ~517 gets per section in the trace). Sibling sections recovered the same bundle graph at the same time.Fix
module-fetcher/shared-module-fetches.ts). Entry fetches (no parent module) with the same identity share one in-flight resolution. The key covers project ID, content source, ESM cache directory, project directory, local-project flag, compile mode, React version, dependency snapshot key, module server origin, server external packages, missing-module mode, and entry path. Results never cross projects or content versions.invalidateModulePathsandclearModulePathCachereset the map, so a request that starts after a content change never joins a resolution that read the old source.Singleflightstale guard).TransformTreeTimeoutError, a joined render retries alone within its own deadline.bundle-recovery.ts).ensureHttpBundlesExistclaims missing hashes synchronously before its first await. Other callers wait for the claim, then read the result from disk, and recover any bundle the claimant could not write. A claim is held until the bundle is written or single-bundle recovery settles. A caller releases all of its claims before it waits on other claims. Recovery that runs under a held claim is marked with AsyncLocalStorage. NestedensureHttpBundlesExistcalls inside it fetch in-flight bundles themselves instead of waiting, so claim holders never wait on each other.HttpBundleCache.getBatchRecoveryIdentities). Identity records, shared import maps (read once per fingerprint), and original URLs are read withgetBatchinstead of onegetper bundle. The semantics matchgetIdentityMetadata+getOriginalUrl.The 30s transform-tree deadline semantics are unchanged.
Tests (red before the fix)
module-fetcher/index.test.ts, "process-wide module fetch single-flight": 10 concurrent cold resolutions of one entry graph (page -> a, b -> c) against a distributed cache stub that countsgetand adds 200ms latency. Before: 80 cache gets and 40 source reads (10x). After: 8 cache gets (same as one solo cold graph) and 4 source reads. Also covers a joined render retrying alone after the leading render's deadline, graph-limit admission for joined renders, cross-project isolation of the same path, a shared rejection that is retried by the next request (before: 3 source reads for 3 concurrent callers, and they did not all reject), no joining across an invalidation, and session attribution for every joined render.shared-module-fetches.test.ts(hermetic): key identity per input, single run per key, rejection not retained, synchronous failure, nested-call bypass, reset, and session replay.bundle-recovery.test.ts: 30 bundles recovered with zero single-key reads and one import-map read (before: 60 single reads). 5 concurrentensureHttpBundlesExistcalls fetch each of 20 bundles once (before: 100 code reads, after: 20). A bundle a concurrent claimant failed to fetch is retried by the waiter. Single-bundle recovery for 3 concurrent callers runs once (before: 3 direct code reads).Local:
deno task lint:ci,deno task typecheck,deno fmt --check, anddeno task test:fileforsrc/transforms/,src/modules/react-loader/,src/modules/manifest/,src/rendering/,src/cache/, andsrc/server/context/all pass.Staging verification
Deployed to staging as
20260919165659-6fa06e2ac11c(releasev0.1.37-rc.534); all 4 replicas rolled out. Pod logs showOpenTelemetry initializedfollowed bySentry initialized successfully, and OTeltrace_idstill appears in request logs.Two staging Remote E2E Health runs (concurrent UI and ai-live traffic) triggered the recurring gateway-accounting events VERYFRONT-API-J and VERYFRONT-API-K. All of these events share the path
/ai/gateway/anthropic/v1/messages.GET /conversations/:conversation_id/runs/:run_id/snapshot,GET /credits/balance,POST /agent-runtimes/push-services/:service_id/heartbeatorGET /projects/:project_reference/files.v0.1.37-rc.534): 4 of 4 events carryPOST /ai/gateway/:provider/*(17:28:58Z and 17:41:58Z).