Skip to content

fix(cron): keep scheduled jobs when delivery channels go offline - #153

Merged
adriannoes merged 4 commits into
developmentfrom
fix/cron-channel-availability
Nov 26, 2026
Merged

adriannoes merged 4 commits into
developmentfrom
fix/cron-channel-availability

Conversation

@adriannoes

@adriannoes adriannoes commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Keep saved jobs enabled while a channel is unavailable, including extension channels. Scan past these jobs so that ready jobs can run. Require registration when a user creates a job for an extension channel.
  • Deliver heartbeat jobs through the configured log or CLI. Saved heartbeat jobs wait while there is no local destination. Keep saved local jobs with recipient strings of 64 bytes or more.
  • Reject new WebChat jobs and disable saved WebChat jobs when they are due. Keep their data. A gateway restart can reuse a connection ID for another client.

If a send fails after the agent runs, a later poll can run the agent and its tools again.

Test plan

  • On Ubuntu 24.04 ARM64, make static and CI=true GATEWAY=1 make -j3 test passed.
  • test_cron passed 28 tests, including legacy local delivery, extension recovery, and 65 waiting jobs ahead of a ready job. The tests cover rejection of truncated channel names and remote recipients.
  • test_memory, test_heartbeat, test_dispatch, test_gateway_db_lock, and test_gateway_http passed with CI=true GATEWAY=1. The gateway returned HTTP 400 for a new WebChat job.
  • After a restart without its extension, an existing job stayed enabled. It delivered after the extension returned.
  • Jobs saved with 64-byte recipients before the upgrade reached the CLI and both local heartbeat destinations. An invalid Telegram job kept its stored data.

Replaces #137

@adriannoes adriannoes added bug Something isn't working review: changes needed The code review found a problem to fix before merge. labels Nov 26, 2026
@adriannoes adriannoes self-assigned this Nov 26, 2026
@adriannoes adriannoes added review: ready for approval The code is ready for the required GitHub approval. and removed review: changes needed The code review found a problem to fix before merge. labels Nov 26, 2026
@adriannoes
adriannoes merged commit 0cac969 into development Nov 26, 2026
1 check passed
@adriannoes
adriannoes deleted the fix/cron-channel-availability branch November 26, 2026 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working review: ready for approval The code is ready for the required GitHub approval.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant