feat(init): pre-read common config files to reduce round-trips#704
feat(init): pre-read common config files to reduce round-trips#704
Conversation
After computing the directory listing, pre-read ~35 common config files (manifests, framework configs, Sentry configs) if they exist. Send the results as fileCache in the startAsync input data. Workflow steps already check fileCache before suspending for read-files, so this eliminates 1-3 HTTP round-trips with no server-side changes needed (the fileCache field is already in step schemas). Capped at 512KB total to avoid sending excessive data upfront. Made-with: Cursor
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨Docs
Init
Other
Bug Fixes 🐛Dashboard
Other
Internal Changes 🔧
🤖 This preview updates automatically when you update the PR. |
|
2d43d18 to
315f55d
Compare
315f55d to
7dde7a4
Compare
7dde7a4 to
8243750
Compare
8243750 to
69052a8
Compare
After computing the directory listing, pre-read common config files if they exist. Send the results as fileCache in the startAsync input data. Workflow steps already check fileCache before suspending for read-files, so this eliminates 1-3 HTTP round-trips. Covers all supported ecosystems: JavaScript/TypeScript (Next, Nuxt, Angular, Astro, Svelte, Remix, React Native, Electron, Cloudflare, Bun, serverless), Python (Django, Flask, FastAPI), PHP (Laravel, Symfony, WordPress), .NET (AspNetCore), Java/Android (Spring Boot, Gradle), Go (Gin), Ruby (Rails), Rust, Dart/Flutter, Elixir, Cocoa, and native (CMake). Capped at 512KB total. Made-with: Cursor
69052a8 to
f969ba7
Compare
Codecov Results 📊✅ 134 passed | Total: 134 | Pass Rate: 100% | Execution Time: 0ms 📊 Comparison with Base Branch
✨ No test changes detected All tests are passing successfully. ✅ Patch coverage is 100.00%. Project has 1573 uncovered lines. Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 95.19% 95.36% +0.17%
==========================================
Files 232 232 —
Lines 33837 33927 +90
Branches 0 0 —
==========================================
+ Hits 32211 32354 +143
- Misses 1626 1573 -53
- Partials 0 0 —Generated by Codecov Action |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f969ba7. Configure here.
| content = JSON.stringify(JSON.parse(content)); | ||
| } catch { | ||
| // Not valid JSON — send as-is | ||
| } |
There was a problem hiding this comment.
Duplicated JSON minification logic across two functions
Low Severity
The JSON minification block (JSON.stringify(JSON.parse(content)) with a try-catch for non-valid JSON) is identically duplicated between preReadCommonFiles and readSingleFile. If this logic changes in one place, the other risks drifting out of sync.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit f969ba7. Configure here.


Summary
Pre-reads ~35 common config files (manifests, framework configs, Sentry configs) after computing the directory listing, then sends them as
fileCachein thestartAsyncinput data.Workflow steps already check
fileCachebefore suspending forread-files, so this eliminates 1-3 HTTP round-trips with no server-side changes needed — thefileCachefield is already in step input schemas.Capped at 512KB total to avoid sending excessive data upfront.
Files pre-read
Manifests:
package.json,tsconfig.json,pyproject.toml,Gemfile,go.mod,build.gradle,pom.xml,Cargo.toml,pubspec.yaml,mix.exs,composer.jsonFramework configs:
next.config.*,nuxt.config.*,angular.json,astro.config.*,svelte.config.js,remix.config.js,vite.config.*,webpack.config.jsSentry configs:
sentry.client.config.*,sentry.server.config.*,sentry.edge.config.*,instrumentation.*Test plan
Note: this needs
fileCacheadded towizardInputSchemaon the server to actually flow through. It's a one-line schema change (fileCache: z.record(z.string(), z.string().nullable()).optional()). Without it, the server silently drops the extra field — no breakage.Made with Cursor