Skip to content

Fix Bun backtest flake: retry cells on vex-step transport errors - #565

Merged
Mikola Lysenko (mikolalysenko) merged 1 commit into
mainfrom
ci-janitor/bun-vex-transport-retry
Oct 2, 2026
Merged

Mikola Lysenko (mikolalysenko) merged 1 commit into
mainfrom
ci-janitor/bun-vex-transport-retry

Conversation

@mikolalysenko

@mikolalysenko Mikola Lysenko (mikolalysenko) commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Bun patch compatibility is the slowest compatibility workflow (median ~22 min wall-clock per run) and had 3 re-runs of the same SHA in the last ~22 h (out of 68 runs). In each one, the first attempt's native leg failed one cell on a manifest-less VEX check:

Run (attempt 1) Job Failing cell
36955541463 native (ubuntu, bun 1.3.10) already-vendored-workspace hosted → vexLedgersDeleted (same run: ~15 cells hit error sending request for url (https://patches-api.socket.dev/patch/batch) ... Connection reset by peer)
36936009007 native (ubuntu, bun 1.1.39) workspace-get-search vendored → vexLedgersDeleted
36934117804 native (ubuntu, bun 1.0.0) crlf hosted → vexCheckoutPatchedBytes

None of these cells was retried, even though the harness already has a fresh-cell retry (retry_network_cell, 3 tries) for explicit transport failures. Every re-run of the same SHA passed.

Root cause

retry_network_cell only retries when has_transport_failure(row) finds a transport error string in the row. The VEX block threw away the evidence:

  • vex() stored only exit / skip / attested. A record fetch that fails in transport surfaces only in the envelope's warnings[] (Could not fetch patch <uuid>: Network error: error sending request for url (...)), and the skip code (record_unavailable) is the same for every cause. vexLedgersDeleted is the step that has to fetch the record from the patch API, because its ledgers were deleted.
  • The checkout's bun install --frozen-lockfile output (bun reports error: ConnectionRefused downloading tarball <spec> / error: GET <url> - 5xx) went to vex-install.log and never reached the row.

So a patch API or patch.socket.dev blip during these steps failed the job for good, and the only way out was a manual re-run of the whole ~22-minute workflow.

Fix

scripts/backtest-bun.py only:

  • Each vex run now keeps its warnings[].detail strings in row['vex'][label]['warnings'].
  • The VEX checkout install keeps just the lines bun uses to report a transport failure (row['vexInstallTransport']).
  • has_transport_failure also recognises bun's own fetch-failure lines. These are connection errors (Connection*, FailedToOpenSocket, Timeout "downloading …") and GET <url> - 5xx.

The retry stays as narrow as before. It only runs on an explicit transport error or a 5xx. A 404, a frozen-lock drift, or an attestation mismatch still fails the cell immediately. No timeouts were raised and no checks were removed or weakened.

Proof

All checks were run locally against the CLI built from this tree, with patches-api pointed at a closed port:

  • vex --json on a hosted-wired checkout exits 1 with warnings: ["Could not fetch patch 3b1f…: Network error: error sending request for url (http://127.0.0.1:1/patch/view/3b1f…): client error (Connect): tcp connect error: Connection refused (os error 111)"]. Under the old row shape has_transport_failure returned False; under the new one it returns True.
  • bun 1.3.14 installing from an unreachable tarball URL prints error: ConnectionRefused downloading tarball minimist@http://127.0.0.1:9/..., and bun_transport_failures picks it up. A GET … - 503 line matches; GET … - 404 and lockfile had changes, but lockfile is frozen do not.
  • I simulated retry_network_cell with a row that fails vexLedgersDeleted on a connection reset and then passes. It retried once and returned passed=True, keeping networkRetryAttempts.
  • ruff check --select F,E9 shows the same single pre-existing finding as on main.

This PR touches scripts/backtest-bun*.py, so it triggers the full Bun workflow; that run is the end-to-end check.

Where tests run

Unchanged. No test, cell or job was removed or moved, and required-check names are untouched.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WLdPQLaBvre5kBJ8iD148S


Generated by Claude Code


Note

Low Risk
Changes only the Bun backtest harness’s failure detection and result row shape; no product CLI or runtime behavior.

Overview
Reduces flaky failures in the long-running Bun compatibility backtest by letting the existing fresh-cell retry (retry_network_cell) see transport errors that used to be dropped during manifest-less VEX checks.

has_transport_failure now treats bun install fetch failures the same as CLI patch-API errors (connection/timeouts while downloading tarballs, GET … - 5xx). A new bun_transport_failures helper extracts those lines from install output.

The VEX checkout bun install output is captured into row['vexInstallTransport'], and each vex() sub-step keeps warnings[].detail on row['vex'][label] so patch-record fetch blips (e.g. “Could not fetch patch …”) are visible in the row. Retry behavior stays narrow: only explicit transport/5xx signals trigger a retry; 404s, lock drift, and attestation mismatches still fail immediately.

Reviewed by Cursor Bugbot for commit 61ece5f. Configure here.


Generated by Claude Code

The Bun backtest retries a failed cell from a clean tree when the row
carries an explicit transport error, but the manifest-less VEX steps
dropped the evidence: each vex run kept only exit/skip/attested, so a
"Could not fetch patch <uuid>: ... error sending request" warning was
discarded, and the checkout's `bun install --frozen-lockfile` output
(bun's "error: ConnectionRefused downloading tarball ...") never
reached the row. A patch-API or patch.socket.dev blip during these
steps failed the whole job (vexLedgersDeleted, vexCheckoutPatchedBytes)
instead of retrying the cell.

Keep each vex run's warning details and the checkout install's
transport-error lines in the row so the existing, narrowly scoped
retry sees them. Non-transport failures (404, frozen-lock drift,
attestation mismatches) still fail at once.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WLdPQLaBvre5kBJ8iD148S
@mikolalysenko Mikola Lysenko (mikolalysenko) added the ci-janitor Opened by the CI janitor routine (flakes, redundant tests, CI perf) label Oct 2, 2026
@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

bugbot run


Generated by Claude Code

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 61ece5f. Configure here.

@mikolalysenko
Mikola Lysenko (mikolalysenko) merged commit 0ae7cb2 into main Oct 2, 2026
263 checks passed
@mikolalysenko
Mikola Lysenko (mikolalysenko) deleted the ci-janitor/bun-vex-transport-retry branch October 2, 2026 16:14
@mikolalysenko Mikola Lysenko (mikolalysenko) added the Ready for review Agent-verified: mergeable, CI green, Bugbot clean — awaiting human review label Oct 2, 2026
@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

[burn-down agent] Labeled Ready for review at 61ece5f4a3c7fb42c597afcf5678fefdfd004b34.

  • CI: 259/259 non-skipped checks green on the head (4 skipped).
  • Bugbot: reviewed 61ece5f, no unresolved findings.
  • Mergeable: yes, no conflicts with main.
  • For reviewers: this is a test-harness change only. Bun backtest cells now retry when the vex step fails with a transport error. Check that the retry is narrow enough that it can't hide a real vex regression.

Slack announcement not sent: the Slack connector in this session has no send-message tool.


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-janitor Opened by the CI janitor routine (flakes, redundant tests, CI perf) Ready for review Agent-verified: mergeable, CI green, Bugbot clean — awaiting human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants