GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Back off checkpoint capture after repeated failures by yashranaway · Pull Request #4517 · pingdotgg/t3code

Conversation

@yashranaway

@yashranaway yashranaway commented Jul 25, 2026 •
edited by macroscopeapp Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

What Changed

CheckpointStore.captureCheckpoint tracks consecutive failures per workspace. After three, capture is skipped for a growing cooldown (5 minutes, doubling, capped at an hour) instead of being retried on every turn. Any success clears the record.

Why

Checkpoint capture runs a full-tree git add -A under a temporary index after every completed turn. On a repository large enough that this cannot finish inside the 30s VCS process timeout, the process is killed every single time, so the retry buys nothing and costs a great deal: one CPU core pegged for as long as any thread is in use, plus an orphaned tmp_pack_* in .git/objects/pack for every kill that lands mid-pack-write.

A skipped capture replays the failure recorded when the cooldown opened, so callers see the same error and the same missing turn-diff status they see today, and the error channel is unchanged. Three failures of tolerance keeps a transient failure (an index lock held by a concurrent git command) from disabling capture, and the hour cap means a workspace that becomes healthy is picked up again on its own.

This is the "skip-with-backoff after N consecutive capture failures" option from the issue. The other suggestions there (a disable setting, an adaptive timeout, tmp_pack_* cleanup) are deliberately left out to keep this focused.

Fixes #3646

Testing

  • vp test run apps/server/src/checkpointing/ passes (23/23). New coverage: the backoff policy itself (threshold, doubling, cap, per-workspace isolation, reset on success) and an end-to-end test driving CheckpointStore against a driver that always times out, asserting the driver is invoked exactly 3 times across 10 turns and exactly once more after the cooldown lapses
  • vp test run apps/server/src/orchestration/ passes, 214 tests total across both directories
  • pnpm typecheck in apps/server clean
  • vp lint on changed files clean

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Medium Risk
Changes when checkpoints are captured for unhealthy workspaces (skipped turns still error the same way) but reduces runaway CPU/git load; logic is well-tested and scoped to capture only.

Overview
Adds per-workspace capture backoff so repeatedly failing checkpoint captures stop spawning expensive git add work on every turn.

New CaptureBackoff tracks consecutive failures per cwd (tolerates 2, then exponential cooldown from 5 minutes up to 1 hour, LRU cap of 256 workspaces, 60s single-flight reservation after cooldown). CheckpointStore.captureCheckpoint consults beginAttempt first; during cooldown it fails immediately with the same stored error instead of calling the VCS driver. Success clears state; failures (including driver resolve errors) update backoff and log warnings.

Unit tests cover the policy; integration tests assert only three real capture attempts across many turns when capture always times out, plus recovery and registry-failure behavior.

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

Note

Back off checkpoint capture in CheckpointStore after repeated failures

  • Introduces CaptureBackoff, a per-workspace LRU-bounded tracker that computes exponential cooldown durations once a failure threshold is crossed, capping at an absolute maximum.
  • Integrates backoff into CheckpointStore.captureCheckpoint: during cooldown, the method short-circuits and replays the last error without invoking the VCS driver; a single caller is reserved for the first post-cooldown retry.
  • On success, backoff state is cleared; on failure, the consecutive failure count increments, cooldown extends, and a warning log emits the backoff details.
  • Risk: captureCheckpoint callers in cooldown now receive a replayed error immediately rather than triggering a new capture attempt, which is a behavioral change for any caller that retries on every error.

Macroscope summarized 5a76e35.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@yashranaway
Back off checkpoint capture after repeated failures
361ee4a
On a repository large enough that a full-tree git add -A cannot finish
inside the 30s VCS process timeout, capture is killed on every completed
turn and retried on the next one. That pegs a CPU core for as long as any
thread is in use, and each kill landing mid-pack-write leaves an orphaned
tmp_pack_* in .git/objects/pack.

Track consecutive capture failures per workspace and, after three, skip
capture for a growing cooldown capped at an hour. Skipped captures replay
the recorded failure so callers see the same error and the same missing
status as before, without spawning git. Any success clears the record, so
a transient failure costs nothing.

Fixes pingdotgg#3646
@coderabbitai

coderabbitai Bot commented Jul 25, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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 Plus

