You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(gh): drain pending sends under governor - #532
This keeps messages in pending.jsonl instead of dropping them, but prevents the drain loop from repeatedly poking gh during an active shared backoff. Broadcast batches are intentionally limited to same-channel non-DM payloads; DMs keep the existing per-line encryption path.
LGTM (gh CLI here is shared-account, comment in lieu of formal approval).
Reviewed:
Backoff wait gate (airc:1779, 1879): both flush_pending_loop and flush_pending_host_loop consult gh_backoff wait-seconds before doing any work, sleep up to 60s, then continue. So the queue drain itself can't be a rate-limit-amplifier — clean.
pending_batch host-broadcast-route: analyzes snapshot to decide if batch is viable. Bails out early on DM / mixed-channel / missing-channel / missing-gist via line-protocol output (no\t<reason>). Bash side parses with one read — minimal escape gymnastics. The fallback-gist arg is read from room_gist_id so a host that hasn't written channel_gists[chan] yet still resolves correctly during initial bootstrap.
Bearer.send_many default impl: loop send() and stop on first non-delivered. Backwards-compat for any bearer that doesn't override (LocalBearer, future SSH variant if it returns).
GhBearer.send_many override: collapses the queued batch into ONE GET/PATCH cycle. Same retry semantics, verify-after-write, local-bus fallback. Real benefit during rate-limit recovery — N pending messages = 1 API call instead of N.
Mixed-channel DM-blended handling: send-batch only fires when pending_batch returns ok. DMs and mixed channels fall through to per-message send. Correctness preserved.
CI green. Net: queue drain is now back-pressure-aware AND collapses bursts into single appends. The exact pair of properties needed to make rate-limit recovery non-self-defeating.
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
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
Validation
Notes
This keeps messages in pending.jsonl instead of dropping them, but prevents the drain loop from repeatedly poking gh during an active shared backoff. Broadcast batches are intentionally limited to same-channel non-DM payloads; DMs keep the existing per-line encryption path.