feat(core): Add progressCallback parameter to runDefaultAction#1420
feat(core): Add progressCallback parameter to runDefaultAction#1420
Conversation
⚡ Performance Benchmark
Details
Historyde2fce0 test(core): Add test coverage for progressCallback in runDefaultAction
e2d2447 fix(core): Address PR review feedback
eb256fb fix(core): Isolate progressCallback failures from pack flow
68fdc17 feat(core): Add progressCallback parameter to runDefaultAction
|
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 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)
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 |
Deploying repomix with
|
| Latest commit: |
cb00a7c
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://865dff56.repomix.pages.dev |
| Branch Preview URL: | https://feat-add-progress-callback-t.repomix.pages.dev |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1420 +/- ##
==========================================
+ Coverage 87.26% 87.32% +0.05%
==========================================
Files 117 117
Lines 4421 4426 +5
Branches 1021 1022 +1
==========================================
+ Hits 3858 3865 +7
+ Misses 563 561 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Code Review
This pull request updates the runDefaultAction function in src/cli/actions/defaultAction.ts to accept an optional progressCallback. The implementation refactors the progress handling during the pack operation to ensure that both the CLI spinner and the new callback are updated simultaneously. I have no feedback to provide.
Code ReviewClean, minimal PR that threads an optional 1. Type mismatch:
|
|
Addressed both suggestions in
Thanks for the thorough review! 🤖 |
Code Review (Follow-up)Previous feedback was addressed in Test coverage for
|
Allow callers to receive detailed progress messages from pack() (e.g., "Searching for files...", "Collecting files...", "Generating output...") by passing an optional progressCallback. The callback is invoked alongside the existing spinner updates, so CLI behavior is unchanged. This enables programmatic consumers like the website server to stream fine-grained progress to clients. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Wrap progressCallback invocation with try/catch and Promise.catch to prevent unhandled rejections from crashing the process when an async callback is passed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Update RepomixProgressCallback type to void | Promise<void> to explicitly indicate async callback support - Remove redundant outer try-catch since Promise.resolve() handles both sync and async returns Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add three test cases for handleProgress: - Callback is invoked with progress messages from pack() - Async callback rejection is isolated (pack completes, error logged) - Spinner still updates when callback throws synchronously Also restore the outer try-catch for sync errors — Promise.resolve() only catches async rejections, not synchronous throws from the callback invocation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
de2fce0 to
cb00a7c
Compare
Add an optional
progressCallbackparameter torunDefaultActionso callers can receive detailed progress messages frompack()(e.g., "Searching for files...", "Collecting files...", "Generating output...").The callback is invoked alongside the existing spinner updates, so CLI behavior is unchanged. This enables programmatic consumers like the website server to stream fine-grained progress to clients.
Checklist
npm run testnpm run lint