Repository navigation
Description
Summary
Two task-origin threads remained visible as top-level sidebar rows after bb thread update <child> --parent-thread <parent> returned the updated parent and persisted it. Reloading the app made both rows appear under the parent. The same operation updates immediately in an isolated dev store on current main, so this report is unverified and needs evidence from a recurrence.
Versions and environment
- Observed 2026-09-03 on bb 0.41.0, Linux, Node 24.18.0, Codex 0.153.1
- App viewed remotely through bb Connect
- Server source checkout was
831fd0abd4when inspected after the incident - Original project:
proj_atixi2qwed - Original parent:
thr_b75gwewczb - Original children:
thr_n35mqx4spq,thr_6ccxy66282 - Closest repro attempted from source at
dbc16017c9c980391fb1bc604b45b94f9c3ae105with a fresh isolated dev data directory
Steps to reproduce
The original sequence was:
- Create two standalone threads through the Tasks plugin.
- Keep the app and project sidebar open.
- Run:
bb thread update thr_n35mqx4spq --parent-thread thr_b75gwewczb bb thread update thr_6ccxy66282 --parent-thread thr_b75gwewczb
- Observe the sidebar without reloading.
Closest faithful dev attempt, which did not reproduce:
- Start an isolated app with
scripts/bb-dev-app startand load it in Chrome. - Run:
eval "$(scripts/bb-dev-app env)" pnpm --silent bb:dev thread spawn --project personal --provider codex --prompt "Reply only with ok." pnpm --silent bb:dev thread spawn --project personal --provider codex --prompt "Reply only with ok." pnpm --silent bb:dev thread update <child> --parent-thread <parent>
- The child moved under the parent in the open sidebar within about one second, without navigation or reload.
The immediate update also worked with an active child, two children reparented in succession, and two threads in a standard worktree project.
Expected vs actual
Actual during the incident:
The CLI returned the requested parentThreadId and subsequent reads showed it persisted, but both children remained top-level sidebar rows. Reloading the app made them children.
Expected:
The open sidebar moves each child under the parent after the successful PATCH, without a reload.
Actual on current main in an isolated dev store:
The open sidebar moved each child immediately, so the incident did not reproduce.
Evidence
thr_n35mqx4spqandthr_6ccxy66282both currently persistparentThreadId: thr_b75gwewczb; both haveoriginPluginId: tasks.- The PATCH route passes
parentThreadIdtoupdateThread:bb/apps/server/src/routes/threads/base.ts
Lines 385 to 426 in dbc1601
patch(routes.update, async (context, payload) => { const thread = requirePublicThread(deps.db, context.req.param("id")); if (payload.parentThreadId) { assertValidParentThread(deps, { childThreadId: thread.id, parentThreadId: payload.parentThreadId, }); } if ("model" in payload || "reasoningLevel" in payload) { await applyThreadExecutionOverride(deps, { thread, patch: { ...("model" in payload ? { model: payload.model } : {}), ...("reasoningLevel" in payload ? { reasoningLevel: payload.reasoningLevel } : {}), }, }); } const metadataUpdate: UpdateThreadInput = {}; if ("title" in payload) { metadataUpdate.title = payload.title; } const sectionId = payload.sectionId; if (sectionId !== undefined) { if (sectionId !== null) { requireThreadSection(deps, sectionId); } metadataUpdate.sectionId = sectionId; } if ("parentThreadId" in payload) { metadataUpdate.parentThreadId = payload.parentThreadId; } if ("visibility" in payload) { metadataUpdate.visibility = payload.visibility; } const updated = Object.keys(metadataUpdate).length > 0 ? updateThread(deps.db, deps.hub, thread.id, metadataUpdate) : requirePublicThread(deps.db, thread.id); updateThreademitsparent-changedwith the project ID:andbb/packages/db/src/data/threads.ts
Lines 1788 to 1800 in dbc1601
if ("lastReadAt" in input) changes.push("read-state-changed"); if ( "visibility" in input && input.visibility !== existing.visibility ) { changes.push("title-changed"); } if ( "parentThreadId" in input && input.parentThreadId !== existing.parentThreadId ) { changes.push("parent-changed"); } bb/packages/db/src/data/threads.ts
Lines 1834 to 1837 in dbc1601
if (updated && changes.length > 0) { notifier.notifyThread(id, changes, { projectId: existing.projectId, }); - The hub broadcasts list-relevant thread changes to thread-list subscribers: and
Lines 84 to 92 in dbc1601
function subscriptionKeysForMessage(message: ChangedMessage): string[] { switch (message.entity) { case "thread": return message.id ? [ subscriptionKey({ kind: "thread-list" }), subscriptionKey({ kind: "thread-detail", threadId: message.id }), ] : [subscriptionKey({ kind: "thread-list" })]; Lines 738 to 754 in dbc1601
notifyThread( threadId: string, changes: ThreadChangeKind[], metadata?: ThreadChangeMetadata, ): void { const message: ThreadChangedMessage = { type: "changed", entity: "thread", id: threadId, ...(metadata ? { metadata } : {}), changes, }; if (isThreadListRelevantChange(message)) { this.notifyClients(message); } else { this.notifyThreadEventsAppendedCoalesced(threadId, message); } - The client maps
parent-changedto thread-list invalidation, which includes the sidebar bootstrap query:andbb/apps/app/src/hooks/cache-owners/realtime-cache-registry.ts
Lines 390 to 397 in dbc1601
"pin-state-changed": { flush: "debounced", dirty: [dirtyThreadListQueries, dirtyThreadDetailQueries], }, "parent-changed": { flush: "debounced", dirty: [dirtyThreadListQueries, dirtyThreadDetailQueries], }, bb/apps/app/src/hooks/cache-owners/cache-invalidation-groups.ts
Lines 81 to 95 in dbc1601
export function getThreadListInvalidationQueryKeys({ projectId, queryClient, }: ThreadListInvalidationArgs): QueryKey[] { const threadListQueryKeys = projectId ? getCachedProjectThreadListInvalidationQueryKeys({ projectId, queryClient, }) : [threadsQueryKey()]; return [ ...threadListQueryKeys, sidebarNavigationQueryKey(), threadSearchQueryKeyPrefix(), ]; - The tree is rebuilt from each entry's current
parentThreadId; it has no create-only path:andbb/packages/client-core/src/sidebar/projectThreadGroups.ts
Lines 289 to 297 in dbc1601
function isRootThread( thread: ThreadListEntry, projectThreadIds: ReadonlySet<string>, ): boolean { return ( thread.parentThreadId === null || !projectThreadIds.has(thread.parentThreadId) ); } bb/packages/client-core/src/sidebar/projectThreadGroups.ts
Lines 341 to 374 in dbc1601
export function buildProjectThreadGroups( allProjectThreads: readonly ThreadListEntry[], compareThreads: ThreadComparator = compareStandardThreads, draftThreadIds: ReadonlySet<string> = new Set(), ): ProjectThreadItem[] { return buildThreadTreeItems( allProjectThreads, compareThreads, true, draftThreadIds, ); } function buildThreadTreeItems( allThreads: readonly ThreadListEntry[], compareThreads: ThreadComparator, groupEnvironmentThreads: boolean, draftThreadIds: ReadonlySet<string>, ): ProjectThreadItem[] { const projectThreads = allThreads.filter(isSidebarProjectThread); const projectThreadIds = new Set(projectThreads.map((thread) => thread.id)); const childrenByParentId = new Map<string, ThreadListEntry[]>(); for (const thread of projectThreads) { if (thread.parentThreadId === null) continue; if (!projectThreadIds.has(thread.parentThreadId)) continue; const children = childrenByParentId.get(thread.parentThreadId); if (children) { children.push(thread); } else { childrenByParentId.set(thread.parentThreadId, [thread]); } } - No WebSocket disconnect, reconnect, invalid-message, or related server error was present around the original update window. The first relevant later log entry was a parent timeline load after the manual navigation/reload.
- Investigation thread: https://bee.getbb.app/threads/thr_jsuewiepay
What you ruled out
- Not a generally missing server event: the existing DB test verifies
parent-changed, and the isolated end-to-end operation updated immediately. - Not a missing sidebar query key:
getThreadListInvalidationQueryKeysexplicitly includessidebarNavigationQueryKey(). - Not create-only tree behavior:
buildThreadTreeItemsderives children from currentparentThreadIdvalues on every rebuilt list. - Not explained by active status: an active child updated immediately in the dev app.
- Not explained by two rapid updates: two sequential updates both appeared without a reload.
- Not explained by personal versus worktree project grouping: both variants updated immediately.
- No duplicate issue found with searches for reparent, parent-changed, sidebar, realtime, and refresh.
Suggested priority and effort (optional)
Medium if recurrent because the state is persisted and the workaround is a reload; unknown effort until a recurrence captures the client-side changed message and sidebar-bootstrap refetch.
- I reproduced this on the latest release or on
main, or I say above that I could not. - I searched open and closed issues for the same problem.
- If an agent wrote this, the body ends with
> AGENT GENERATEDand links the thread or report.
AGENT GENERATED
Activity
bb-slop-cop commentedon Sep 3, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotClassification: Bug · Priority Medium · Effort Medium · labels
threads,ui,partial-repro.Report: https://get-bb.github.io/reports/issues/3029.html
partial-reproResume sidebar refreshes interrupted by thread read updates (#4079)
Fix nesting worktree groups under threads (#4078)