Skip to content

Resolve main over the git transport instead of the commits API - #8

Merged
mimen merged 1 commit into
mainfrom
resolve-via-ls-remote
Sep 15, 2026
Merged

mimen merged 1 commit into
mainfrom
resolve-via-ls-remote

Conversation

@mimen

@mimen mimen commented Sep 15, 2026

Copy link
Copy Markdown
Owner

Why

The hourly refresh job's very first scheduled run failed on both hosts.

bin/refresh-agent resolved main through the unauthenticated commits API. That endpoint returned 504 in about 70 milliseconds, with an nginx-style HTML body rather than GitHub's JSON error format, and kept doing so for several minutes across two machines with separate egress. gh reached the identical path fine throughout, and bootstrap-agent downloaded tarballs from the same host minutes earlier. It later recovered on its own.

A job whose purpose is to stop silent regressions should not report a failed run every time an upstream edge hiccups.

What changed

fetch_tip now reads the ref with git ls-remote instead of the API. That needs no media type, no unauthenticated rate limit, and no second network path, and it is the transport the tarball install already depends on. It resolved exactly and instantly on both hosts during the entire window the API was failing.

resolve_tip also catches SubprocessError, because a subprocess timeout is not an OSError and would otherwise escape as a traceback in an unattended job.

The tests patch fetch_tip by name and the self-check replaces it via global, so the seam is unchanged and no test needed editing.

Verification

Self-check passes. 14 Python deploy regressions, 68 bun tests with 193 assertions, clean typecheck. The new path was also run against the real remote with the real host config and correctly reported up to date at 9467fe2 with exit 0, so the replacement is proven rather than inferred.

🤖 Generated with Claude Code

The first scheduled run failed on both hosts: the unauthenticated commits endpoint returned 504 in about 70ms, with an nginx-style HTML body rather than GitHub's JSON error, and kept doing so for minutes across two machines with separate egress while gh reached the same path fine. It later recovered on its own. git ls-remote read the ref exactly and instantly on both hosts throughout. It needs no media type, no unauthenticated rate limit, and no second network path, and it is the transport the tarball install already depends on. The tests patch fetch_tip by name, so the seam is unchanged; resolve_tip now also catches SubprocessError, since a subprocess timeout is not an OSError and would otherwise escape as a traceback in an unattended job.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@mimen
mimen merged commit 7effd76 into main Sep 15, 2026
1 check passed
@mimen
mimen deleted the resolve-via-ls-remote branch September 15, 2026 20:48
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.

1 participant