Repository navigation
fix(pm-dispatch): route queue writes through the queue broker (#9028) - #10986
Conversation
QueueClient now talks only to the fleet queue broker (Turso-backed): /enqueue (validated), /claim-flow by task id for assign-immediately (replacing the status-CAS PATCH), /list rich reads, /checkpoint notes, /cancel. The Supabase service-role key and all direct PostgREST writes are removed from config, install.sh rendering, and docs; tests rewritten at the broker boundary.
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 42 minutes. View limit details
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. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Closes #9028.
What
pm-dispatch no longer holds the Supabase service-role key or writes queue rows by direct PostgREST. Its queue client (
pm-stack/dispatch/src/queue.ts) now talks only to the fleet queue broker (the live Turso-backed store), with the broker token read fromQUEUE_BROKER_TOKENor~/.config/queue-broker/token:/enqueue(packet validated broker-side before the row exists)/claim-flowwith the enqueued task's id (claim-by-id + lane ledger + session bind in one trip; a null row is the fix(dispatch): claim-PATCH race allows dual-worker task execution #10737 ClaimLostError, replacing the status-CAS PATCH)getTask, dedupe lookup, session→task lookup) → broker/list(rich)/checkpointprogress merge (there is no generic row PATCH anymore;launch_annotationsnow usesnoteTask)/cancel; lane ledger → inside claim-flowConfig drops
SUPABASE_URL/SUPABASE_SERVICE_ROLE_KEYentirely (broker URL + token file instead).install.shrendersQUEUE_BROKER_URLand no longer renders any Supabase secret; the stale-key warning for~/secrets/dispatch.envnow names the lines obsolete. README env table updated.Tests
bun test: 230 tests — queue/config/annotation/launch tests rewritten at the broker boundary (envelope shapes, claim-flow partials, fail-closed session lookup, dedupe degrade-to-null). Twogithub.test.tslookup tests intermittently time out at 5000ms in this environment (also on clean main; unrelated —github.tsuntouched).bunx tsc --noEmit: clean.Verification (post-deploy)
pm-stack/dispatch/install.sh; rendered.envcarries noSUPABASE_*lines (names checked only).fleet queue liston the Turso store (recorded on pm-stack/dispatch is a direct PostgREST producer bypassing the packet validator and the queue broker (Phase 4 disposition (b) of #6449) #9028 / Closing queue-validation inventory — disposition every forwarded field, client flag and broker verb value against the validation contract (Phase 4 of #6448) #6449).Queue task 20268, lane any-m.