perf: parallelize sequential findByRole queries in GetContextTool#45
Merged
perf: parallelize sequential findByRole queries in GetContextTool#45
Conversation
Health-check mode (3 queries: WORK, REVIEW, BLOCKED) and session-resume mode (2 queries: WORK, REVIEW) now launch findByRole calls concurrently via coroutineScope/async instead of sequentially, reducing latency when the database supports concurrent reads. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add getOrElse(default) extension to Result sealed class, replacing verbose when-expression unwrapping with one-liner calls. Applied to all 6 instances in GetContextTool (5 from parallelization + 1 bonus). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds direct unit tests for getOrElse, getOrNull, map, isSuccess, isError, onSuccess, and onError — previously only exercised indirectly through tool integration tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.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
findByRolecalls (WORK, REVIEW, BLOCKED) now run concurrently viacoroutineScope { async { ... } }findByRolecalls (WORK, REVIEW) parallelized similarlyResult.Errorstill maps toemptyList()Test Results
All tests pass (BUILD SUCCESSFUL). New test added:
health check parallel queries return correct combined resultsReview
Independent review agent verdict: Pass with observations
whenpattern (non-blocking)MCP Items
0499a6aa— Parallelize sequential findByRole queries in health-check mode🤖 Generated with Claude Code