Repository navigation
Description
Summary
bin/opencode-route-proxy.mjs's window-time parser accepts out-of-range times and silently reinterprets them: parseHHMM (bin/opencode-route-proxy.mjs:398-401) only checks the shape ^([0-9]{1,2}):([0-9]{2})$ and returns hour * 60 + minute with no range check, so 24:60 parses to 1500 and 99:99 to 6039. Nothing else validates the windows either — normalizeWindowGate (:372-377) only extracts the gate name/invert flag, and the window definitions come straight from config (model_route_windows, :175).
Verified behavior (this run)
Probe on the laptop (~/git/fleet/probe-2026-11-02-laneB-routewindow/) extracted parseHHMM + windowActive verbatim from the real file @ 6cdfaee (md5 c7ad071278474a5b4bfe0a181714cc0e) and ran them:
parseHHMM('09:30') = 570(control, correct);parseHHMM('24:60') = 1500;parseHHMM('99:99') = 6039— all accepted.- Window
99:99–99:98(a wrapping window) is active at Mon 12:00 UTC: the wrap branch (mins < end, :443-447) is true for every real wall minute (max 1439 < 6038), so a nonsense window is effectively always-on — and withinvert: trueon the gate, always-off. - Window
25:00–26:00is never active (no wall minute reaches 1500 in the non-wrapping branch) — a typo'd window silently kills the route target, or, inverted, makes it permanently eligible. - Window
09:00–24:60behaves as if it had no end (active at 23:30), silently extending a curfew-style gate past its intent.
Why it matters
Window gates decide which model routes are eligible at which times (quota windows, overnight routes). A single typo in a window definition does not fail at startup or log anything — it silently flips a gate to always-on, always-off, or end-less, which misroutes traffic in exactly the hours the window exists to control. The fleet already treats this shape as a bug in the sibling surface: aggregator mergeQuiet accepting 99:99/24:60 is filed as #3686. This is the same class in the route proxy, which has never had the range check.
Acceptance criteria
parseHHMM(or window loading, one place) rejects hour > 23 and minute > 59 — a window with an out-of-range start or end is not silently reinterpreted.- The failure mode is visible: an invalid window definition is refused/logged by name at config load (consistent with how this proxy surfaces other config errors), rather than the gate quietly evaluating as always-on/always-off.
- Regression tests in
bin/opencode-route-proxy.test.mjs:24:00,24:60,99:99,25:00as start and as end are rejected/refused; valid boundary windows00:00,23:59, and 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-window cases still evaluate as before. - Existing route-proxy tests pass (
node --test bin/opencode-route-proxy.test.mjs).
Dedup / related
- aggregator(alerts): mergeQuiet accepts out-of-range times (99:99, 24:60) — a malformed quiet window is silently reinterpreted instead of falling back to the default #3686 (open) is the aggregator's quiet-window parser, a different file and surface; this issue is the route proxy's own parser.
- 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 (closed) fixed the wrapping window's day attribution in this same
windowActive; it did not add range validation. - opencode-route-proxy: normalizeTarget drops target 'window' gates — no window handling exists in the proxy (PR #2549 Codex P2 unaddressed) #3225 (closed) added window gates to this proxy; no range check was part of it.
Activity
dezren39 commentedon Nov 2, 2026
agent: new-issue-creator-code-b
state: filed
issue: 4259
Filed this run after verification on current main (6cdfaee). Found via: read of bin/opencode-route-proxy.mjs (parseHHMM :398-401 has shape-only validation; normalizeWindowGate :372-377 and the config load at :175 add no range check) plus a laptop probe (~/git/fleet/probe-2026-11-02-laneB-routewindow/, verbatim extraction from the real file, md5 c7ad071278474a5b4bfe0a181714cc0e): parseHHMM('24:60')=1500 and parseHHMM('99:99')=6039 are accepted; the wrapping window 99:99-99:98 evaluates active at Mon 12:00 UTC (always-on in practice), 25:00-26:00 never evaluates active, and 09:00-24:60 stays active at 23:30 (end-less).
Dedup: #3686 is the aggregator mergeQuiet parser (different surface); #3874 fixed this function's wrap-day attribution, not ranges; #3225 introduced the gates. Labels: kind/bug, queue/queued, source/creator, task/triage, status/needs-triage, priority/normal, app/opencode-route-proxy, effort/s. A repo-task/v1 triage packet is enqueued to repo-health-code-pilot in the same run. Filed-only (not self-solved): the fix involves a config-load failure-mode choice that triage should settle.
dezren39 commentedon Nov 2, 2026
🤖 Agent note · picked up
dezren39 commentedon Nov 2, 2026
🤖 Agent note · done (triage)
06ea8c8328a0757fd1ab98378357a4048679c4f3withparseHHMM/windowActiveextracted verbatim frombin/opencode-route-proxy.mjsand probed on the laptop:parseHHMM("24:60")=1500,parseHHMM("99:99")=6039,parseHHMM("24:00")=1440— all accepted; window99:99-99:98is active Mon 12:00 UTC (always-on wrap),25:00-26:00never active,09:00-24:60still active at 23:30 (end-less); control09:00-17:00correct. Ruling: fix at one place — range-check insideparseHHMM(return null for hour>23/minute>59;windowActiveat :410-414 already fails closed on null) — plus a config-load validation pass overmodel_route_windows(:175) that names the offending window, so a typo is loud instead of silently evaluated. Regression tests per the acceptance list (24:00/24:60/99:99/25:00 refused as start and end; 00:00/23:59 and 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 wrap cases unchanged). Routed as task 6133.dezren39 commentedon Nov 2, 2026
6133 progress: fix pushed on branch queue/6133-4259-proxy-window-times, PR #4410.
Fix #4259: range-check proxy window times, name bad windows at load
Merge pull request #4410 from developing-today/queue/6133-4259-proxy-…
dezren39 commentedon Nov 2, 2026
🤖 Conductor binding · manual dispatch wave (Drew-ordered queue unblock) 2026-11-02
small_fix— "Fix 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: range-check opencode-route-proxy window times (reject hour>23/minute>59) and name bad windows at config load") ↔ issue 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 #4259ses_e5e63297d8affeIzgWS64fb72S(laptop OpenChamber, agent build)opencode-route/workhorse(route id only; pooled route, no single-plan direct seat). Gate: fresh laptop quota read this run ~09:09 CST — meta 5h 8% / weekly 2%, codex weekly 80%, openai.alternate 5h 0% / weekly 0% — Workhorse OPEN; plan quotas only, never PAYG.~/git/fleet/6133-4259-proxy-window-timeson the laptop, branchqueue/6133-4259-proxy-window-times(from origin/main d1de7ee)queuedin the fleet queue (there is no targeted claim/binding verb yet — code#1337 / openchamber#1272); the dispatch is recorded in the task's progress. The owning lane reconciles/harvests from here, and the conductor shepherds the session.