Commit Graph
2 Commits
Author SHA1 Message Date
yetone 077e7e0b79 gui tests: routing-manual and routing-time follow the group editor's hints under Routing — a802d98b (#576) added a second hint under the editor's Routing segs (a group among the models keeps its own routing), so routing-manual's row.locator(".hint") matched two and failed strict mode, and the taller editor put Add a rule below the fold in routing-time, where Playwright's scroll into view is put back by the app (only the reader moves the view) and the click timed out. The UI change was deliberate: routing-manual reads the routing's own hint as the row's first .hint, and routing-time wheels Add a rule into the middle of the view first, as routing-manual already does for its rows. All 30 routing-*.test.cjs (85 tests) pass in WebKit; no app code changed. 2026-10-04 09:38:13 +08:00
yetone 6bf1c3987f routing: a group's rule can hold hours of the day (Discord: send DeepSeek's or GLM's peak-price hours to another provider) — a rule takes time: {from, to, days} in this computer's local time, HH:MM to HH:MM; hours that end before they begin run past midnight and belong to the day they begin on (Friday's 22:00–08:00 takes Saturday's early hours), days are optional, and the hours are checked as a turn begins, so a turn that began inside them finishes where it went. The rule reads "time 09:00–18:00 Mon–Fri" on the group and in the trace; the editor types the hours into one pill (从 … 到 …), notes past midnight, marks a time that isn't one and picks days like the agents (every day, weekdays, weekends, or each); magpie group rule add … time=14:00-18:00 days=mon-fri and the TUI's rule line take it too. Older versions ignore the field, and a rule with only hours then matches nothing there. TestRuleTimeMatches and TestRuleTimeWindowAtTurnStart (injected clock) and routing-time.test.cjs fail without the change. A sandbox magpie with two fake vendors sent a request inside the hours to the rule's member and one outside them, or on another day, to the first. go vet, go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui ./... pass; routing-time, routing-compact, routing-manual, routing-steady, settings-groups, click-scroll, old-webkit pass. 2026-10-01 15:04:16 +08:00