GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(9378-stage2): record time-of-day window context on route_attempt by dezren39 · Pull Request #14523 · developing-today/code

Conversation

@dezren39

@dezren39 dezren39 commented Nov 24, 2026 •
edited by blacksmith-sh Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Stage 2 of #9378 (time-of-day aware routing). Stage 1 (policy spec) merged as #11797; this packet implements the live half of the issue acceptance per that spec (§2.1 schema additions, §4.1 measurement).

What changed (additive only — no routing-behavior change)

The background route already switches preference by window (MiMo leads in the DeepSeek peak windows Mon–Fri 01:00–04:00 + 06:00–10:00 UTC, Flash off-peak). This change makes the switch visible in the ledger:

  • bin/opencode-route-proxy.mjs: optional window class (peak/off-peak/preburn, absent = peak), route-level windows bindings, and window_names/window_class/holiday/priority_band recorded on every route_attempt. Migration-safe: best-effort ALTER TABLE … ADD COLUMN, legacy INSERT fallback, read-only/shared stores keep recording without the columns. The ledger can never fail a completion.
  • bin/check-opencode-route-rules.mjs: class closed-vocabulary + binding validation (WINDOW_CLASSES export).
  • .opencode/opencode.jsonc: "class": "peak" on both DeepSeek windows; background binds ["deepseek-peak-early", "deepseek-peak-late"]. Recording only — ranking still comes from the existing gated positions.
  • Tests: 5 new proxy tests (pinned-clock peak→off-peak switch flips LEAF-A→LEAF-B with peak→neutral rows; unbound multi-match with peak-outranks-preburn precedence; off-peak vocabulary; unknown-class warns but still gates; G2 walled peak lead stays walled under a window and the failover row still carries peak state) + 1 checker test. Suites: 90/90 proxy, 53/53 checker, route-rule guard passes on the shipped config.

Acceptance mapping

  1. One live pool demonstrably switching by window, with route_attempt evidence — the production background pool's gates are live in config (checker-verified); the switch is demonstrated end-to-end (pinned-clock dispatch flips the lead AND the ledger rows carry the window state, including the G2 failover case). Live-ledger check (read-only, trailing 14d): the switch fired in production (opendesign/mimo-v2.6-flash led two in-peak attempts on 2026-11-13 08:45 UTC).
  2. Analytics before/after burn-by-hour — BEFORE (trailing 14d, route_id='background', 954 attempts): peak windows contain 4 attempts (2 mimo-family, 2 other; 0 deepseek-family) vs 950 off-peak. Queue work runs Fri-evening/Sat UTC batches, almost never inside peak hours — so the before picture is near-zero peak burn and the after comparison needs a 2-week re-measure once peak-hour traffic exists. Rerun SQL (replace the date bound):
SELECT
  CASE WHEN (CAST(strftime('%w', datetime(time_started/1000,'unixepoch')) AS INT) BETWEEN 1 AND 5
    AND ((strftime('%H:%M', datetime(time_started/1000,'unixepoch')) >= '01:00'
      AND strftime('%H:%M', datetime(time_started/1000,'unixepoch')) < '04:00')
     OR (strftime('%H:%M', datetime(time_started/1000,'unixepoch')) >= '06:00'
      AND strftime('%H:%M', datetime(time_started/1000,'unixepoch')) < '10:00')))
  THEN 'peak' ELSE 'off-peak' END AS window_class,
  provider_id, model_id, COUNT(*) AS attempts,
  SUM(COALESCE(tokens_input,0)+COALESCE(tokens_output,0)) AS tokens,
  ROUND(SUM(COALESCE(cost_usd,0)),4) AS cost_usd
FROM route_attempt
WHERE time_started >= (strftime('%s','now','-14 days')*1000) AND route_id = 'background'
GROUP BY 1,2,3 ORDER BY 1,2,3;

After this change the same comparison can additionally group by the recorded window_class column directly. Follow-up re-measure will be tracked separately.
3. Guardrails hold — G1: non-background routes record interactive, background records batch; priority never demotes (recording only). G2: tested — a walled peak lead is not attempted under its window. G3/G4: no eligibility or quota-rule code touched; all fallbacks reachable as before (guard passes).

Closes #9378 (with the after-window re-measure as a dated follow-up, since a 2-week after window cannot exist yet).

{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-24T18:09:14Z",
    "session_id": "ses_e5df15b469bffeTncdoSwmGYrl",
    "lane": null,
    "host": "amd",
    "worktree": "/home/user/git/code-h-9378-stage2",
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": {
      "kind": "worktree",
      "id": "/home/user/git/code-h-9378-stage2",
      "repo": "developing-today/code",
      "branch": "oc-code-h/9378-stage2-live-switch",
      "sha": "979a47ae05477680d553ceec56ff52e27008fe49"
    },
    "auth_subject": "oc-code-02",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@dezren39
feat(9378-stage2): record time-of-day window context on route_attempt
979a47a
Stage 2 of #9378: the live half of the stage-1
time-of-day routing spec. The background route already switches
preference by window (MiMo leads in the DeepSeek peak windows, Flash
off-peak); this change makes the switch visible in the ledger per the
spec §4.1, with no routing-behavior change:

- proxy: optional window `class` (peak/off-peak/preburn, default
  peak), route `windows` bindings, and window_names/window_class/
  holiday/priority_band recorded on every route_attempt (migration-safe
  ALTERs, legacy fallback so the ledger never fails a completion)
- checker: class vocabulary + binding validation
- config: class peak on both DeepSeek windows; background binds them
- tests: pinned-clock peak/off-peak switch, class precedence, unknown
  class warn-still-gates, G2 walled-leg-stays-walled under a window

Before analytics (live ledger, trailing 14d, read-only): background
route ran 954 attempts, only 4 inside peak windows (queue work runs
Fri-evening/Sat UTC batches) — the switch fires (MiMo led in-peak on
2026-11-13) but peak traffic is ~nil, so the after comparison needs a
2-week re-measure once peak-hour traffic exists.
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

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 4 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: 2dc669e9-85a2-40bc-bf64-9c20cd78b998
Commits

Reviewing files that changed from the base of the PR and between 8b94770 and 0437ba1.

Files selected for processing: 5

  • .opencode/opencode.jsonc
  • bin/check-opencode-route-rules.mjs
  • bin/check-opencode-route-rules.test.mjs
  • 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

  • X
  • Mastodon
  • Reddit
  • LinkedIn
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Nov 24, 2026
9378 after-measure (2026-12-10): before/after burn-by-hour for the time-of-day window switch #14524
Open
fleet: ready PRs are left unmerged (20 open; the merge sweep has filed nothing since 2026-11-17) #12280
Open
@dezren39
Merge remote-tracking branch 'origin/main' into agent-next-27-local/r…
95b39b6
…eview-14523
@dezren39

dezren39 commented Nov 26, 2026

Copy link
Copy Markdown
Member Author

agent-next-27-local update: refreshed this branch with a merge of current main (95b39b6bf8b), rechecked the five-file diff and whitespace. Focused proxy/checker tests plus the route-rule guard are running remotely: https://github.com/developing-today-forks/fleet/actions/runs/45887612250. I will merge after the run reaches a successful terminal result.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dezren39

dezren39 commented Nov 26, 2026

Copy link
Copy Markdown
Member Author

Verification update: the first runner image did not include node, so that run failed before invoking the tests. I restarted the focused checks under Node.js 24: https://github.com/dezren39/fleet/actions/runs/45888281056. The PR remains unmerged until the checks finish.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dezren39
Merge remote-tracking branch 'origin/main' into agent-next-27-local/r…
0437ba1
…eview-14523
@dezren39

dezren39 commented Nov 26, 2026

Copy link
Copy Markdown
Member Author

Main advanced once more while checks were running, so I refreshed the branch again with current main (0437ba175b5) and reran the same focused tests plus route-rule guard. Latest run: https://github.com/dezren39/fleet/actions/runs/45889700234. I will merge after it completes.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dezren39
dezren39 merged commit 40b771f into main Nov 26, 2026
2 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@dezren39
dezren39 deleted the oc-code-h/9378-stage2-live-switch branch November 26, 2026 20:22
@dezren39 dezren39 mentioned this pull request Nov 26, 2026
Time-of-day aware routing: peak/off-peak pool, model, and effort selection #9378
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Time-of-day aware routing: peak/off-peak pool, model, and effort selection

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@dezren39
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.