storm: #23 - Duplicate iteration loop logic between processIssue and processIssueInDir#32
Merged
casperpanduro merged 2 commits intomainfrom Mar 16, 2026
Conversation
…Issue and processIssueInDir
Contributor
Author
Storm Agent Summary
|
Contributor
Author
Storm Continue Summary
|
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.
Closes #23
Summary
Duplicate iteration loop logic between processIssue and processIssueInDir
Problem
src/core/loop.tscontains two nearly identical iteration loops:processIssue(lines 39–111) andprocessIssueInDir(lines 182–237). Both implement the same core pattern:The only meaningful differences are (1)
processIssueuseslog.stepwhileprocessIssueInDiruseslog.issue, and (2)processIssuesets up the branch before the loop. Any bug fix or behavioral change must be applied in two places, and they have already drifted (e.g.processIssueInDiris missing the explicit check-failure log line).Suggested fix
Extract a shared
runIterationLoopfunction that takes the issue, config, cwd, and a logger variant. BothprocessIssueandprocessIssueInDircall this shared function after their own setup steps:This eliminates the duplication and ensures both paths stay in sync.
Changes
src/core/loop.ts1 file changed, 29 insertions(+), 80 deletions(-)
Considerations
Test Plan
Automatically generated by storm-agent on branch
storm/issue-23-duplicate-iteration-loop-logic-between-processissu.