Skip to content

perf(cli): parallelize scenario run fetching and name resolution in bmj logs#179

Merged
dines-rl merged 1 commit intomainfrom
agent/parallelize-bmj-logs-loading
Mar 25, 2026
Merged

perf(cli): parallelize scenario run fetching and name resolution in bmj logs#179
dines-rl merged 1 commit intomainfrom
agent/parallelize-bmj-logs-loading

Conversation

@rlagentflowbeta
Copy link
Copy Markdown
Contributor

Summary

  • Replace the serial per-agent loop in `downloadBenchmarkJobLogs` with `Promise.allSettled`, so all agents' `listBenchmarkRunScenarioRuns` calls run concurrently
  • Replace serial `resolveScenarioName` calls with a single `Promise.all` batch across all scenario runs

The log downloads were already parallelized (max concurrency 50). This PR fixes the loading/setup phase which was the remaining serial bottleneck.

Before: loading time = sum of all agents' fetch times + sum of all scenario name lookups
After: loading time ~= slowest single agent fetch + slowest single name lookup

Test plan

  • Run `rli bmj logs ` with a multi-agent benchmark job and verify logs download correctly
  • Verify agent fetch failures surface as warnings (not crashes) via the `allSettled` error handling
  • Verify `--run` and `--scenario` filters still work correctly

🤖 Generated with Claude Code

Replace serial per-agent listBenchmarkRunScenarioRuns loop with
Promise.allSettled so all agents fetch in parallel. Also parallelize
resolveScenarioName calls with Promise.all. This makes loading time
proportional to the slowest single agent rather than the sum of all agents.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@rlagentflowbeta
Copy link
Copy Markdown
Contributor Author

🤖 This PR was created by Agent Flow.

View the agent run →

@jrvb-rl jrvb-rl changed the title perf(bmj): parallelize scenario run fetching and name resolution in bmj logs perf(cli): parallelize scenario run fetching and name resolution in bmj logs Mar 17, 2026
@jrvb-rl jrvb-rl requested a review from james-rl March 23, 2026 17:34
Copy link
Copy Markdown
Contributor

@james-rl james-rl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

As a side note, there's an interesting mix of map and for semantics in this method.

I think it may be worth adding preferences to AGENTS.md to encourage consistency for operations on collections.

@dines-rl dines-rl merged commit 227d0fd into main Mar 25, 2026
14 of 15 checks passed
@dines-rl dines-rl deleted the agent/parallelize-bmj-logs-loading branch March 25, 2026 23:28
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants