Repository navigation
fix(ui): reject schedules the parser can't read instead of guessing - #5569
Conversation
The Agent UI schedule parser silently dropped what it didn't understand: "tomorrow at noon" became a daily job, "daily at 25:00" lost its time, "on feb 30 at 9am" ran daily, and "every 1s" ran a full agent turn every second. It now reads every word or rejects the schedule with a plain fix. - Invalid times, dates, one-time phrasing, leftover words, and runs more often than once a minute are rejected with an actionable message. - "every other <unit>" is an interval of 2; "every other tuesday" and intervals that can't combine with a time or set days are rejected. - "every tuesday" now first runs on the next Tuesday, not a week later. - Saved schedules keep their stored config and load unchanged. - Schedule form: visible field labels, the rejection reason is shown and tied to the field, and Delete's confirm window is 8 s with its timer cleared on re-arm and unmount.
|
Verdict: Request changes. The code is sound; the only thing missing is proof from the real app. The scheduler used to quietly guess at schedules it couldn't fully read. Blocking:
Worth knowing (not blocking): Real-world evidenceN/A: no evidence bundle was produced for this run, and the PR shows none for the UI or the API. The verdict rests on static review, plus the parser probe described under Technical details. No Agent UI or HTTP path was exercised here. 🔍 Technical detailsParser probe. I loaded 🟡 No UI or API evidence for a user-visible change. See the blocking item above. The rubric asks for a screenshot for Agent UI changes, or at least the underlying HTTP route evidence. 🟢 🟢 🟢 Leftover string concatenation ( Strengths
|
|
Merge note: #5538, #5539 and #5569 all touch the schedule form, so the second and third to merge need two small test updates (no product-code conflict beyond one message). 🔍 Technical detailsFound while building all three together:
|
|
Checked live in the Agent UI's New schedule form: impossible schedules are refused with the reason, and weekly ones get the right next run. 🔍 Technical details
|
parse_interval had no production caller once create_task stopped falling back to it, and it still accepted forms the real parser refuses, so it is removed with its tests. The ReDoS digit-run check now targets parse_schedule_input. Joins an implicitly concatenated string that failed pylint W1404, and documents that a weekly time needs a day.
|
Fixed the red Code Quality check and took the three cleanup suggestions. The Agent UI evidence the review asked for is in this comment: a refused 🔍 Technical details
|
Tab could walk out of an open dialog and onto the page hidden behind it. In Settings, 26 presses landed on the sidebar's resize handle under the overlay, so a keyboard or screen-reader user ended up operating a page they couldn't see. Now Tab and Shift+Tab wrap inside every modal in the Agent UI, including when its content changes while open. Escape and returning focus to the opener work exactly as before. - **Covered:** Settings, Document library, Scheduled tasks, File browser, Mobile access, Version picker, Context panel, both change reviews, the commit/PR dialog, the folder picker, and the Memory beta-confirm dialog (same behaviour, now through the shared hook). - **Session panel:** trapped only in its narrow-window overlay form, where it has a backdrop and already sets `aria-modal`. Docked, it sits alongside the page and sets no `aria-modal`, so it is left alone. No `aria-modal` attribute needed correcting. - **Merge conflicts:** each component change is an import, a ref and one hook call. That keeps it light against the open PRs on DocumentLibrary (amd#5605) and ScheduleManager (amd#5538, amd#5569). ## Test plan - [x] `npx vitest run src/hooks/__tests__/useFocusTrap.test.tsx`: wraps forward and back, skips disabled and hidden elements, re-reads changed content, pulls focus in from outside, only the innermost of nested traps acts, inactive does nothing - [x] `npx vitest run src/components/settings/__tests__/SettingsDialogFocus.test.tsx`: Tab from the last control in Settings returns to the first section button - [x] `MemoryDashboard.a11y.test.tsx` still passes on the shared hook - [x] Disabling the hook makes all 8 trap tests fail - [x] Full `npx vitest run` (146 files, 1532 tests) and `npx tsc --noEmit` pass - [ ] Electron jest size check (`reasonably sized component files`): none of the touched files is close to the cap. On a Windows CRLF checkout the check fails on main for `ChatView.tsx` (101,751 bytes in git, 103,725 on disk), which this PR doesn't touch. Confirm it is green in CI. - [x] Desktop app: open Settings (Ctrl+,) and hold Tab. Focus cycles inside the dialog and never reaches the sidebar. Esc still closes it and returns focus to the opener.

"tomorrow at noon" silently became a daily job, "daily at 25:00" dropped its time, "on feb 30 at 9am" ran every day, "every tuesday" first ran a week late, and "every 1s" started a full agent turn every second. The schedule parser now reads every word or rejects the schedule with a plain fix, such as "25:00 isn't a time — use 0:00–23:59." The schedule form also gains visible field labels, shows that reason under the field, and stops resetting Delete's "Confirm?" before a slow reader can click it.
Test plan
pyteston the scheduler andgaia scheduletests (tests/unit/test_scheduler*.py,tests/unit/test_schedule_*.py,tests/integration/test_scheduler_e2e.py): 338 passed, 1 skippedpytest tests/unit/chat -n 4: 2162 passed, 4 skippedvitest run(webui): 1528 passed;tsc --noEmitcleanpython util/lint.py --black --isortand--flake8cleantomorrow at noon,daily at 25:00,every tuesday. The first two show "GAIA didn't understand that schedule." with the reason. The third previews next Tuesday.🔍 Technical details
parse_schedule_inputremoves each piece it understands (dates and one-off phrasing,at <time>,from X to Y, days, interval) and rejects anything left over. Its return contract is unchanged:interval_seconds=0plus the reason indescription.create_taskno longer falls back to the laxerparse_interval, so the API's 400 carries the same reason.gaia scheduleis cron-only, and the daemon scheduler'sKIND_ONE_SHOTisn't wired to the UI scheduler, so one-time phrasing is rejected with a recurring suggestion.MIN_INTERVAL_SECONDS). The timer tests that need 1 s schedules lower it with a monkeypatch fixture.every other <second|minute|hour|day|week>maps to an interval of 2.every other tuesdayis rejected because it needs an anchor week the config doesn't store. The same goes for a time of day combined with intervals other than daily/weekly (every 2 days at 9amused to fire daily) and for set days with multi-week intervals.from 9:30am) were silently rounded down. They are now rejected, and the existing test that asserted the rounding is updated.compute_next_run: days-only daily/weekly schedules pick the next listed day at the current clock time. Before, they added the full interval first and then walked forward, landing a week late. Other intervals keep the old path.every 2 days at 9amrow and a 1 s row.ScheduleManager.tsx: the three fields have<label htmlFor>labels. The rejection text is linked to the schedule field witharia-describedby, and the field getsaria-invalid. The Delete confirm window is 8 s (CONFIRM_DELETE_MS), its timer lives in a ref, and the timer is cleared on every toggle and on unmount.