Run ID: 15b00203-5b08-41fe-9987-cfe2de42dcb7

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

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
  • X
  • Mastodon
  • Reddit
  • LinkedIn

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Jul 25, 2026
macroscopeapp[bot]
macroscopeapp Bot reviewed Jul 25, 2026
View reviewed changes
Comment thread apps/server/src/checkpointing/CaptureBackoff.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

yashranaway added 2 commits July 25, 2026 18:50
@yashranaway
Read the backoff clock from the Effect clock
a92a481
Threading an injectable clock through the service constructor reindented
the whole factory for one test seam. The cooldown is minutes long, so the
integration test stays inside it on the real clock, and the pure backoff
tests already cover time-dependent transitions.
@yashranaway
Bound the set of workspaces tracked for capture backoff
fa28868
Only a later success clears a workspace record, so a workspace that fails
once and is then abandoned or deleted would be retained, along with its
error, for the lifetime of the server. Cap the tracked set and evict the
least recently touched entries, which costs an evicted workspace nothing
beyond its failure history.
macroscopeapp[bot]
macroscopeapp Bot reviewed Jul 25, 2026
View reviewed changes
Comment thread apps/server/src/checkpointing/CaptureBackoff.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/server/src/checkpointing/CaptureBackoff.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed Jul 25, 2026
View reviewed changes
Comment thread apps/server/src/checkpointing/CheckpointStore.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@macroscopeapp

macroscopeapp Bot commented Jul 25, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR introduces a new backoff mechanism that gates when checkpoint capture operations run, deciding to skip captures after repeated failures. Changes that control whether significant work executes warrant human review, regardless of how clean the implementation appears.

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@yashranaway
Track recency on skips and reserve the retry after a cooldown
b2c9ddb
Two gaps in the backoff, both raised in review.

Eviction recency was only refreshed when a failure was recorded, but a
workspace inside its cooldown never records one. Churn from 256 other
workspaces could evict a workspace that was actively being skipped and
release its next capture early. Reads now refresh recency too.

Threads sharing a workspace complete turns independently, so every one of
them was released at once when a cooldown expired and they all launched
the same capture together. The first caller past an expired cooldown now
reserves the attempt. Reporting the outcome replaces the reservation with
the real cooldown, and an unreported attempt lets it lapse on its own, so
an interrupted capture cannot wedge the workspace.
cursor[bot]
cursor Bot reviewed Jul 25, 2026
View reviewed changes

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit b2c9ddb. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread apps/server/src/checkpointing/CaptureBackoff.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/server/src/checkpointing/CheckpointStore.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@yashranaway
Reserve a capture retry only for a workspace in cooldown
5a76e35
Two follow-ups from review.

A workspace under the failure threshold carries a zero deadline, which
read as a cooldown that had just expired, so the first caller reserved
the attempt and a concurrent capture was skipped after a single transient
failure. Reserve only once the threshold is reached.

