Repository navigation
Todo
Labels
priority-p3Nice-to-havestatus-in-progressCurrently being worked ontheme-reliabilityTheme: Reliabilitytype-bugBug fix
Description
Summary
The standalone scheduler publishes schedule_execution_started, schedule_execution_completed and schedule_execution_skipped to the Redis pub/sub channel scheduler:events (SchedulerService._publish_event, nine call sites in src/scheduler/service.py). Nothing subscribes to that channel. The events never reach the UI WebSocket or the Trinity Connect stream (/ws/events), though the docs say the backend relays them.
Context
- The embedded scheduler used to broadcast through
manager.broadcastandfiltered_manager.broadcast_filtered. Commit22b8f6d76(2026-02-11, "Consolidate scheduler into dedicated service") removed those callbacks fromsrc/backend/main.pyand left a note that the backend subscribes to the Redis channel. No subscriber was added, then or since: no commit has the stringscheduler:eventsoutsidesrc/scheduler/,docker/scheduler/, the tests and the docs, andsrc/backendhas never calledpubsub(). - On a running local instance
PUBSUB NUMSUB scheduler:eventsanswers 0, and there are no pattern subscriptions. - What still works: a scheduled run goes through the backend's task path, which broadcasts
agent_activity(schedule_start/schedule_end), soscripts/trinity-listen.sh <agent> completedstill fires on that event. - What nobody hears live: a skipped run (one a gate held back, for example). It has no backend activity, so the scheduler's event was its only live signal.
- Docs that describe the relay:
docs/memory/feature-flows/scheduling.md: "The backend subscribes to thescheduler:eventsRedis channel and relays events to both WebSocket managers"docs/memory/feature-flows/trinity-connect.md: listsschedule_execution_completedas a/ws/eventseventdocs/memory/feature-flows/scheduler-service.md,activity-stream.md,agent-network.md,webhook-triggers.md- the
/ws/eventsdocstring insrc/backend/main.py
- Found while reviewing fix(scheduler): a restart keeps following the runs that were in flight (#4410) #4807, whose restart recovery publishes the completion event again.
Acceptance Criteria
- One of the two:
- (a) the three events reach
/ws/eventsand the UI socket through the event bus (Invariant Feature/process engine #10); or - (b) the publisher, the
PUBLISH_EVENTSsetting and the doc claims are removed, and the docs name the event a listener should use instead.
- (a) the three events reach
- If (a): a test that goes from a scheduler event to a
/ws/eventsclient, including the per-agent filter (a listener gets no event for an agent it cannot open). - A skipped run is either visible live, or the docs say it is not.
- The docs listed above match the code.
Technical Notes
PUBLISH_EVENTS=trueis set indocker-compose.yml,docker-compose.prod.yml,docker-compose.hosted.ymlanddocker/scheduler/docker-compose.test.yml;src/scheduler/config.pyreads it.- For (a): the scheduler cannot import the backend. The event bus is the Redis stream
trinity:events(src/backend/services/event_bus.py). Writing to it from the scheduler means a second copy of the envelope format; an internal backend route keeps one writer. /wsis unfiltered and/ws/eventsis filtered per agent (FilteredWebSocketManager), so the payload should carry identifiers only (feat: agent-reported structured reports via MCP + dashboard display #918).- No frontend code handles these event types today (
src/frontend/srchas no reference to them).
Metadata
Metadata
Assignees
Labels
priority-p3Nice-to-havestatus-in-progressCurrently being worked ontheme-reliabilityTheme: Reliabilitytype-bugBug fix
Activity
webmixgamer commentedon Nov 27, 2026
/claim
github-actions commentedon Nov 27, 2026
Claimed by @webmixgamer. Label
status-in-progressadded.Next steps:
feature/4813-<short-slug>Fixes #4813fix(executions): pace the socket-driven list refresh; docs follow the…