Skip to content

fix(publish): bound state fetch retries - #704

Closed
brokemac79 wants to merge 1 commit into
mainfrom
codex/csw-048-bounded-publisher-fetch
Closed

brokemac79 wants to merge 1 commit into
mainfrom
codex/csw-048-bounded-publisher-fetch

Conversation

@brokemac79

@brokemac79 brokemac79 commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

Live incident evidence

Dashboard snapshot supplied during CSW-048 at 15:06: 146 pending, 32/32 active, +105 pending per hour, and −104 net publications per hour.

1-Photo-1

Summary

Bound all ClawSweeper publisher git fetch calls to 60 seconds and classify an elapsed fetch as a retryable GitHub-transient publication failure.

Problem

CSW-048 found publisher workers stuck indefinitely in state-repository git fetch after review artifacts had already been generated. This exhausted publication capacity, leaving final review comments and labels pending across both PRs and issues. The affected run for openclaw/openclaw#111381 stopped immediately after git fetch in publication; the dashboard showed 54 pending results and a falling net publication rate.

Implementation

  • Centralize publisher fetches behind one bounded 60-second helper, including push-race and reconciliation paths.
  • Surface an elapsed fetch as GitCommandTimeoutError.
  • Let that error escape the local publish retry loop and emit retryable_failure/github_transient, preserving the durable queue's existing backoff and capacity-control behavior.
  • Keep normal publication, comment routing, label application, queue protocol, and gates unchanged.

Validation

pnpm run build:all
node --test --test-name-pattern "spawnGit reports an elapsed command timeout|publisher fetches share the bounded fetch helper" test/repair/git-publish.test.ts
node --test --test-name-pattern "exact event review hands immutable artifacts to the queue-bounded publisher lane" test/sweep-workflow.test.ts
git diff --check
pnpm exec oxfmt --check src/repair/git-publish.ts src/repair/publish-event-result.ts test/repair/git-publish.test.ts test/sweep-workflow.test.ts .github/workflows/sweep.yml

All passed. actionlint is unavailable on this host. The full workflow test file had five baseline failures because this Windows host's bash resolves to a WSL distro without /bin/bash; its remaining 61 checks passed, including the publisher workflow test above.

Docker-backed Crabbox proof

provider: local-container (Docker)
lease: cbx_a504dded605c
image: mcr.microsoft.com/playwright:v1.60.0-noble
branch head: 66b82c906b118a4a6d4bf866d6f6221df687ca81
build: tsconfig.json, tsconfig.repair.json, tsconfig.dashboard.json
publisher regressions: 3 passed, 0 failed
exit code: 0

The Linux proof ran the new elapsed-command timeout regression, the all-publisher-fetches bounded-helper guard, and the exact publisher workflow handoff test. The one-shot container was stopped automatically after the successful run.

Codex review closeout

codex review --uncommitted

Initial review found two accepted P1 gaps: timeout swallowing inside the local publisher retry loop and an unbounded fetch after a rejected state push. Both were fixed.

codex review --uncommitted
codex review --base origin/main

Both final reviews completed cleanly with no accepted or actionable findings.

Risk and rollout

This does not make a failed state refresh succeed; it prevents one from holding a publisher worker for up to the 60-minute workflow limit. A timed-out fetch is requeued through the existing durable retry and capacity-control path, so recovery can resume when the underlying GitHub transport/state-repository condition clears. No gate, permission, or target-side mutation behavior changes.

@brokemac79
brokemac79 requested a review from a team as a code owner July 19, 2026 14:00
@brokemac79 brokemac79 closed this Jul 19, 2026
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