perf(cli): parallelize scenario log downloads with max concurrency of 50#176
Merged
perf(cli): parallelize scenario log downloads with max concurrency of 50#176
Conversation
Replace the serial download loop in `bmj logs` with a concurrent executor capped at 50 simultaneous downloads. This significantly reduces wall-clock time when a job has many scenarios. Output lines are printed atomically as each download completes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Author
|
🤖 This PR was created by Agent Flow. |
Contributor
|
Patched into a local copy and verified that this works as expected (and it's definitely much faster!) |
james-rl
approved these changes
Mar 17, 2026
Contributor
james-rl
left a comment
There was a problem hiding this comment.
Looks great! I'm very excited for this change!
Tiny comment: if you change the await to allSettled instead all then the entire promise array will execute instead of bailing if one of the operations fails. I think this is probably better in this particular case.
| { length: Math.min(maxConcurrency, tasks.length) }, | ||
| () => worker(), | ||
| ); | ||
| await Promise.all(workers); |
Contributor
There was a problem hiding this comment.
consider making this allSettled instead of all
dines-rl
pushed a commit
that referenced
this pull request
Mar 25, 2026
🤖 I have created a release *beep* *boop* --- ## [1.14.0](v1.13.3...v1.14.0) (2026-03-25) ### Features * add 'logs' command to download info from devboxes ([#164](#164)) ([d5354be](d5354be)) * use total_count field from Pagination API response ([#175](#175)) ([4e84f30](4e84f30)) ### Bug Fixes * **benchmark:** fix benchmark id when creating job with benchmark ([#170](#170)) ([2c73cba](2c73cba)) * bmj list now counts finished scenarios from in-progress runs ([#168](#168)) ([123f1d4](123f1d4)) * **cli:** show failure reason when benchmark job fails with no outcomes ([#182](#182)) ([817b5cd](817b5cd)) * **cli:** use allSettled() instead of all() so one bad download doesn't spoil the barrel ([#178](#178)) ([8f4145a](8f4145a)) * don't reset TUI menu cursor on back ([#181](#181)) ([6cc35a7](6cc35a7)) * eliminate flicker in bmj watch and show job elapsed time ([#167](#167)) ([9b1deed](9b1deed)) * prevent double devbox creation when pressing Enter in interactive form ([#173](#173)) ([23f8a28](23f8a28)) * scenarios sometimes listed as in progress after bmj completes ([#174](#174)) ([78f8f55](78f8f55)) * update broken tests ([#169](#169)) ([d8b35a2](d8b35a2)) ### Performance Improvements * **cli:** parallelize scenario log downloads with max concurrency of 50 ([#176](#176)) ([a5828a2](a5828a2)) * **cli:** parallelize scenario run fetching and name resolution in bmj logs ([#179](#179)) ([227d0fd](227d0fd)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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
rli bmj logswith a concurrent executor capped at 50 simultaneous downloadsrunWithConcurrencyhelper that distributes tasks across N workers using a shared indexTest plan
rli bmj logs <job-id>on a job with many scenarios and confirm downloads complete much faster<output-dir>/<agent>/<scenario>/)results.jsonis written correctly for each scenario🤖 Generated with Claude Code