fix(ws): broadcast cron job results to WebSocket clients in real-time#1099
Open
nimitbhardwaj wants to merge 1 commit intoRightNow-AI:mainfrom
Open
fix(ws): broadcast cron job results to WebSocket clients in real-time#1099nimitbhardwaj wants to merge 1 commit intoRightNow-AI:mainfrom
nimitbhardwaj wants to merge 1 commit intoRightNow-AI:mainfrom
Conversation
Fixes RightNow-AI#1088 - scheduled task results now appear in web UI without page refresh.
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.
Summary
Fixes #1088 — Scheduled task results now appear in the web UI in real-time via WebSocket push, without requiring a page refresh.
Problem
When a cron job fires, the result was only delivered to configured channels (Telegram, etc.) via
cron_deliver_response. WebSocket clients had no mechanism to receive these results — they had to refresh the page to see cron output.Solution
Backend
ws.rs). Connections register on connect and deregister on disconnect.SystemEvent::CronJobExecutedvariant emitted bycron_run_jobafter the agent loop completes.start_ws_cron_broadcaster()subscribes to the kernel event bus and broadcasts to all active WebSocket connections for the relevant agent.cron_deliver_response(unchanged), and now also broadcast to WebSocket.Frontend
type: "message"events from server — these display as user messages (left side) with[Scheduled: job_name]label.Testing
Breaking Changes
None.