Skip to content

feat(scheduler): retry mechanism for failed scheduled executions (#271) - #332

Merged
vybe merged 1 commit into
mainfrom
feature/271-scheduler-retry
Apr 14, 2026
Merged

vybe merged 1 commit into
mainfrom
feature/271-scheduler-retry

Conversation

@vybe

@vybe vybe commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add configurable automatic retry for failed scheduled executions
  • Default: 1 retry with 60s delay (new schedules). Existing schedules: 0 retries (opt-in via migration)
  • Rate-limited (429) failures use 2x delay, capped at 300s
  • Each retry creates a new execution record with full observability (linked via retry_of_execution_id)
  • Retries survive scheduler restart (persisted to DB, recovered on startup)

Changes

Schema (4 new columns across 2 tables):

  • agent_schedules: max_retries, retry_delay_seconds
  • schedule_executions: attempt_number, retry_of_execution_id, retry_scheduled_at

Backend: Migration, db operations, Pydantic models
Scheduler: Retry logic (_maybe_schedule_retry, _execute_retry, _recover_pending_retries)
MCP: create_agent_schedule and update_agent_schedule accept retry params
Frontend: Retry config in schedule form, pending_retry status styling

Test Plan

  • Create schedule with max_retries=2, trigger execution that fails
  • Verify retry fires after configured delay
  • Verify 429 errors use 2x delay
  • Restart scheduler mid-retry, verify recovery
  • Verify execution history shows attempt numbers and links

Closes #271

Generated with Claude Code

Add configurable automatic retry for failed scheduled executions:
- New schedule fields: max_retries (0-5, default 1), retry_delay_seconds (30-600, default 60)
- New execution fields: attempt_number, retry_of_execution_id, retry_scheduled_at
- New status: pending_retry (retry scheduled but not yet fired)
- Rate-limited (429) failures use 2x delay, capped at 300s
- Retries persist to DB and survive scheduler restart
- Existing schedules migrated with max_retries=0 (opt-in)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(scheduler): retry mechanism for failed scheduled executions

1 participant