feat(bg): B-0500 slice 3 — wire queue-state guard into pollOnce#3593
Merged
Conversation
There was a problem hiding this comment.
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
targetAgentfield toNotifierConfigand aqueueBusyfield toPollResult; populate viaisAgentQueueEmpty(config.targetAgent, adapters)at the top ofpollOnce. - Thread
adaptersthroughrunOnce/runDaemonand 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. |
This was referenced May 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.