Repository navigation
Description
Summary
When a user messages a child thread directly (for example bb thread tell <child> "go ahead and delete the old files"), the completion notice delivered to the parent thread is byte-identical to the notice for a turn the parent itself initiated. The parent agent cannot tell the user overrode the child's mandate, so it may misread the child's new behavior as exceeding its delegated authority and send conflicting stop or corrective instructions. The server already persists who initiated each turn on client/turn/requested (source, initiator, senderThreadId, input) — the parent-notification path simply never reads it.
Versions and environment
- bb: from source at
origin/main4354b88ce14457fbdf1fc1a8e0db2dd4b5ef90f3 - OS: Linux 6.8.0-139-generic
- Node: v24.15.0
- Provider: not provider-specific; the notice is assembled server-side in
apps/server/src/services/threads/child-thread-notifications.ts - Reproduction method: faithful repro at the exact code path — the rendering layer has no author input and unit tests on
mainassert the verbatim notice text (see Evidence). A reference fix (linked below) was additionally verified end-to-end on a source dev instance on the pre-port branch: a parent-spawned child, a direct userthread tellto the child, a parentthread tell, and two children completing within the batch window produced the expected notices.
Steps to reproduce
-
From inside the parent thread (where
BB_THREAD_IDis set), spawn a child:bb thread spawn --project <project-id> --parent-self \ --prompt "Clean up old files. Do not delete anything without my approval."
Note the child thread id printed, e.g.
thr_child. -
As the user — in a shell without
BB_THREAD_ID— tell the child directly, changing its mandate:bb thread tell thr_child "Go ahead and delete the old files." -
After the child's turn completes, read the parent's event log:
bb thread log <parent-thread-id>
Expected vs actual
Actual notice delivered to the parent on main (4354b88ce), verbatim from the rendering path and its pinned test assertions — identical whether the parent or the user initiated the turn:
[bb system]
@thread:thr_child completed:
Deleted the old files.
Expected notice for a turn containing direct user input (as implemented in the linked reference commit):
[bb system]
@thread:thr_child completed:
This turn included input from the user directly in this thread; you did not initiate that input.
User message:
Go ahead and delete the old files.
Deleted the old files.
The user's direct instructions to this thread take precedence over your earlier instructions. Review the thread before sending corrective, stop, or reassignment instructions.
Batch notices have the same gap: on main a direct-user-input turn renders identically to any other - @thread:thr_x completed. line; the reference implementation marks it (turn included direct user input) with an indented quote and a batch-level precedence instruction.
Evidence
On main the notification pipeline has no turn-author concept:
ChildThreadTurnNotificationBatchItemcarries only thread/output/status fields — no author:export interface ChildThreadTurnNotificationBatchItem { queueChildThreadTurnNotificationBestEffortis called with no provenance argument from every completion/interruption path:export async function queueChildThreadTurnNotificationBestEffort( - Yet the needed data is already persisted:
turnRequestEventDataSchemarecordssource("spawn"/"tell"),initiator, andsenderThreadIdper request:bb/packages/domain/src/thread-events.ts
Lines 78 to 92 in 4354b88
export const turnRequestEventDataSchema = z.object({ direction: z.literal("outbound"), requestId: clientTurnRequestIdSchema, // Retry provenance, written only when a `turn.failed` gate's retry row // dispatches. Both fields are present together or not at all: absence means // "this is an original dispatch", which is the overwhelmingly common case. // (Supersedes the pre-plugin `continuationOfRequestId` key, which the removed // core rate-limit recovery wrote and nothing ever read.) /** The original request this attempt re-submits, unchanged across attempts. */ retryOfRequestId: clientTurnRequestIdSchema.optional(), /** Which attempt this is: 2 is the first retry of the original request. */ retryAttempt: z.number().int().min(2).optional(), source: z.enum(["spawn", "tell"]), initiator: threadTurnInitiatorSchema, senderThreadId: z.string().nullable(),
Reference implementation on a fork, based on origin/main 4354b88ce — adopt as you see fit:
- Commit: hxy91819@df90374
- Turn-author classification (
source/initiator/senderThreadId→ direct-user / parent / other-agent, with retry provenance resolved throughretryOfRequestId): https://github.com/hxy91819/bb/blob/df903740fd723bca50cf15d0c5596f62d6531525/apps/server/src/services/threads/child-thread-notifications.ts#L42 - Best-effort author resolution with malformed-row and retry fallbacks: https://github.com/hxy91819/bb/blob/df903740fd723bca50cf15d0c5596f62d6531525/apps/server/src/services/threads/child-thread-notifications.ts#L78
- Structured
outcomes[].directUserInputflag so clients can badge these turns: https://github.com/hxy91819/bb/blob/df903740fd723bca50cf15d0c5596f62d6531525/packages/domain/src/system-message.ts#L43 - Targeted join query listing all
client/turn/requestedrows accepted into a turn: https://github.com/hxy91819/bb/blob/df903740fd723bca50cf15d0c5596f62d6531525/packages/db/src/data/events.ts#L2031
What you ruled out
- Searched get-bb/bb open and closed issues (
child thread,parent notification author,turn initiator); no duplicate found. - Not the scope of A child interrupted by a host daemon disconnect never notifies its parent #3956 or Notify parents when delegated child work ends unexpectedly #4356: those cover notifying parents when child work ends unexpectedly (daemon disconnect, abnormal termination). This bug concerns who initiated a turn that is notified normally — including normal completions.
- Reproduced on
mainat4354b88cevia the exact code path: the batch renderer's item type has no author field, so its output cannot vary with the turn's initiator — pinned bymain's own test assertions quoting the notice verbatim. The reference fix was verified end-to-end on a source dev instance against the pre-port branch (a parent-spawned child, a direct userthread tellto the child, a parentthread tell, and two children completing within the batch window produced the expected notices). The notice texts above are verbatim test-asserted strings, not paraphrases.
Suggested priority and effort
Affects every parent→child delegation where the user also talks to the child directly; the parent may issue stop/corrective orders that contradict the user's live instructions. No data is lost, and the workaround is to have the parent review the child (bb thread log) before acting — which the agent guidance cannot currently enforce because the notice gives it no signal to do so. Effort is moderate: one targeted db query, author classification in the existing notification module, an optional field on childThreadOutcomeSchema, and template/docs updates — a complete, tested implementation is linked above.
Checks
- 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.
Investigation report: the linked fork commit and its tests are the full write-up; the BB threads that produced it ran on the reporter's machine and are not publicly linkable.
AGENT GENERATED
Activity
Mark feature/child-turn-author as reported (get-bb#4424)
Mark feature/child-turn-author as reported (get-bb#4424)
SawyerHood commentedon Sep 30, 2026
Verified notice/persistence report: https://get-bb.github.io/reports/issues/4424.html
REPRODUCED in two clean checkouts: distinct persisted user, parent-agent, other-agent and system initiators produce equivalent queued parent notices; mixed versus parent-only batches also match. A changed-output control changes the notice. Actual SQLite evidence and the complete test are included. No agents were started; live interpretation, immediate delivery, retry and multi-input behavior remain untested.
Mark feature/child-turn-author as reported (get-bb#4424)
hxy91819 commentedon Oct 3, 2026
Following up with an implementation that resolves the initiator from the stored events, in case it is useful alongside the verified report above.
Branch
feature/child-turn-authoron hxy91819/bb, rebased ondesktop-v0.45.0(129f6217): hxy91819/bb@desktop-v0.45.0...hxy91819:bb:feature/child-turn-author — core commit hxy91819@567a7f686Approach:
client/turn/requestedevents already record who authored each accepted input; the notification path never consulted them. A targeted@bb/dbquery joins a turn'sturn/input/acceptedrows to theirclient/turn/requestedrows in acceptance order.tell+ user initiator + no sender thread), parent (spawn source or the parent'ssenderThreadId), or other agent. Legacy rows with missing fields still parse.nulland render unchanged. Host-side interruptions resolve the interrupted turn's author too.Running this on a fork since late September: parents stopped sending corrective or stop instructions after a user widened a child's authorization mid-turn. Diff is 17 files, +901/−12, mostly tests.
Mark feature/child-turn-author as reported (get-bb#4424)