Based on bb self-debugging:
Steps:
- Start a run_in_background job longer than one turn (~10 min).
- Let the turn end.
- Send any follow-up message.
- Expected: still running.
- Actual: taskStatus: "stopped", process gone, output file 0 bytes.
The replacement claude --resume process starts at the same second as the stopped event, in two independent threads. Environment-wide, so sibling threads lose their runs too.
bb does have a guard for exactly this (entryHasActiveRuntimeWork, with a comment saying background tasks must count as active work), and I verified its inputs are correct — bb emits item/started / backgroundTask / pending as the tracker expects. So the teardown is bypassing that guard, not failing it.
Based on
bbself-debugging:Steps:
The replacement claude --resume process starts at the same second as the stopped event, in two independent threads. Environment-wide, so sibling threads lose their runs too.
bb does have a guard for exactly this (entryHasActiveRuntimeWork, with a comment saying background tasks must count as active work), and I verified its inputs are correct — bb emits item/started / backgroundTask / pending as the tracker expects. So the teardown is bypassing that guard, not failing it.