Skip to content

fix(providers): honor start day for overnight peak windows - #11718

Merged
diegosouzapw merged 3 commits into
cheaper-inference:release/v3.8.51from
pacocartones:fix/peak-hour-overnight-days
Aug 28, 2026
Merged

diegosouzapw merged 3 commits into
cheaper-inference:release/v3.8.51from
pacocartones:fix/peak-hour-overnight-days

Conversation

@pacocartones

Copy link
Copy Markdown
Contributor

Summary

  • interpret days on overnight peak-hour windows as the UTC day on which the window starts
  • keep the post-midnight segment protected until its exclusive end boundary
  • preserve daytime and unrestricted daily-window behavior

Related Issues

Validation

⚠️ base-red inherited: #11449

  • Change type: provider
  • Focused tests and category gates from the golden path
  • npm run lint — inherited stale-suppressions failure reproduced on the clean base (#11600); changed-file ESLint passes
  • Reconciled with the current active release base; focused checks rerun afterward
  • Production-code changes include an updated automated test in this PR

Focused evidence:

  • TDD RED: a Monday-only 22:00–02:00 window returned inactive on Tuesday at 01:00Z
  • tests/unit/peak-hour-protection.test.ts: 5/5 pass
  • npm run typecheck:core: pass
  • changed-file ESLint, Prettier and git diff --check: pass
  • independent review: pass

Tests Added Or Updated

  • tests/unit/peak-hour-protection.test.ts

Coverage Notes

  • Covers the start-day segment, the after-midnight segment, exclusive end boundary, a disallowed following night, Tuesday-only non-match, Sunday-to-Monday rollover and daily overnight behavior.

Reviewer Notes

  • All calculations remain UTC-only; subtracting one UTC day is not exposed to local DST transitions.
  • The draft is used only to allocate the real PR number for the required numbered changelog fragment and will be marked ready immediately afterward.

@pacocartones
pacocartones force-pushed the fix/peak-hour-overnight-days branch 2 times, most recently from a1181d9 to 59d60ee Compare August 28, 2026 08:54
@diegosouzapw
diegosouzapw merged commit db87fb6 into cheaper-inference:release/v3.8.51 Aug 28, 2026
21 of 29 checks passed
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…nference#11718)

Fixes overnight peak-hour windows so 'days' is interpreted as the UTC day the window STARTS, keeping the post-midnight segment protected until its exclusive end boundary — a Monday-only 22:00-02:00 window incorrectly returned inactive on Tuesday at 01:00Z. TDD RED demonstrated, 5/5 focused tests passing. Follow-up to cheaper-inference#11622. Thanks!
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.

2 participants