Skip to content

Back off VCS remote refresh failures#2686

Merged
juliusmarminge merged 1 commit into
mainfrom
t3code/4767b3e9
May 14, 2026
Merged

Back off VCS remote refresh failures#2686
juliusmarminge merged 1 commit into
mainfrom
t3code/4767b3e9

Conversation

@juliusmarminge
Copy link
Copy Markdown
Member

@juliusmarminge juliusmarminge commented May 14, 2026

Summary

  • Added exponential backoff for repeated VCS remote refresh failures, with a 30s base delay and a 15m cap.
  • Preserved the configured refresh interval as the minimum delay when it is larger than the computed backoff.
  • Reset the failure counter after a successful refresh and log the next retry delay on failures.
  • Added unit coverage for the backoff calculation.

Testing

  • Not run locally.
  • Added VcsStatusBroadcaster.remoteRefreshFailureDelay assertions covering exponential growth, configured-interval floor, and max-delay capping.

Note

Medium Risk
Changes the remote status polling loop timing and retry behavior, which could affect refresh frequency and load if the schedule math is wrong. Logic is contained and covered by a new unit test for delay calculation.

Overview
VCS remote status auto-refresh now backs off exponentially on consecutive failures (30s base, capped at 15m), while still honoring any larger configured refresh interval as a minimum delay.

The remote poller loop was reworked to track consecutive failures, reset the counter on success, and log retry metadata (failure count and next delay); a focused unit test was added for remoteRefreshFailureDelay.

Reviewed by Cursor Bugbot for commit 8b65c8c. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Back off VCS remote refresh failures exponentially in makeRemoteRefreshLoop

  • Adds remoteRefreshFailureDelay to compute per-attempt delay: exponential backoff starting at 30s, capped at 15 minutes, and never faster than the configured interval.
  • Refactors makeRemoteRefreshLoop in VcsStatusBroadcaster.ts to track consecutive failures and apply the computed backoff delay instead of a fixed polling interval.
  • On failure, logs a warning with cwd, cause, consecutiveFailures, and nextDelayMs; resets the counter on success.
  • Behavioral Change: a zero configured interval no longer stops looping — it still polls at the 30s base delay.

Macroscope summarized 8b65c8c.

- Exponentially delay retry attempts after refresh errors
- Honor the configured interval when it is already larger
- Add coverage for the new backoff calculation
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 14, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 08deba25-2ede-4343-b73b-c528c43bc789

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch t3code/4767b3e9

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels May 14, 2026
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp Bot commented May 14, 2026

Approvability

Verdict: Approved

Self-contained bug fix adding exponential backoff for VCS remote refresh failures. The change is well-tested, limited in scope to a single broadcaster component, and authored by the primary contributor to this file.

You can customize Macroscope's approvability policy. Learn more.

@juliusmarminge juliusmarminge merged commit 4120e94 into main May 14, 2026
12 checks passed
@juliusmarminge juliusmarminge deleted the t3code/4767b3e9 branch May 14, 2026 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant