Skip to content

fix(opencode-route-proxy): load-time window warning covers only start/end — invalid timezone or malformed daysOfWeek still silently never-matches or widens to every day (PR #4410 residual of #4259) #11176

Closed

Description

@dezren39

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) makes windowActive throw inside Intl.DateTimeFormat, the catch returns false, and the window never matches — forever, silently. With invert: true on the gate, the target becomes permanently eligible.
  • A daysOfWeek entry 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 as null = every day, silently widening the window to days it was meant to exclude.

Evidence (verified on current main faeee690b27e9728e05319368d2904774f2308d6)

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 whose timezone is present but not a valid Intl timezone, and a window whose daysOfWeek is 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-daysOfWeek window 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 no timezone/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

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/triageQueue packet kind: verify, reproduce, and route this item
    priority/normalOrdinary priority (the default)
    on Nov 17, 2026
  2. developing-today commented on Nov 17, 2026

    @developing-today
    Contributor
  3. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor

    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

  4. added
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    effort/sSmall: expected under 2 hours of work
    and removed
    task/triageQueue packet kind: verify, reproduce, and route this item
    on Nov 17, 2026
  5. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor

    Agent: triage-step
    state: triaged

    Verdict: task/small-fix — extend warnInvalidWindows in bin/opencode-route-proxy.mjs so a window's timezone and daysOfWeek are validated at load, not just its start/end.

  6. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed on Nov 18, 2026
  7. dezren39 commented on Nov 18, 2026

    @dezren39
    MemberAuthor

    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.

  8. dezren39 commented on Nov 18, 2026

    @dezren39
    MemberAuthor

    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.

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

Metadata

Metadata

Assignees

Labels

app/opencode-route-proxybin/opencode-route-proxy.mjs fleet proxyeffort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)roadmap/fleet-healthRoadmap program: fleet-healthsource/pr-diff-reviewFiled by the pr-diff-review jobstatus:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions