Skip to content

feat(forge): surface rate-limit retry hint on the forge error channel (RIG-2255) - #750

Merged
mattwilkinsonn merged 2 commits into
mainfrom
compass-forge/rig-2255-retry-after
Aug 30, 2026
Merged

feat(forge): surface rate-limit retry hint on the forge error channel (RIG-2255)#750
mattwilkinsonn merged 2 commits into
mainfrom
compass-forge/rig-2255-retry-after

Conversation

@rigel-mintaka

Copy link
Copy Markdown
Contributor

Implements the frozen retry-after design (#653). A forge budget skip now
carries how long until the fail-fast gate re-opens, so callers get a truthful
ForgeCallError.retry_after_ms instead of a constant 0.

  • forge.RateLimitError: a typed skip carrying RetryAfter, unwrapping to
    ErrBudgetExhausted so every existing errors.Is skip-contract site keeps
    matching while errors.As recovers the hint at the mapForgeError chokepoint.
  • GitHub + Linear: gateBlocked() now returns the remaining wait alongside the
    armed flag; every fail-fast site and both live 429/RATELIMITED classifiers
    emit *RateLimitError (reset instant computed once; 0 hint when no usable
    header, gate still self-arms with the bounded default skip).
  • server.mapForgeError: the budget-exhausted arm recovers *RateLimitError via
    errors.As and clamps RetryAfter to [0, math.MaxUint32] ms before the uint32
    cast (negative -> 0, oversized -> saturates); proto/doc comments rewritten
    from the stale always-0 note to the widened fail-fast-reset semantics.
  • Regression pins on both reconcile sweep abort branches prove the typed error
    still takes the ErrBudgetExhausted path.

Refs RIG-2255

Co-authored-by: Matt Wilkinson matt@rigel.build

@linear-code

linear-code Bot commented Aug 30, 2026

Copy link
Copy Markdown

RIG-2255

@github-actions

github-actions Bot commented Aug 30, 2026

Copy link
Copy Markdown

Compass engineering docs preview: https://compass-forge-rig-2255-retry-j22p.compass-eng-docs.pages.dev

Deployed from compass-forge/rig-2255-retry-after at 2c0fa41.

rigel-mintaka and others added 2 commits August 30, 2026 16:58
… (RIG-2255)

Implements the frozen retry-after design (#653). A forge budget skip now
carries how long until the fail-fast gate re-opens, so callers get a truthful
`ForgeCallError.retry_after_ms` instead of a constant 0.

- forge.RateLimitError: a typed skip carrying RetryAfter, unwrapping to
  ErrBudgetExhausted so every existing errors.Is skip-contract site keeps
  matching while errors.As recovers the hint at the mapForgeError chokepoint.
- GitHub + Linear: gateBlocked() now returns the remaining wait alongside the
  armed flag; every fail-fast site and both live 429/RATELIMITED classifiers
  emit *RateLimitError (reset instant computed once; 0 hint when no usable
  header, gate still self-arms with the bounded default skip).
- server.mapForgeError: the budget-exhausted arm recovers *RateLimitError via
  errors.As and clamps RetryAfter to [0, math.MaxUint32] ms before the uint32
  cast (negative -> 0, oversized -> saturates); proto/doc comments rewritten
  from the stale always-0 note to the widened fail-fast-reset semantics.
- Regression pins on both reconcile sweep abort branches prove the typed error
  still takes the ErrBudgetExhausted path.

Refs RIG-2255

Co-authored-by: Matt Wilkinson <matt@rigel.build>
…2255)

Address review lows on PR #750:
- add a table case proving an oversized RateLimitError hint saturates at
  math.MaxUint32 (exercises the forge.go clamp upper arm)
- rename the table field wantRetryMsID -> wantRetryMs (the ID suffix was a
  copy-paste artifact; the value is a ms count, not an identifier)

Co-authored-by: Matt Wilkinson <matt@rigel.build>
@rigel-mintaka
rigel-mintaka force-pushed the compass-forge/rig-2255-retry-after branch from b582fd3 to 2c0fa41 Compare August 30, 2026 21:00
@rigel-mintaka
rigel-mintaka marked this pull request as ready for review August 30, 2026 21:12
@mattwilkinsonn
mattwilkinsonn merged commit 2426dd2 into main Aug 30, 2026
13 checks passed
@mattwilkinsonn
mattwilkinsonn deleted the compass-forge/rig-2255-retry-after branch August 30, 2026 22:30
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