Skip to content

fix(heartbeat): return false for zero-width active-hours window#21408

Merged
gumadeiras merged 5 commits intoopenclaw:mainfrom
adhitShet:fix/infra-heartbeat-zero-width-window
Feb 20, 2026
Merged

fix(heartbeat): return false for zero-width active-hours window#21408
gumadeiras merged 5 commits intoopenclaw:mainfrom
adhitShet:fix/infra-heartbeat-zero-width-window

Conversation

@adhitShet
Copy link
Copy Markdown
Contributor

@adhitShet adhitShet commented Feb 19, 2026

Summary

  • Bug fix

🤖 Generated with Claude Code

Greptile Summary

fixed the logic for zero-width active-hours window to correctly return false when start equals end

Test failure: the test at heartbeat-active-hours.test.ts:42-51 still expects true when startMin === endMin, but the fix now returns false. This test must be updated to expect false instead.

Confidence Score: 2/5

  • PR introduces a test failure that must be resolved before merging
  • the logic fix itself is correct (zero-width window should return false), but the test suite will fail because the test expects the old behavior
  • test file src/infra/heartbeat-active-hours.test.ts needs update at line 50

Last reviewed commit: 34f16d6

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment on lines 85 to +86
if (startMin === endMin) {
return true;
return false;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

test at src/infra/heartbeat-active-hours.test.ts:42-51 expects true but this now returns false

Suggested change
if (startMin === endMin) {
return true;
return false;
if (startMin === endMin) {
return false;
}

update the test's expectation from .toBe(true) to .toBe(false)

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/infra/heartbeat-active-hours.ts
Line: 85-86

Comment:
test at `src/infra/heartbeat-active-hours.test.ts:42-51` expects `true` but this now returns `false`

```suggestion
  if (startMin === endMin) {
    return false;
  }
```

update the test's expectation from `.toBe(true)` to `.toBe(false)`

How can I resolve this? If you propose a fix, please make it concise.

@adhitShet
Copy link
Copy Markdown
Contributor Author

Fixed in latest push: Updated heartbeat-active-hours.test.ts:42-51 to expect .toBe(false) instead of .toBe(true) for the zero-width active-hours window (start equals end), matching the new behavior where an equal start/end is treated as an empty/invalid window.

@gumadeiras gumadeiras self-assigned this Feb 20, 2026
@gumadeiras gumadeiras force-pushed the fix/infra-heartbeat-zero-width-window branch from abc5ebb to 30c7d80 Compare February 20, 2026 00:52
Adi-A and others added 3 commits February 19, 2026 19:52
When startMin === endMin the active window has zero width and no time
should ever fall inside it. The previous code returned true (always
active) which is the opposite of the intended behaviour.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@gumadeiras gumadeiras force-pushed the fix/infra-heartbeat-zero-width-window branch from 30c7d80 to f706c6b Compare February 20, 2026 00:53
@openclaw-barnacle openclaw-barnacle bot added docs Improvements or additions to documentation gateway Gateway runtime labels Feb 20, 2026
@gumadeiras gumadeiras merged commit ae4907c into openclaw:main Feb 20, 2026
23 checks passed
@gumadeiras
Copy link
Copy Markdown
Member

Merged via squash.

Thanks @adhitShet!

vignesh07 pushed a commit to pahdo/openclaw that referenced this pull request Feb 20, 2026
…claw#21408)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 993860b
Co-authored-by: adhitShet <[email protected]>
Co-authored-by: gumadeiras <[email protected]>
Reviewed-by: @gumadeiras
anisoptera pushed a commit to anisoptera/openclaw that referenced this pull request Feb 20, 2026
…claw#21408)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 993860b
Co-authored-by: adhitShet <[email protected]>
Co-authored-by: gumadeiras <[email protected]>
Reviewed-by: @gumadeiras
rodrigogs pushed a commit to rodrigogs/openclaw that referenced this pull request Feb 20, 2026
…claw#21408)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 993860b
Co-authored-by: adhitShet <[email protected]>
Co-authored-by: gumadeiras <[email protected]>
Reviewed-by: @gumadeiras
Hansen1018 added a commit to Hansen1018/openclaw that referenced this pull request Feb 21, 2026
…claw#21408)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 993860b
Co-authored-by: adhitShet <[email protected]>
Co-authored-by: gumadeiras <[email protected]>
Reviewed-by: @gumadeiras
vincentkoc pushed a commit that referenced this pull request Feb 21, 2026
Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 993860b
Co-authored-by: adhitShet <[email protected]>
Co-authored-by: gumadeiras <[email protected]>
Reviewed-by: @gumadeiras
vincentkoc pushed a commit that referenced this pull request Feb 21, 2026
Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 993860b
Co-authored-by: adhitShet <[email protected]>
Co-authored-by: gumadeiras <[email protected]>
Reviewed-by: @gumadeiras
mmyyfirstb pushed a commit to mmyyfirstb/openclaw that referenced this pull request Feb 21, 2026
…claw#21408)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 993860b
Co-authored-by: adhitShet <[email protected]>
Co-authored-by: gumadeiras <[email protected]>
Reviewed-by: @gumadeiras
obviyus pushed a commit to guirguispierre/openclaw that referenced this pull request Feb 22, 2026
…claw#21408)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 993860b
Co-authored-by: adhitShet <[email protected]>
Co-authored-by: gumadeiras <[email protected]>
Reviewed-by: @gumadeiras
zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
…claw#21408)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 993860b
Co-authored-by: adhitShet <[email protected]>
Co-authored-by: gumadeiras <[email protected]>
Reviewed-by: @gumadeiras
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation gateway Gateway runtime size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants