Skip to content

storm: #24 - Global stopRequested flag is never reset between runs#34

Merged
casperpanduro merged 2 commits intomainfrom
storm/issue-24-global-stoprequested-flag-is-never-reset-between-r
Mar 16, 2026
Merged

storm: #24 - Global stopRequested flag is never reset between runs#34
casperpanduro merged 2 commits intomainfrom
storm/issue-24-global-stoprequested-flag-is-never-reset-between-r

Conversation

@casperpanduro
Copy link
Copy Markdown
Contributor

Closes #24

Summary

Global stopRequested flag is never reset between runs

Problem

In src/core/loop.ts, stopRequested is a module-level mutable boolean:

let stopRequested = false;

export function requestStop() {
  stopRequested = true;
}

Once requestStop() is called it is never reset to false. In a single-process run that handles multiple issues sequentially (the default mode), if a stop is requested during issue #1, all subsequent issues (#2, #3, …) will immediately hit the if (stopRequested) break guard at the start of their first iteration and skip their work entirely — silently producing no output.

Suggested fix

Reset stopRequested at the beginning of each processIssue / processIssueInDir call, or change the architecture to pass a cancellation signal (e.g. AbortSignal) into the functions instead of relying on module-level state. The latter also makes the code easier to test.

export async function processIssue(
  issue: GitHubIssue,
  config: StormConfig,
  cwd: string,
  signal?: AbortSignal
): Promise<{ success: boolean; prUrl?: string }> {
  // check signal.aborted instead of stopRequested
}

Changes

  • src/commands/continue.ts
  • src/commands/run.ts
  • src/core/loop.test.ts
  • src/core/loop.ts

4 files changed, 219 insertions(+), 21 deletions(-)

Considerations

Test Plan


Automatically generated by storm-agent on branch storm/issue-24-global-stoprequested-flag-is-never-reset-between-r.

@casperpanduro
Copy link
Copy Markdown
Contributor Author

Storm Agent Summary

Model sonnet
Duration 3m 50s
Total tokens 10,367
Input tokens 27
Output tokens 10,340
Cache read tokens 846,837
Cache creation tokens 48,385

@casperpanduro
Copy link
Copy Markdown
Contributor Author

Fix merge conflicts

@casperpanduro
Copy link
Copy Markdown
Contributor Author

Storm Continue Summary

Model sonnet
Duration 31s
Total tokens 687
Input tokens 5
Output tokens 682

@casperpanduro
Copy link
Copy Markdown
Contributor Author

Storm Continue Summary

Model sonnet
Duration 2m 47s
Total tokens 9,150
Input tokens 12
Output tokens 9,138

@casperpanduro
Copy link
Copy Markdown
Contributor Author

Storm Continue Summary

Model sonnet
Duration 3m 54s
Total tokens 14,578
Input tokens 18
Output tokens 14,560

@casperpanduro casperpanduro merged commit f427031 into main Mar 16, 2026
1 check passed
@casperpanduro casperpanduro deleted the storm/issue-24-global-stoprequested-flag-is-never-reset-between-r branch March 16, 2026 17:05
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.

Global stopRequested flag is never reset between runs

1 participant