Skip to content

Make Fireworks deployment hours daily#547

Merged
jahooma merged 2 commits intomainfrom
jahooma/fireworks-daily-hours
Apr 25, 2026
Merged

Make Fireworks deployment hours daily#547
jahooma merged 2 commits intomainfrom
jahooma/fireworks-daily-hours

Conversation

@jahooma
Copy link
Copy Markdown
Contributor

@jahooma jahooma commented Apr 25, 2026

Summary

This updates the shared Freebuff/Fireworks deployment availability window so GLM is available every day from 9am ET until before 5pm PT instead of only Monday through Friday. It also removes the redundant client-facing "local" suffix from availability labels and updates server fallback copy to say "9am ET-5pm PT every day".

Validation

Ran targeted Bun tests for the shared Freebuff model helper, Fireworks routing, free-session public API, and freebuff session handlers with required dummy web env vars.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 25, 2026

Greptile Summary

This PR expands the Fireworks/GLM deployment availability from weekdays-only to every day of the week (9am ET–5pm PT), simplifies the next-start offset logic to a single ternary, removes the isWeekend/getWeekdayIndex helpers, and cleans up user-facing labels (dropping the redundant "local" suffix, adding "every day" to the server-facing constant). The logic is correct and the tests are well-updated to cover the new weekend behavior.

Confidence Score: 5/5

Safe to merge — logic is correct and well-tested; only remaining finding is a minor dead field cleanup.

All P0/P1 issues are absent. The single finding is a P2 style issue: the weekday field in ZonedDateParts is computed but never consumed after the removal of isWeekend/getWeekdayIndex. This does not affect correctness or runtime behavior.

common/src/constants/freebuff-models.ts — the weekday field in ZonedDateParts and the weekday: 'short' option in getZonedParts are now unused.

Important Files Changed

Filename Overview
common/src/constants/freebuff-models.ts Core logic change: removes weekend check and simplifies next-start offset to a single ternary; weekday field in ZonedDateParts is now unused dead code
common/src/tests/freebuff-models.test.ts Test cases correctly updated: adds Saturday weekend coverage, adjusts weekday-label test to a Sunday cross-midnight scenario, and removes "local" suffix from expected strings
web/src/llm-api/fireworks.ts Comment updated from "Mon-Fri" to "daily"; no logic change — delegates entirely to isFreebuffDeploymentHours
web/src/llm-api/tests/fireworks-deployment.test.ts Test updated to expect weekend deployment to be active; description changed from "inactive on weekends" to "active on weekends during deployment hours"
web/src/app/api/v1/freebuff/session/tests/session.test.ts Updates expected availableHours string to include "every day" — straightforward constant update
web/src/server/free-session/tests/public-api.test.ts Updates expected availableHours string to include "every day" — straightforward constant update

Comments Outside Diff (1)

  1. common/src/constants/freebuff-models.ts, line 33-36 (link)

    P2 weekday field is now dead code

    ZonedDateParts.weekday is still fetched via weekday: 'short' in getZonedParts, but after removing isWeekend and getWeekdayIndex, nothing reads eastern.weekday or pacific.weekday anywhere in the file. The formatLocalTime path uses its own Intl.DateTimeFormat call directly. The field and the weekday format option in getZonedParts can be removed as part of the stated simplification goal.

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: common/src/constants/freebuff-models.ts
    Line: 33-36
    
    Comment:
    **`weekday` field is now dead code**
    
    `ZonedDateParts.weekday` is still fetched via `weekday: 'short'` in `getZonedParts`, but after removing `isWeekend` and `getWeekdayIndex`, nothing reads `eastern.weekday` or `pacific.weekday` anywhere in the file. The `formatLocalTime` path uses its own `Intl.DateTimeFormat` call directly. The field and the `weekday` format option in `getZonedParts` can be removed as part of the stated simplification goal.
    
    How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix All With AI
This is a comment left during a code review.
Path: common/src/constants/freebuff-models.ts
Line: 33-36

Comment:
**`weekday` field is now dead code**

`ZonedDateParts.weekday` is still fetched via `weekday: 'short'` in `getZonedParts`, but after removing `isWeekend` and `getWeekdayIndex`, nothing reads `eastern.weekday` or `pacific.weekday` anywhere in the file. The `formatLocalTime` path uses its own `Intl.DateTimeFormat` call directly. The field and the `weekday` format option in `getZonedParts` can be removed as part of the stated simplification goal.

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

Reviews (1): Last reviewed commit: "Make Fireworks deployment hours daily" | Re-trigger Greptile

@jahooma jahooma merged commit 2cb41c6 into main Apr 25, 2026
11 checks passed
@jahooma jahooma deleted the jahooma/fireworks-daily-hours branch April 25, 2026 18:55
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