Skip to content

feat(bg): B-0500 slice 3 — wire queue-state guard into pollOnce#3593

Merged
AceHack merged 1 commit into
mainfrom
feat/b0500-backlog-notifier-queue-guard-retry
May 15, 2026
Merged

feat(bg): B-0500 slice 3 — wire queue-state guard into pollOnce#3593
AceHack merged 1 commit into
mainfrom
feat/b0500-backlog-notifier-queue-guard-retry

Conversation

@AceHack
Copy link
Copy Markdown
Member

@AceHack AceHack commented May 15, 2026

Implements backlog row B-0500 (Slice 3 of the B-0441 notifier). We now properly guard work assignments using isAgentQueueEmpty, ensuring agents only receive new proactive tasks when their queues are fully cleared.

Copilot AI review requested due to automatic review settings May 15, 2026 21:35
@AceHack AceHack enabled auto-merge (squash) May 15, 2026 21:35
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR completes Slice 3 of the B-0441 backlog-ready notifier by wiring the isAgentQueueEmpty queue-state guard into pollOnce. When the target agent's queue is non-empty (recent commits or open PRs by that agent), the poll iteration returns early with queueBusy: true and publishes no work-assignment envelopes, preventing assignment pile-up on busy agents.

Changes:

  • Add targetAgent field to NotifierConfig and a queueBusy field to PollResult; populate via isAgentQueueEmpty(config.targetAgent, adapters) at the top of pollOnce.
  • Thread adapters through runOnce/runDaemon and add a --target-agent <agent> CLI flag.
  • Add two new tests (queue-busy → no publish; queue-empty → publishes) and update backlog rows B-0500/B-0441 to closed/shipped.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
tools/bg/backlog-ready-notifier.ts Wire queue-state guard into pollOnce; add targetAgent config + queueBusy result field; plumb adapters through runOnce/runDaemon; add --target-agent flag.
tools/bg/backlog-ready-notifier.test.ts Add tests for queue-busy skip and queue-empty publish paths; update existing tests for new config field/flag.
docs/backlog/P1/B-0500-...md Mark B-0500 status closed and acceptance checkboxes ticked.
docs/backlog/P1/B-0441-...md Update slice-3 row of B-0441 table to ✅ shipped.

@AceHack AceHack merged commit 6a6e049 into main May 15, 2026
32 of 33 checks passed
@AceHack AceHack deleted the feat/b0500-backlog-notifier-queue-guard-retry branch May 15, 2026 21:39
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.

2 participants