Skip to content

feat(queue): durable local close queue with rate-limit retry (RUSH-2308) - #35

Merged
muqsitnawaz merged 3 commits into
mainfrom
rush-2308-linear-queue
Aug 6, 2026
Merged

feat(queue): durable local close queue with rate-limit retry (RUSH-2308)#35
muqsitnawaz merged 3 commits into
mainfrom
rush-2308-linear-queue

Conversation

@muqsitnawaz

Copy link
Copy Markdown
Contributor

Linear close operations now survive rate limits and transient API failures via a durable local queue.

What changed

  • linear update <id> --done --proof ... persists a close intent to ~/.linear-cli/queue/ before calling Linear. On a 429/transient error the intent is retained and retried later instead of being dropped.
  • Added linear queue and linear queue drain (--dry-run) to inspect and apply queued closes.
  • gql now surfaces HTTP status codes in GraphQL error extensions so callers can detect 429 vs permanent failures.
  • Exponential bounded backoff (2s base, 5m cap) and bounded queue growth (1000 intents, 10 attempts) prevent unbounded retries.
  • Idempotent: duplicate intents collapse to the latest proof/comment; already-closed issues are skipped.

Links

  • Closes RUSH-2308 (implementation in linear-cli; consumer wiring remains in agents-cli per ticket scope)

Verification

  • Unit tests: python3 -m unittest -v → 95 tests pass (full output)
  • Local simulated rate-limit demo (full output):
=== 1. Simulated rate limit on linear update --done ===
STDOUT:
RUSH-DEMO -> queued for retry (rate limited / transient)

=== 2. Show queue ===
STDOUT:
1 close intent(s) queued:
  RUSH-DEMO -> Done (attempts=0)
Run `linear queue drain` to apply them.

=== 3. Drain queue (now succeeds) ===
STDOUT:
Applied RUSH-DEMO -> Done
Drained 1 intent(s). Queue empty.

@cursor

cursor Bot commented Aug 6, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@muqsitnawaz
muqsitnawaz merged commit f0d77b4 into main Aug 6, 2026
2 checks passed
@muqsitnawaz
muqsitnawaz deleted the rush-2308-linear-queue branch August 6, 2026 13:44
@muqsitnawaz

Copy link
Copy Markdown
Contributor Author

Non-author review (recorded as comment — formal approve blocked since the codex agent opened this under my GH identity, but I did NOT author the code). VERDICT: PASS. Independently validated: ran 95 tests OK incl. durable-queue coverage; HTTP-status transient detection (429/502/503/504); idempotent backoff drain; bounded per-issue queue; API key never persisted. Merged on green.

muqsitnawaz added a commit that referenced this pull request Aug 9, 2026
PR #35 shipped the core rate-limit queue under RUSH-2308. This closes the
remaining RUSH-2307 acceptance gaps:

- fcntl.flock serializes concurrent drains on one machine
- linear queue list (explicit) + drain --once
- gql surfaces Retry-After; drain prefers it over exponential backoff
- rate-limit runbook in skill.md / README
- tests: lock, once, Retry-After, list (100 total green)
- install pin + SHA for v0.18.0
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