Skip to content

fix(route-proxy): attribute an overnight window's after-midnight leg to the day it opened (#3874) - #3876

Merged
dezren39 merged 1 commit into
mainfrom
creator-b/3874-windowwrap-day
Nov 1, 2026
Merged

dezren39 merged 1 commit into
mainfrom
creator-b/3874-windowwrap-day

Conversation

@dezren39

@dezren39 dezren39 commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

Fixes #3874.

What

windowActive (bin/opencode-route-proxy.mjs) checked daysOfWeek against the calendar day of now before the time-range check, so an overnight window (end ≤ start) attributed its after-midnight leg to the wrong day: a Fri-only 22:00–02:00 window was inactive at Sat 01:00 (inside the window that opened Friday) and active at Fri 01:00 (a leg belonging to an unlisted Thursday window).

The fix keeps the day check with the leg it belongs to: the evening leg (mins >= start) checks the current day; the after-midnight leg (mins < end) checks the previous day. Non-wrapping windows, unknown-window fail-closed behaviour, and inverted gates (which invert this result) are unchanged.

Verification

  • Laptop probe (verbatim extraction, ~/git/fleet/probe-2026-11-01-laneB-windowwrap/): all 7 day/time cases + non-wrapping controls pass against the fixed function; 2 fail against the original.
  • node --test bin/opencode-route-proxy.test.mjs on the laptop: 22/22 pass, including 4 new overnight-window tests (opening evening, after-midnight leg, unlisted day's after-midnight leg, unlisted evening).
  • Fail-first: with only the source file reverted to main, exactly the 2 after-midnight tests fail.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@dezren39 dezren39 added kind/bug Something isn't working (prefixed form of the classic bug label) app/opencode-route-proxy bin/opencode-route-proxy.mjs fleet proxy labels Nov 1, 2026
@dezren39
dezren39 requested a review from a team as a code owner November 1, 2026 17:30
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-01T17:31:45.639305Z ee137a9 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 1, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 26 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 07e2d6b8-64f7-4438-9cd5-21f1cba51da1
Commits

Reviewing files that changed from the base of the PR and between 064ce9e and ee137a9.

Files selected for processing: 2
  • bin/opencode-route-proxy.mjs
  • bin/opencode-route-proxy.test.mjs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app/opencode-route-proxy bin/opencode-route-proxy.mjs fleet proxy kind/bug Something isn't working (prefixed form of the classic bug label)

Projects

None yet

1 participant