Skip to content

Fix: maxSteps off-by-one error#3

Merged
FL4TLiN3 merged 3 commits intomainfrom
fix/max-steps-off-by-one
Dec 4, 2025
Merged

Fix: maxSteps off-by-one error#3
FL4TLiN3 merged 3 commits intomainfrom
fix/max-steps-off-by-one

Conversation

@FL4TLiN3
Copy link
Contributor

@FL4TLiN3 FL4TLiN3 commented Dec 4, 2025

Summary

  • Fix off-by-one error in maxSteps check that caused one extra step to execute
  • With maxSteps=3, steps 1, 2, 3 now correctly execute and stop (previously executed 4 steps)

Test plan

  • Unit tests added for boundary case (stepNumber == maxSteps)
  • Unit tests added for exceeded case (stepNumber > maxSteps)
  • E2E tests pass
  • Typecheck passes

Note

Fixes off-by-one in finishingStep so runs stop at maxSteps, adds boundary/exceeded tests, and updates report/changeset.

  • Runtime:
    • Adjust packages/runtime/src/states/finishing-step.ts to use >= for maxSteps check and switch finishedAt to Date.now().
  • Tests:
    • Update and expand packages/runtime/src/states/finishing-step.test.ts with boundary (stepNumber == maxSteps) and exceeded cases; rename test for clarity.
  • Docs/Report:
    • Update CODE_REVIEW_REPORT.md to mark maxSteps issue as fixed and add commit ced1aa6 to the summary tables.
  • Release:
    • Add changeset .changeset/fix-max-steps-off-by-one.md to publish a patch for @perstack/runtime.

Written by Cursor Bugbot for commit ceb7871. This will update automatically on new commits. Configure here.

@vercel
Copy link

vercel bot commented Dec 4, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
perstack Ready Ready Preview Comment Dec 4, 2025 0:57am

@codecov
Copy link

codecov bot commented Dec 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

1 participant