Skip to content

Add --queues CLI option for slot group configuration#1291

Merged
stuartc merged 45 commits intofastlanesfrom
1288-queues-cli-option
Mar 10, 2026
Merged

Add --queues CLI option for slot group configuration#1291
stuartc merged 45 commits intofastlanesfrom
1288-queues-cli-option

Conversation

@stuartc
Copy link
Member

@stuartc stuartc commented Mar 9, 2026

Short Description

Add --queues CLI option and WORKER_QUEUES env var for configuring worker slot groups, enabling dedicated capacity for named queues (e.g., fast lane for sync webhooks).

Fixes #1288

Implementation Details

  • --queues CLI option: Parses "<queues>:<count> ..." syntax into typed SlotGroup[] (e.g., --queues "fast_lane:1 manual,*:4")
  • WORKER_QUEUES env var: Alternative to CLI flag, same syntax
  • Mutual exclusivity: --queues and --capacity cannot be used together
  • Backward compat default: When --queues is not provided, derives manual,*:<capacity> from --capacity (default 5)
  • Effective capacity: Summed from all slot groups, replaces args.capacity in maxWorkflows and maxWorkers
  • Validation: Queue names must be alphanumeric/underscore, * wildcard only at end of preference chain, count >= 1
  • Duplicate warnings: Warns on duplicate queue names within a chain or identical configs across groups
  • Lexicon: Added optional queues?: string[] to ClaimPayload type

Slot groups are parsed and validated but not yet wired into the workloop/claim protocol — that's #1289.

QA Notes

  • All existing ws-worker tests pass (260 passed, 9 skipped, 16 todo)
  • New tests cover: CLI parsing, env var resolution, mutual exclusivity (all combinations), parse-queues happy paths and validation errors
  • --capacity without --queues continues to work identically to before
  • The slotGroups variable is computed but not yet passed to createWorker (TODO for Implement per-group workloops and queue-aware claiming #1289)

AI Usage

  • I have used Claude Code
  • I have used another model
  • I have not used AI

@github-project-automation github-project-automation bot moved this to New Issues in Core Mar 9, 2026
@stuartc stuartc force-pushed the 1288-queues-cli-option branch from a1d3a73 to 852eb55 Compare March 9, 2026 13:44
@stuartc stuartc self-assigned this Mar 9, 2026
stuartc added 5 commits March 10, 2026 11:00
Introduce queue-aware slot allocation to support fast lanes. Workers can
now dedicate specific slots to specific queues via a new `--queues` flag
(e.g. `--queues "fast_lane:1 manual,*:4"`).

- Add parseQueues() with SlotGroup type and full validation
- Add --queues CLI option with WORKER_QUEUES env var support
- Enforce mutual exclusivity between --queues and --capacity
- Derive effectiveCapacity from slot groups in start.ts
- Add queues field to ClaimPayload in lexicon
- Remove unreachable ?? 5 fallback in start.ts (capacity always has default)
- Add TODO(#1289) for passing slotGroups to createWorker
- Warn on duplicate queue names within a preference chain
- Warn on identical queue configurations across slot groups
- Add test for WORKER_QUEUES + WORKER_CAPACITY env var mutual exclusivity
capacity always receives a default value via setArg, so the type
should reflect that rather than requiring a runtime fallback.
@stuartc stuartc force-pushed the 1288-queues-cli-option branch from 70fee4a to 3158557 Compare March 10, 2026 09:16
@stuartc stuartc merged commit 3158557 into fastlanes Mar 10, 2026
6 checks passed
@github-project-automation github-project-automation bot moved this from New Issues to Done in Core Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants