Skip to content

fix(common): honor DeepSeek Beijing weekend boundaries - #1187

Open
c8dhjp4tyv-bit wants to merge 1 commit into
CodebuffAI:mainfrom
c8dhjp4tyv-bit:recreate/1096-deepseek-beijing-weekend-boundary
Open

fix(common): honor DeepSeek Beijing weekend boundaries#1187
c8dhjp4tyv-bit wants to merge 1 commit into
CodebuffAI:mainfrom
c8dhjp4tyv-bit:recreate/1096-deepseek-beijing-weekend-boundary

Conversation

@c8dhjp4tyv-bit

Copy link
Copy Markdown

Recreated on the rewritten main after #1096 was auto-closed during repository maintenance. This carries the final change set from the old branch onto the new history.

Fixes #1090

Summary

  • Export and directly test the Beijing weekend predicate at the Friday/Sunday UTC boundary.
  • Apply DeepSeek's weekend off-peak rule only from its effective instant, 2026-08-22T16:00:00Z.
  • Keep historical pricing and expensive-window checks from retroactively treating pre-change weekends as off-peak.

Why

The existing weekend tests used instants where UTC and Beijing were already on the same weekend day, so removing the +8 hour conversion left the suite green. The new boundary cases pin Friday 16:00Z and Sunday 16:00Z, where the calendars diverge.

Verification

Prior validation before the history rewrite:

  • bun test common/src/__tests__/freebuff-peak-hours.test.ts — 26 passed
  • bun run --cwd common typecheck — passed
  • Prettier check and git diff --check — passed

The full common test command cannot pass in this public checkout because several existing tests reference private/web files absent from the mirror; the changed test file passes independently.

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.

Both weekend tests stay green if the Beijing shift is removed

1 participant