Resolving the VCS driver sat outside the reported scope, so a failure
before the capture ran left the caller's reservation in place with no
recorded outcome. Resolve inside that scope so every failure path
replaces the reservation with a real decision.
@patroza patroza mentioned this pull request Jul 26, 2026
perf: import mobile reliability and server efficiency candidates patroza/t3code#68
Merged
patroza added a commit to patroza/t3code that referenced this pull request Jul 26, 2026
@patroza
perf(server): back off repeated checkpoint capture failures (upstream p…
5a13785
…ingdotgg#4517)

Imported from pingdotgg#4517
patroza added a commit to patroza/t3code that referenced this pull request Jul 27, 2026
@patroza @github-actions
perf(server): back off repeated checkpoint capture failures (upstream p…
ee40b04
…ingdotgg#4517)

Imported from pingdotgg#4517
patroza added a commit to patroza/t3code that referenced this pull request Jul 27, 2026
@patroza @github-actions
perf(server): back off repeated checkpoint capture failures (upstream p…
294c958
…ingdotgg#4517)

Imported from pingdotgg#4517
patroza added a commit to patroza/t3code that referenced this pull request Jul 28, 2026
@patroza @github-actions
perf(server): back off repeated checkpoint capture failures (upstream p…
0a7bcba
…ingdotgg#4517)

Imported from pingdotgg#4517
patroza added a commit to patroza/t3code that referenced this pull request Jul 29, 2026
@patroza @github-actions
perf(server): back off repeated checkpoint capture failures (upstream p…
d22d679
…ingdotgg#4517)

Imported from pingdotgg#4517
patroza added a commit to patroza/t3code that referenced this pull request Jul 29, 2026
@patroza @github-actions
perf(server): back off repeated checkpoint capture failures (upstream p…
1696811
…ingdotgg#4517)

Imported from pingdotgg#4517
patroza added a commit to patroza/t3code that referenced this pull request Jul 29, 2026
@patroza @github-actions
perf(server): back off repeated checkpoint capture failures (upstream p…
180cb19
…ingdotgg#4517)

Imported from pingdotgg#4517
patroza added a commit to patroza/t3code that referenced this pull request Jul 29, 2026
@patroza @github-actions
perf(server): back off repeated checkpoint capture failures (upstream p…
7876288
…ingdotgg#4517)

Imported from pingdotgg#4517
patroza added a commit to patroza/t3code that referenced this pull request Jul 30, 2026
@patroza @github-actions
perf(server): back off repeated checkpoint capture failures (upstream p…
1995b37
…ingdotgg#4517)

Imported from pingdotgg#4517
patroza added a commit to patroza/t3code that referenced this pull request Jul 31, 2026
@patroza @github-actions
perf(server): back off repeated checkpoint capture failures (upstream p…
efd34dd
…ingdotgg#4517)

Imported from pingdotgg#4517
patroza added a commit to patroza/t3code that referenced this pull request Jul 31, 2026
@patroza @github-actions
perf(server): back off repeated checkpoint capture failures (upstream p…
e6e473f
…ingdotgg#4517)

Imported from pingdotgg#4517
patroza added a commit to patroza/t3code that referenced this pull request Aug 1, 2026
@patroza @github-actions
perf(server): back off repeated checkpoint capture failures (upstream p…
e923c7b
…ingdotgg#4517)

Imported from pingdotgg#4517
patroza added a commit to patroza/t3code that referenced this pull request Aug 4, 2026
@patroza
perf(server): back off repeated checkpoint capture failures (upstream p…
4cf551a
…ingdotgg#4517)

Imported from pingdotgg#4517
patroza added a commit to patroza/t3code that referenced this pull request Aug 5, 2026
@patroza @github-actions
perf(server): back off repeated checkpoint capture failures (upstream p…
dd1ed85
…ingdotgg#4517)

Imported from pingdotgg#4517
patroza added a commit to patroza/t3code that referenced this pull request Aug 5, 2026
@patroza
perf(server): back off repeated checkpoint capture failures (upstream p…
4a11118
…ingdotgg#4517)

Imported from pingdotgg#4517
patroza added a commit to patroza/t3code that referenced this pull request Aug 5, 2026
@patroza @github-actions
perf(server): back off repeated checkpoint capture failures (upstream p…
b11f894
…ingdotgg#4517)

Imported from pingdotgg#4517
omegent-app Bot pushed a commit to patroza/t3code that referenced this pull request Aug 6, 2026
@patroza @omegent-app
perf(server): back off repeated checkpoint capture failures (upstream p…
9b61d65
…ingdotgg#4517)

Imported from pingdotgg#4517
@t3dotgg t3dotgg added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. and removed vouch:unvouched Author is not yet trusted in the VOUCHED list. labels Aug 24, 2026
@mikeohuo mikeohuo mentioned this pull request Sep 7, 2026
[Bug]: Checkpoint capture on large monorepos retries a guaranteed 30s git-add timeout every turn — permanent CPU burn + tmp_pack disk litter #3646
Closed
2 tasks done
@t3-code-bot

t3-code-bot Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

closing this version as part of a pr cleanup at the request of @StiensWout.

this version suppresses checkpoint capture for a growing cooldown of up to an hour and has no explicit retry/reset path when the underlying problem is repaired. avoiding repeated expensive failures is worthwhile, but recovery needs to be more immediate and controllable before adopting this behavior.

thanks for the contribution. if you disagree with this decision, you are welcome to open a new pr, link back to this one, and explain how your proposal addresses these concerns or why a different approach is warranted.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@t3-code-bot t3-code-bot Bot closed this Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@macroscopeapp macroscopeapp[bot] macroscopeapp[bot] left review comments
@cursor cursor[bot] cursor[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[Bug]: Checkpoint capture on large monorepos retries a guaranteed 30s git-add timeout every turn — permanent CPU burn + tmp_pack disk litter

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@yashranaway @t3dotgg
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.