Conversation
Greptile SummaryReduces the GLM 5.1 session quota rolling window from 20 hours to 12 hours by changing the single Confidence Score: 5/5Safe to merge — single constant change with no logic modifications and all tests passing. All findings are P2. The only substantive note is a minor duplicate computation of windowMs which does not affect correctness. The constant change propagates correctly through every enforcement and display path. No files require special attention.
|
| Filename | Overview |
|---|---|
| web/src/server/free-session/public-api.ts | Single-line constant change: windowHours: 20 → 12; minor duplicate windowMs computation at the call site |
| web/src/server/free-session/tests/public-api.test.ts | Test ages updated from 19h→11h to stay inside the new 12h window; boundary test correctly parameterised via GLM_WINDOW_HOURS |
| web/src/server/free-session/store.ts | Comment-only update: 20h → 12h; no logic changed |
| common/src/types/freebuff-session.ts | JSDoc comment updated from 20h to 12h; no type definitions changed |
| packages/internal/src/db/schema.ts | Comment-only update: 20h → 12h in the audit-log table doc |
| cli/src/components/waiting-room-screen.tsx | Comment-only update: two UI comment strings updated from 20h to 12h |
| cli/src/hooks/use-freebuff-session.ts | Comment-only update: 20h → 12h in the 429-handling comment |
Comments Outside Diff (1)
-
web/src/server/free-session/public-api.ts, line 274-277 (link)Duplicate
windowMscomputationfetchRateLimitSnapshotalready computescfg.windowHours * 60 * 60 * 1000internally to derivesince. That same value is re-derived here fromsnapshot.info.windowHours. ReturningwindowMsfromfetchRateLimitSnapshotwould eliminate the duplication.Alternatively, include
windowMsin the return value offetchRateLimitSnapshotso it doesn't need to be recalculated fromwindowHoursat the call site.Prompt To Fix With AI
This is a comment left during a code review. Path: web/src/server/free-session/public-api.ts Line: 274-277 Comment: **Duplicate `windowMs` computation** `fetchRateLimitSnapshot` already computes `cfg.windowHours * 60 * 60 * 1000` internally to derive `since`. That same value is re-derived here from `snapshot.info.windowHours`. Returning `windowMs` from `fetchRateLimitSnapshot` would eliminate the duplication. Alternatively, include `windowMs` in the return value of `fetchRateLimitSnapshot` so it doesn't need to be recalculated from `windowHours` at the call site. 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: web/src/server/free-session/public-api.ts
Line: 274-277
Comment:
**Duplicate `windowMs` computation**
`fetchRateLimitSnapshot` already computes `cfg.windowHours * 60 * 60 * 1000` internally to derive `since`. That same value is re-derived here from `snapshot.info.windowHours`. Returning `windowMs` from `fetchRateLimitSnapshot` would eliminate the duplication.
Alternatively, include `windowMs` in the return value of `fetchRateLimitSnapshot` so it doesn't need to be recalculated from `windowHours` at the call site.
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "Limit GLM sessions to 12 hours" | Re-trigger Greptile
Summary
Changes the GLM Freebuff session quota from 5 admissions per 20 hours to 5 admissions per 12 hours.
Updates the CLI waiting-room comments, shared wire-type docs, DB schema docs, and free-session tests to match the new window while keeping the existing retry countdown behavior.
Validation
bun test web/src/server/free-session/__tests__/public-api.test.tspassed with 41 tests.