perf(init): pre-compute directory listing before first API call#307
Draft
betegon wants to merge 1 commit intofeat/init-commandfrom
Draft
perf(init): pre-compute directory listing before first API call#307betegon wants to merge 1 commit intofeat/init-commandfrom
betegon wants to merge 1 commit intofeat/init-commandfrom
Conversation
Scans the project directory locally and sends the listing with the initial workflow request. This lets the server's discover-context step skip its list-dir suspend, saving one full round-trip. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Bug Fixes 🐛
Internal Changes 🔧
🤖 This preview updates automatically when you update the PR. |
Contributor
Codecov Results 📊✅ 2087 passed | Total: 2087 | Pass Rate: 100% | Execution Time: 0ms 📊 Comparison with Base Branch
All tests are passing successfully. ❌ Patch coverage is 8.70%. Project has 4323 uncovered lines. Files with missing lines (2)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
- Coverage 76.47% 73.42% -3.05%
==========================================
Files 117 124 +7
Lines 15335 16262 +927
Branches 0 0 —
==========================================
+ Hits 11727 11939 +212
- Misses 3608 4323 +715
- Partials 0 0 —Generated by Codecov Action |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Sends a pre-computed directory listing with the first API call so the server can skip its initial
list-dirsuspend. Saves one full HTTP round-trip in thediscover-contextstep.Changes
Exports
precomputeDirListingfromlocal-ops.ts— reuses the existinglistDirfunction with the same params the server would request (recursive, maxDepth 3, maxEntries 500). The wizard runner calls it beforestartAsyncand includes the result asdirListingininputData.Companion server change: getsentry/cli-init-api#16
Test plan
bun test test/lib/init/)🤖 Generated with Claude Code