fix(queue): repair main-red syntax error from #3998#4027
Closed
JSONbored wants to merge 1 commit into
Closed
Conversation
PR #3998 landed with 4 corrupted regions in processors.ts (a botched merge/patch-apply): a broken ternary in sweepRepoRegate's job builder, a duplicate REGATE_REPAIR_MAX_ATTEMPTS_PER_SHA declaration split across a comment block, and an invalid regatePullRequest signature (required param after an optional one). Reconstructed the intended logic exactly as described in #3998's own PR body: record the repair-attempt audit event at execution time (inside regatePullRequest, after rate-limit admission) instead of dispatch time, thread repairHeadSha through the job payload, and keep the attempt cap bumped 2->5. Also fixed two queue.test.ts assertions that still expected the old dispatch-time semantics/cap and one stale gittensory_agent_disposition_total assertion missing the repo label already used in selfhost-metrics.test.ts.
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Owner
Author
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
main is currently broken (confirmed via direct GitHub API fetch of the file at HEAD, not a local artifact): #3998 (a sentry[bot] auto-fix PR, merged 2026-07-07T10:09 UTC) applied its diff hunks in the wrong positions, corrupting
src/queue/processors.tsin 4 places:sweepRepoRegate's job-builder: an inserted comment+spread split a ternary expression mid-statement.REGATE_REPAIR_MAX_ATTEMPTS_PER_SHAdeclaration (block-scoped redeclaration), with the new value (5) landing inside a split comment instead of replacing the old value (2).regatePullRequest's signature: a required parameter placed after an optional one (invalid TS).regatePullRequest's body: a stray}closed the JOBS.send payload early, orphaning the trailing spread lines.Reconstructed the logic exactly as #3998's own PR description states the intent: move the
REGATE_REPAIR_ATTEMPT_EVENT_TYPEaudit recording from dispatch-time to execution-time (so a rate-limit-deferred dispatch no longer burns an attempt), threadrepairHeadShathrough the job payload as a trailing optional param, and keep the attempt cap bumped 2→5.Also fixed, discovered while getting this file green:
queue.test.tsregression tests still asserted the old dispatch-time-records-immediately behavior and the old cap of 2 — updated to match the new execution-time/cap-5 semantics fix(queue): prevent regate repair exhaustion from premature attempt counting #3998 intended.gittensory_agent_disposition_totalassertion missing therepolabel thatselfhost-metrics.test.ts's equivalent assertions already correctly include.Validation
npm run typecheck— clean (was failing with TS1005/TS1128/TS1109/TS1136 parse errors before this fix).npx vitest run test/unit/queue.test.ts— full file green after the fixes above (was 6 failing, now 0).Notes
This blocks cutting a new self-host release from the current main tip, so treating as urgent.