Skip to content

fix(publish): avoid global throttle on state fetch timeout - #713

Merged
brokemac79 merged 1 commit into
mainfrom
codex/csw-049-publication-recovery
Jul 20, 2026
Merged

brokemac79 merged 1 commit into
mainfrom
codex/csw-049-publication-recovery

Conversation

@brokemac79

@brokemac79 brokemac79 commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Keep a bounded local state-checkout fetch timeout retryable without treating it as evidence of GitHub API pressure. This prevents one publisher timeout from lowering capacity for every issue and PR publication.

Problem and causal proof

At 2026-07-20T07:02:01Z, the durable publication queue recorded last_failure_kind=github_transient, entered a cooldown, and lowered its pressure ceiling after a publisher run timed out in hardResetToRemoteMain -> fetchPublishRemote:

  • run 29720961813 logged GitCommandTimeoutError: git fetch timed out after 60000ms.
  • The result publisher converted that local timeout directly into failure_kind=github_transient.
  • The queue correctly responds to that field by throttling cross-target publication capacity, but the timeout itself contains no HTTP 5xx or rate-limit evidence.

The workflow already has an explicit GitHub-pressure probe that emits failure_kind only for HTTP 429, API rate-limit, or HTTP 5xx evidence. This change leaves that path intact and removes the conflicting local-timeout assertion.

CSW-049 also investigated #712, authored by Peter Steinberger. It was merged at 2026-07-20T06:04:34Z, after the new publication backlog had already grown from 0 to 10 at 05:50:56Z, 21 at 05:55:56Z, and 30 at 06:00:56Z. Parent-SHA run 29720024571 had started losing clawsweeper-state push races at 05:53:08Z. #712 is therefore not reverted here; it did not start this incident, and a revert would restore its missing-state-object failure.

Implementation

  • Preserve retryable_failure, github_transient reason code, fingerprint, and normal publication retry behavior for GitCommandTimeoutError.
  • Do not write failure_kind for that local timeout.
  • Cover the queue outcome: the item is requeued, retains the reason code, and capacity control remains adaptive at its normal ceiling.
  • Assert that the publisher source no longer emits the timeout-derived failure_kind.

Validation

  • git diff --check

  • Docker-backed Crabbox local-container, lease cbx_10587a86449e:

    pnpm run build:all
    node --test --test-name-pattern=timeout.*throttling\|immutable.*queue-bounded test/dashboard-worker.test.ts test/sweep-workflow.test.ts
    

    Result: build passed; 2 passed, 0 failed.

  • codex review --uncommitted — clean, no accepted/actionable findings.

  • git fetch origin main --prune && codex review --base origin/main — clean, no accepted/actionable findings.

  • Normal @clawsweeper review completed in run 29726050754. Its directly inspected artifact reports high confidence, zero findings, a sufficient terminal proof, and keep_open for ordinary maintainer review. The publisher incident prevents the expected PR comment from being delivered; no dispatcher, retry, or gate was invoked to work around that.

  • Remaining review rank-up: let normal checks complete, with particular attention to coverage that keeps explicit HTTP 429/rate-limit/5xx pressure as the sole capacity-throttling signal.

Baseline noise: running the full test/sweep-workflow.test.ts file in the Linux Docker container also exposes existing CRLF failures in scripts/apply-workflow-helpers.sh and unrelated fixture assertions. The two affected tests passed in the same container after the full TypeScript build.

Risks and rollout

This does not make state fetches succeed; it keeps their existing bounded retry behavior while preventing a local checkout failure from suppressing unrelated targets. Real GitHub API pressure still reaches the capacity controller through the workflow's explicit HTTP/rate-limit probe. Watch publication pending depth, last_failure_kind, and net drain rate after deployment; no gate changes, queue resets, dispatches, or retries are included.

Attribution

Incident evidence and #712 attribution are preserved above. This patch specifically corrects the timeout-to-capacity-feedback contract introduced by #707.

@brokemac79

Copy link
Copy Markdown
Contributor Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@brokemac79
brokemac79 merged commit 1c4e6a5 into main Jul 20, 2026
10 checks passed
@brokemac79
brokemac79 deleted the codex/csw-049-publication-recovery branch July 20, 2026 08:06
azaj01 pushed a commit to azaj01/clawsweeper that referenced this pull request Sep 21, 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