Skip to content

fix(publish): bound stalled state fetches - #707

Merged
hxy91819 merged 2 commits into
mainfrom
feature/bound-stalled-publisher-fetch
Jul 19, 2026
Merged

hxy91819 merged 2 commits into
mainfrom
feature/bound-stalled-publisher-fetch

Conversation

@hxy91819

Copy link
Copy Markdown
Member

Incident

#700 introduced server-side immutable-ledger merges and #701 enabled that path under checkout v7. The resulting merge-heavy clawsweeper-state/state history caused depth-1 publisher checkouts to stall in later git fetch calls and exhaust all publication slots.

#705 stopped creating new server-side ledger merges. That restored some throughput, but historical merge ancestry still leaves new-head publishers stuck in Publish event result; for example:

Other publishers on the same c48d3e0 workflow head complete, so the remaining failure is an unbounded fetch holding a capacity slot, not a total state outage.

Fix

  • Route every publisher state fetch through one 60-second bounded helper.
  • Surface elapsed commands as GitCommandTimeoutError, including fetches whose caller otherwise allows ordinary Git failures.
  • Let fetch timeouts escape the local publication retry loop.
  • Complete them as retryable_failure/github_transient so the durable queue owns backoff and retry.
  • Preserve tuple reconciliation, exact-head, CAS, immutable-ledger, routing, and merge safety behavior.

This carries forward the useful implementation from the now-closed #704. Commit authorship remains with brokemac79; the follow-up regression proof was added on a separate commit after the base moved.

Deterministic local proof

The regression uses Git's local ext transport to stall a real git fetch during protocol negotiation without GitHub or timing races. It proves:

  1. spawnGit marks the elapsed fetch as timed out.
  2. runGit throws GitCommandTimeoutError even with allowFailure.
  3. The real publisher reset entry point runs git fetch origin state with the production 60,000 ms timeout before any state reset.
  4. All publisher fetch sites remain centralized through the bounded helper.

Validation

  • Focused build and publisher/workflow regressions: 4 passed, 0 failed.
  • pnpm run check: passed.
  • Local container clawsweeper-automerge-e2e-base:local (Node 24.15.0, Git 2.39.5): 4 passed, 0 failed.
  • Autoreview final run: 0 accepted/actionable findings.
  • Gitleaks over origin/main..HEAD: no leaks.

@hxy91819
hxy91819 requested a review from a team as a code owner July 19, 2026 14:57
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@hxy91819
hxy91819 merged commit c24a9ca into main Jul 19, 2026
9 checks passed
@hxy91819
hxy91819 deleted the feature/bound-stalled-publisher-fetch branch July 19, 2026 15:08
azaj01 pushed a commit to azaj01/clawsweeper that referenced this pull request Sep 21, 2026
* fix(publish): bound state fetch retries

(cherry picked from commit d984984)

* test(publish): prove stalled fetch timeout wiring

---------

Co-authored-by: brokemac79 <[email protected]>
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.

2 participants