Skip to content

fix: scheduler retries once on GitHub API timeout#11

Merged
HainingYin merged 3 commits into
mainfrom
fix/scheduler-retry-timeout
Jul 3, 2026
Merged

fix: scheduler retries once on GitHub API timeout#11
HainingYin merged 3 commits into
mainfrom
fix/scheduler-retry-timeout

Conversation

@HainingYin

Copy link
Copy Markdown
Contributor

Summary

  • Adds a scheduled handler to the Cloudflare Worker that polls configured GitHub repos for labeled issues
  • When a GitHub API call times out (AbortError from AbortController, or HTTP 408), the scheduler retries once before skipping the repo for that poll cycle
  • Non-timeout errors are logged and the repo is skipped immediately (no retry)

Details

The previous Python scheduler (bot/scheduler.py, removed in 73b9cf8) silently skipped repos on timeout with no retry. This implementation adds fetchIssuesWithRetry() which wraps fetchGitHubIssues() with a single retry on timeout errors.

New env vars:

  • GITHUB_TOKEN — PAT for GitHub API access
  • REPOS_TO_POLL — comma-separated owner/repo list
  • POLL_LABEL — issue label filter (defaults to "claude")

Closes #5

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

HainingYin and others added 3 commits July 3, 2026 09:39
Four fixes:

1. (#7) policy_decision events now use matching action's timestamp (+1ms)
   instead of record.created_at_ms. Prevents hash chain breakage after
   timestamp sort.

2. (#6) toEvents() accepts optional { prevHash } parameter. New
   toEventsBatch() maintains hash chain continuity across record boundaries.

3. (#8) Worker inline /audit endpoint auto-derives declared_capabilities
   from tool_call events. Prevents OAA-R-CAP-001 from firing on every
   legitimate tool call when no explicit manifest is provided.

4. (#9) toEvents() populates evidence.evidence_id = event_id. Fixes
   scoring engine deducting -5 per event for missing evidence_id.

Fixes #6, #7, #8, #9

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ndalone)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When the scheduled poll cycle encounters a timeout (AbortError or HTTP 408)
from the GitHub API, it now retries the request once before skipping the
repo. This prevents transient network issues from causing an entire poll
cycle to silently miss a repository.

Closes #5

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@HainingYin HainingYin requested a review from telleroutlook as a code owner July 3, 2026 07:59
@HainingYin HainingYin merged commit aa7a737 into main Jul 3, 2026
2 checks passed
@HainingYin HainingYin deleted the fix/scheduler-retry-timeout branch July 3, 2026 07:59
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.

fix: scheduler should retry on GitHub API timeout

1 participant