Repository navigation
Batch parent ownership notices and show bb notices usefully in the queue drawer - #7029
Merged
ymichael merged 4 commits intoNov 4, 2026
Conversation
ymichael
force-pushed
the
bb/batch-parent-ownership-notices-through-coalesced-thr_h9ft2uy2m7
branch
2 times, most recently
from
November 4, 2026 20:10
85ee385 to
8c89593
Compare
ymichael
force-pushed
the
bb/batch-parent-ownership-notices-through-coalesced-thr_h9ft2uy2m7
branch
from
November 4, 2026 20:18
8c89593 to
622463e
Compare
Ownership notices used an in-memory per-child 2 s timer, so unassigning several threads at once sent the parent one notice and one steer per child, and a restart inside the window lost the notice. They now go through postCoalescedSystemNotice with a thread-ownership coalesce key: every change to one parent within the window becomes one durable queued row, listing each assigned or unassigned child. A move undone inside the window withdraws the pending entry, and an assignment entry remembers the parent the child had before the window so intermediate parents are never notified. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…to 0.6.123 Notices merged into a row already waiting on the parent can now be withdrawn too, and the withdraw guards on the same drainable-row rule as the merge. The delivered-baseline test now delivers the rows instead of expiring their window, since an expired but undelivered row is still mergeable. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Queued bb notices rendered as raw prompt text ("[bb system] These threads
are…") with a "From System" label, offered every user-message action, briefly
appeared and vanished during their 2 s coalescing window, and turned the
sidebar clock on even when nothing of the user's was queued.
- Queued rows now carry their systemNotice; the drawer titles notice rows the
way the timeline does ("3 threads updated", "X assigned to you") with the
timeline's icon, and shows only their wait reason underneath.
- Notice rows offer only send-now and delete: no edit (the server reports them
not editable and refuses a rewrite), no send-time change, no drag.
- Notices still collecting or being delivered (time or no wait) are left out
of the drawer, so they no longer flicker; held, failed and stuck notices
still show.
- The sidebar's queued-waiting status counts only non-notice rows; a failed
notice still shows as failed.
- The collapsed header adds "· N from bb" and prefers the user's own wait
line over a notice's.
- The drawer may grow to 30% of the window (198-360 px) before it scrolls.
- Plugin SDK 0.6.123: ThreadQueuedMessage gains systemNotice.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
#7011 brought the coalesced-notice code back to its pre-#7028 shape, so the pending lookup takes `now` again and a merge writes `sendAt` rather than `windowEndsAt`. The test for withdrawing a change after its window but before delivery depended on #7028 and is removed with it; main's plugin SDK is now 0.6.123. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ymichael
force-pushed
the
bb/batch-parent-ownership-notices-through-coalesced-thr_h9ft2uy2m7
branch
from
November 4, 2026 20:50
622463e to
64a82b3
Compare
ymichael
deleted the
bb/batch-parent-ownership-notices-through-coalesced-thr_h9ft2uy2m7
branch
November 4, 2026 21:01
ymichael
added a commit
that referenced
this pull request
Nov 4, 2026
## Human comments ## What was wrong #7011 (updateWhenIdle settings) reverted two PRs that had merged about 30 minutes before its commit was created: #7028 (merge child notices while the parent is blocked, skip `/compact` turns) and #7030 (count only the latest workflow run in GitHub PR check status). Its body mentions neither, so it looks accidental. - #7011 is a single commit, `6b17f1bc04`, whose parent is #7028's merge commit `920804af63`. Even so, the commit's own diff rewrites 11 files to their earlier content: - In #7028's 9 files it is an exact inverse of #7028, apart from four exports #7011 added to `packages/db/src/data/index.ts`. - #7030's 3 files in `plugins/github-pr-status/host/` went back to their pre-#7030 content. - That pattern fits a branch whose files came from an older checkout and were committed onto a newer base. - CI stayed green because each revert also removed the matching tests. - No other PR was affected. Every file the commit touched was compared with its earlier versions on main; only these two PRs match. What users got back after #7011: - **#7028:** a parent blocked on a question, a starting turn or an offline host collects a separate notice for every child update again (on Nov 3 one parent got ten from one child). `/compact` turns on a child send the parent "No final output was recorded." - **#7030:** bb shows green PRs as failing ("22 passed, 4 failed") when GitHub cancelled a duplicate CI run. ## What changed - Cherry-picks `b0e91c38f8` (#7030) and `920804af63` (#7028) onto current main with `-x`. #7030 applies unchanged. - #7028 conflicted only in `coalesced-system-notices.ts`, because #7029 (merged after #7011) added withdrawing a pending notice there. The result is #7028's version with #7029's withdraw path kept: the pending lookup has no `now` and a merge writes `windowEndsAt`. This is the combination #7029 was tested with before #7011 landed. `child-thread-notifications.ts` resolved to main's existing version, which already guards on a scheduled row. - Restores the #7029 test that depends on #7028: an ownership change undone after its 2 s window but before delivery is withdrawn. Its test helper comes back with it. - `internal/events.ts` and `db/data/events.ts` merged cleanly with the later #7031 and #7033 changes. - No daemon wire, CLI, config or plugin SDK surface change; `check-plugin-sdk-version` reports the surface unchanged. ## How you verified - With main's current code and the restored tests, 7 tests fail. With this branch they pass: - `thread-ownership-notices`: "withdraw a move undone after its window but before delivery" - `system-notice-dispatch`: "merge later outcomes into a row still waiting on the parent" - `child-completion-turn-output`: "does not notify the parent for a turn that only compacted context" - `github-pr-status` `git-host` / `batch`: superseded workflow runs, including on a later checks page and for drafts found through `gh pr view` - Server: ownership notices, notice dispatch, child completion output, notice kinds, child outcomes, parenting, plugin events, queue updates, sidebar status and child notifications all pass (112 tests). - `turbo run test` for the GitHub PR Status plugin, `@bb/db` and `@bb/templates` passes (10/10 tasks). `turbo run typecheck` for server, db, app and the plugin passes (10/10 tasks). > AGENT GENERATED 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
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.
Human comments
What was wrong
Ownership notices were one turn per child.
thread-ownership.tsdebounced each child separately with an in-memoryWeakMap+ 2 ssetTimeout, then calledqueueParentSystemMessageonce per child. Unassigning N threads together sent the parent N separate notices, each its own steer or turn. In production, thr_bgwkk8ing5 got 6 within one minute on 2026-10-22. A server restart inside the 2 s window lost the notice. Child turn-end notices had the same design until #6728 moved them to one durable coalesced queue row per parent.Queued bb notices were noisy in the queue drawer and sidebar.
What changed
Ownership notices go through the coalesced queue (
thread-ownership.ts). The WeakMap/timer path is gone. Each change posts topostCoalescedSystemNoticewith athread-ownershipkey and a 2 s window. All changes to one parent become one durable queued row with a typed, zod-parsedcoalesceState, listing every child assigned or unassigned. The timer's per-child behaviour is kept:message.cancelledis emitted to plugins).assignedentry remembers the parent the child had before the window, so A→B→C notifies only A and C, and A→B→A notifies nobody, even withparentNotificationsstuck/off.parentNotificationsisauto.postCoalescedSystemNotice'smergemay returnnullto withdraw, using the newdeleteCoalescedQueuedThreadMessageInTransaction, which only deletes a row that is still waiting to be sent.system-message-thread-ownership-batchtemplate andownership-batchkind with athread-batchsubject; the timeline titles it "Ownership changed for N threads".The queue drawer shows notices usefully.
ThreadQueuedMessagegainssystemNotice. Notice rows use the timeline's own title and icon ("3 threads updated", "X assigned to you") and show only their wait reason underneath.editable: falseand the update route refuses a rewrite with 409, so the CLI and SDK follow the same rule.Other
@get-bb/plugin-sdkbumped to 0.6.124. The bundled types inlineSystemMessageKindandThreadQueuedMessage.How you verified
Tests
thread-ownership-notices.test.tsreplaces the timer-mock debounce test and runs against real queue rows. It covers:ownership-batchturn. This fails on main withexpected [] to have a length of 1 but got +0. With a 2.3 s wait added on main, the same three unassigns produce 1 delivered turn plus 2 more queued notices.stuck/offhandling; single change keeps today's exact text.editable: falsewithsystemNotice, and a rewrite refused with 409.turbo run testfor domain, server-contract, cli and client-core.turbo run typecheckpasses across server, app, db, cli, demo-server, plugin-sdk and test-helpers; app lint has no errors.Live on
pnpm start:worktree, with Claude Haiku managers and children, driven with the source CLI:queuedWork: noneand the sidebar clock went away.🤖 Generated with Claude Code