Skip to content

feat(queue): GitHub-native fallback mode (fleet queue fallback) — #6619 - #6654

Merged
developing-today[bot] merged 1 commit into
mainfrom
fleet/queue-fallback-mode
Nov 7, 2026
Merged

developing-today[bot] merged 1 commit into
mainfrom
fleet/queue-fallback-mode

Conversation

@dezren39

@dezren39 dezren39 commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Implements Drew's fallback design (ordered 2026-11-06) for when the queue backend is down: workers coordinate on GitHub issues themselves.

Protocol (doc: doc/fleet/queue-fallback-mode.md)

  • Work items: open issues labeled queue/queued or queue/claimed (existing taxonomy) in the five working repos.
  • Claim: comment with first-line marker plus a human pickup line.
  • Lease: 30 min of marker silence (Drew's 20-30 range; heartbeat markers renew) -> stale, supersede-able. --lease-min / FLEET_QUEUE_FALLBACK_LEASE_MIN override.
  • Release: marker with outcome done|free + summary (PR links); free restores queue/queued.
  • Claim state = a pure fold over marker comments (unit + property tests; contested = claim inside a live lease -> hands off). Claim re-reads after posting and reports race_lost. All state in comments; no database.

Verbs: fleet queue fallback scan|status|claim|heartbeat|release (JSON out; exits 0/2/3/5 mirror the queue client).

Proof (live during the #6619 outage; fleet queue health exit 3, PGRST002): cycle on #6646 - claim #6646 (comment), heartbeat #issuecomment-6700217510, second worker refused (exit 5, live_claim), release outcome=free #issuecomment-6700218719, labels verified restored by independent gh readback. Scan verified against code + opencode.

Tests: cargo test -p fleet-queue -p fleet-registry -p fleet --all-features green (8 new fallback tests).


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

When the queue backend (broker -> PostgREST) is unreachable, workers
starve: they cannot claim, and the work sits in GitHub issues. Drew's
design (2026-11-06): coordinate on the issues themselves.

fleet queue fallback <scan|status|claim|heartbeat|release>:
- work items = open issues labeled queue/queued or queue/claimed
  (the existing taxonomy) across the five working repos
- claim = a comment whose first line is a machine-readable marker
  <!-- fleet-claim v1 kind=claim worker=<id> ts=<rfc3339> -->
- lease = 30 min of marker silence (Drew's 20-30 range; heartbeat
  markers renew), then any worker may claim, superseding
- release posts outcome done|free with a summary; free restores the
  queue/queued label; claim/release mirror the section-9 label
  transitions best-effort
- claim state is a pure fold over the issue's marker comments
  (contested = a claim landed inside a live lease: hands off);
  claim re-reads after posting and reports race_lost
- all state lives in the comments; no database

Proof (live, backend down with PGRST002): full cycle on code#6646 -
claim, heartbeat, takeover refusal (exit 5 live_claim), release
outcome=free, labels verified restored by independent readback.
Protocol doc: doc/fleet/queue-fallback-mode.md.
@dezren39
dezren39 requested a review from a team as a code owner November 7, 2026 01:18
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-07T01:20:30.201579Z 23c12ea PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

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