Repository navigation
Description
Finding
PR #4410 (merge 850916f1b2ca, fixes #4259) added warnInvalidWindows to bin/opencode-route-proxy.mjs so a typo'd model_route_windows entry is named at config load instead of silently mis-evaluating. The warning validates only start/end. The window's other two fields can still silently break the gate in both directions, with no load-time naming and no log at evaluation time:
- An invalid
timezone(e.g.America/Chicagoo) makeswindowActivethrow insideIntl.DateTimeFormat, thecatchreturnsfalse, and the window never matches — forever, silently. Withinvert: trueon the gate, the target becomes permanently eligible. - A
daysOfWeekentry that is not a real weekday name (e.g."funday", normalized to"fun") never equals a weekday, so the window never matches — silently. - A non-array
daysOfWeek(e.g. the string"fri") is treated asnull= every day, silently widening the window to days it was meant to exclude.
Evidence (verified on current main faeee690b27e9728e05319368d2904774f2308d6)
bin/opencode-route-proxy.mjs:619—warnInvalidWindowschecks onlyparseHHMM(win?.start)/parseHHMM(win?.end)and warns on nothing else; called fromloadConfigat:228. Its own comment (:614-618) states the purpose: "a typo'd window surfaces as a loud no-match rather than flipping a route gate to always-on/always-off/end-less" — the timezone/days cases are the same failure class, unwarned.bin/opencode-route-proxy.mjs:641—windowActive(win, now); at:647-657theIntl.DateTimeFormatconstruction withtimeZone: win.timezone || "UTC"is wrapped intry { ... } catch { return false; }— an unknown timezone is swallowed with no log, on every evaluation.bin/opencode-route-proxy.mjs:660-664—daysisArray.isArray(win.daysOfWeek) && win.daysOfWeek.length ? win.daysOfWeek.map(...) : null, anddayListed = (d) => !days || days.includes(d): a non-arraydaysOfWeekbecomes "all days", and an unrecognized name simply never appears indays.includes(...)results for a real weekday.- The tests added by Fix #4259: range-check opencode-route-proxy window times #4410 (
bin/opencode-route-proxy.test.mjs) pin out-of-range start/end, boundary times, and the load log naming a bad window — no case covers an invalidtimezoneor a malformeddaysOfWeek. - Dedupe:
gh search issuesforroute-proxy timezone,warnInvalidWindows, andmodel_route_windowsreturns only the closed opencode-route-proxy: window times are never range-checked — parseHHMM accepts 24:60 and 99:99, so a typo'd window silently becomes always-on, always-off, or end-less #4259 (times only; its acceptance criteria name hour/minute range checks exclusively) and closed opencode-route-proxy: normalizeTarget drops target 'window' gates — no window handling exists in the proxy (PR #2549 Codex P2 unaddressed) #3225. Nothing tracks this residual.
Why it matters
#4259's premise is that a window typo must surface loudly at load, because window gates decide which model routes are eligible in which hours (quota windows, overnight routes). A mistyped timezone or weekday is at least as likely as a mistyped hour, and today it produces exactly the silent always-off / always-on (inverted) / wrong-days behavior #4259 closed for times — including one fail-open direction (non-array daysOfWeek widening to every day) that the time checks never had.
Acceptance criteria
warnInvalidWindows(or window loading, one place) also names a window whosetimezoneis present but not a validIntltimezone, and a window whosedaysOfWeekis present but not an array of recognized weekday names — naming the window and the offending value, consistent with the existing start/end warning.- Regression tests in
bin/opencode-route-proxy.test.mjs: an invalid-timezone window and a bad-daysOfWeekwindow are named in the load log; evaluation behavior for valid windows (including the route-proxy: overnight window gates check daysOfWeek against the wrong day — the after-midnight leg follows the calendar day, not the day the window opened #3874 wrapping cases and windows with notimezone/daysOfWeek, which default to UTC / all days) is unchanged. - Existing route-proxy tests pass (
node --test bin/opencode-route-proxy.test.mjs).
Filed by pr-diff-review-b from the review of PR #4410. Dedupe: searches above returned only closed #4259/#3225; #4259's scope was start/end times exclusively.
Activity
developing-today commentedon Nov 17, 2026
CODE-4078
dezren39 commentedon Nov 17, 2026
agent-note:v1
Agent: pr-diff-review-b
State: filed
Repo: developing-today/code
Source PR: #4410 (MERGED, head 594b7f6, merge 850916f, ancestor-verified on main, compare behind=0) — fixes #4259 (CLOSED, verified)
Finding: PR #4410's warnInvalidWindows validates only a window's start/end. An invalid timezone is swallowed by windowActive's Intl catch (window never matches, silent; inverted gate = permanently eligible), an unrecognized daysOfWeek name never matches, and a non-array daysOfWeek is treated as all days — silently widening the window.
Verified against main: faeee69 (contents-API read of bin/opencode-route-proxy.mjs — warnInvalidWindows :619, windowActive :641, Intl catch :647-657, days normalization :660-664; dedupe: "route-proxy timezone" / "warnInvalidWindows" -> nothing; "model_route_windows" -> only closed #4259, whose scope was start/end times exclusively)
Evidence: hidden_files/pr-review-2026-11-17-0118-code-b/issue-4410-window-tz-days-body.md + pr-4410.diff + pr-4410-view.json
kind/bug,task/triage,status/needs-triage,source/pr-diff-review,priority/normal,queue/queued,app/opencode-route-proxy
dezren39 commentedon Nov 17, 2026
Agent: triage-step
state: triaged
Verdict: task/small-fix — extend
warnInvalidWindowsinbin/opencode-route-proxy.mjsso a window'stimezoneanddaysOfWeekare validated at load, not just itsstart/end.daysOfWeekwidening to every day) is why it is not low.warnInvalidWindows(bin/opencode-route-proxy.mjs:619), also try constructingIntl.DateTimeFormatwith a presenttimezoneand check a presentdaysOfWeekis an array of recognized weekday names, naming the window and the offending value consistent with the existing start/end warning.daysOfWeekwindow are each named in the load log; evaluation behavior for valid windows (including the route-proxy: overnight window gates check daysOfWeek against the wrong day — the after-midnight leg follows the calendar day, not the day the window opened #3874 wrapping cases and windows with notimezone/daysOfWeek, defaulting to UTC / all days) is unchanged;node --test bin/opencode-route-proxy.test.mjspasses.repo-health:v1:fix:developing-today/code:issue:11176, priority 40, small_fix), read back in the enqueue response (status queued); queue signal refreshed.dezren39 commentedon Nov 18, 2026
agent-note:v1
lane: oc-code-06 · worker repo-worker-code · queue task 20714
state: picked-up → triaged
Fresh verification: #11176 is CLOSED with status:done; the triage finding and fix packet are already documented in its comments, and follow-up task 20719 exists (timeline: claimed then completed). PR #4410 is MERGED, but only fixed #4259 start/end validation; issue #11176 explicitly captures timezone/daysOfWeek residuals and routes them to the fix packet. No code changes or worktree were needed.
dezren39 commentedon Nov 18, 2026
agent-note:v1
lane: oc-code-06 · worker repo-worker-code · queue task 20714
state: done
Completed triage from the fresh issue evidence: #11176 is CLOSED with the timezone/daysOfWeek validation gap documented. PR #4410 is MERGED but covered only start/end validation. Follow-up small-fix task 20801 was created by queue completion; earlier task 20719 is historical and already terminal. No worktree or code changes were made.