Repository navigation
fix(webui): notify when a scheduled task finishes - #7643
Closed
github-actions[bot] wants to merge 1 commit into
Closed
github-actions[bot] wants to merge 1 commit into
github-actions[bot] wants to merge 1 commit into
Conversation
A scheduled run that succeeded raised nothing, so the bell stayed empty and the answer sat unnoticed in the task's chat; only failures notified. The schedule poll now adds an info notification, linked to the task's chat, once per run that ends without an error. It waits for a run in flight to end and stays silent on the first load, as failures do. Closes #7596
2 of 3 tasks
Contributor
Collaborator
kovtcharov-amd
pushed a commit
to kovtcharov/gaia
that referenced
this pull request
Nov 12, 2026
Scheduled tasks run while the user is away, but when one finished nothing told them; only failures reached the bell. Now a run that finishes cleanly adds an unread "Scheduled task "<name>" finished" notification with the start of the answer. Runs that were already done when the app opened stay quiet, and a failed run still raises only its error. Closes amd#7596 | Before | After | | --- | --- | | <img src="https://raw.githubusercontent.com/tylerbea/gaia/pr-shots/7596/before.jpg" width="420"> | <img src="https://raw.githubusercontent.com/tylerbea/gaia/pr-shots/7596/after.png" width="420"> | ## Test plan - [x] New `stores/__tests__/scheduleStore.finished.test.ts` (3 of 5 cases fail on main), plus all store and i18n tests (192) and `npm run build` - [x] Built app with the schedule list stubbed to a finished run: the bell shows 1 unread with the finished notice - [ ] With a real model: Run now on a task, close the dialog, and see the notice arrive when it ends <details> <summary>🔍 Technical details</summary> - `scheduleStore.ts` keeps finished-run counts per schedule (`run_count` minus a run in flight, since the backend counts a run when it starts) and compares them on each load, the same way it already compared error counts. - New string `schedules.finished` in English and Arabic. - Not in this change: clicking a bell item doesn't open its chat for any notification type. The notice carries the chat id, so that can follow in `NotificationCenter`. - The after shot stubs the schedule list and setup check, because the empty scratch home can't complete a real run. </details> Note: amd#7643 is the auto-fix bot's draft for the same issue. This one adds tests and before/after shots; keep whichever you prefer. amd#7659 changes when `run_count` goes up, so whichever merges second should recheck the finished-run count here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When a scheduled task finished successfully, nothing told you. The bell stayed at "No notifications" and the answer sat unnoticed in the task's chat, because only failed runs raised a notification. Now each run that finishes cleanly adds one unread "Scheduled task "X" finished" notification to the bell. It shows the start of the answer and is linked to the task's chat. A run still in progress, a failed run, a repeat poll and old runs found at launch add nothing.
Closes #7596
Test plan
npx vitest runinsrc/gaia/apps/webuipasses (3,793 tests, including 6 new ones inscheduleStore.successes.test.ts)tsc -bis cleannpm run test:rtl, then look at the bell with the new notification in English and Arabic.🔍 Technical details
stores/scheduleStore.ts:notifyNewSuccessesruns next tonotifyNewFailureson everyloadSchedulesafter the first (App-level 30 s poll plus the dialog's 5 s poll). It compares each schedule's clean runs (run_count - error_count, minus one whilerunning) against a snapshot kept in the newcleanRunCounts.run_countwhen a run starts (ui/scheduler.py_execute_task_once), so a poll during a run would otherwise look like a success with the previous run'slast_error. While a schedule isrunning, its snapshot keeps the old value and no notification fires.schedule-done-${id}-${run_count}matches the failure pattern. Title goes throughgetT()(new keyschedules.notify.finished, en and ar). The message islast_resultcut to 200 characters.NotificationCenterdoesn't navigate onsessionIdyet. The issue's "No chats yet." sidebar gap is separate and not touched here.python util/lint.py --allreports mypy, Bandit and import-validation errors in Python files this PR doesn't touch, so they are already onmain. The Python unit suite couldn't collect on this runner (responsesisn't installed). This PR has no Python changes.