electric-sql / electric-sql/electric

Show upcoming scheduled wakes with live countdowns

Open
#4,462 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
10.4k
Forks
375
Avg merge
3d 1h
Merged PRs (30d)
18

Description

## Summary

It would be useful for the agent UI to surface upcoming scheduled wakes, especially self-scheduled sends and cron schedules.

Examples:

- "The agent will wake again in 3:25" with a live countdown for pending self-targeted future sends.
- "Scheduled cron wake: every 5 minutes" and, if feasible, "next wake in 2:17" for cron schedules.

## Motivation

When an agent sends a message to itself with `afterMs`, or has a cron schedule configured, the timeline currently doesn't make the upcoming wake obvious. A small notice would make scheduled autonomous behavior much easier to understand and debug.

## Possible approach

### Future sends

Use manifest schedule rows:

```ts
manifest.kind === 'schedule'
manifest.scheduleType === 'future_send'
manifest.status !== 'sent'
manifest.status !== 'failed'
```

For self-wake language, additionally require:

```ts
manifest.targetUrl === entityUrl
```

Then render a compact notice with a live countdown to `fireAt`:

- `Agent will wake again in 3:25`
- `Agent is waking now…`
- optionally `Scheduled wake overdue` if still pending after `fireAt`

For future sends targeting another entity, use different copy, e.g.:

- `Will send a message to /agent/foo in 3:25`

### Cron schedules

Use manifest schedule rows:

```ts
manifest.kind === 'schedule'
manifest.scheduleType === 'cron'
```

Initial UI could display the cron expression and timezone. A follow-up could compute the next fire time client-side if the existing runtime cron helper is browser-safe/exported, or if we add a small browser-safe helper.

## Placement ideas

- Inline in the timeline as a compact schedule row.
- Entity header/status area as a persistent upcoming wake notice.
- Possibly both: header summary + timeline details.

## Notes

This should be a separate PR from the self-send wake rendering bug fix. That PR makes fired self-send wakes readable; this issue is about making upcoming scheduled wakes visible before they happen.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.