Repository navigation
Description
1. Summary
When a structured workflow worker calls bb_workflow_result, submitStructuredResult calls await stopChild(threadId) synchronously inside the tool handler before returning { ok: true } (and similarly on exhausted retries). This cancels the worker's in-flight bb_workflow_result tool call and ends the turn with manual-stop / status=interrupted, even though the workflow accepted the result and succeeded.
2. Versions and environment
- bb version:
0.50.1(Linux x64 AppImage), reproduced againstmainat commitb0ddaad7 - OS: Linux x86_64, Node
v22.23.2 - Providers observed:
acp-devin,acp-omp,acp-opencode
3. Steps to reproduce
- Run any workflow script containing an
agent(..., { outputSchema: { ... } })call. - Wait for the worker to call
bb_workflow_resultwith a valid payload matchingoutputSchema. - Inspect the worker thread's event log (
bb thread log <worker-thread-id> --json).
Alternatively, inspect plugins/workflows/src/service.ts at b0ddaad7:
- https://github.com/get-bb/bb/blob/b0ddaad7/plugins/workflows/src/service.ts#L1330-L1344
- https://github.com/get-bb/bb/blob/b0ddaad7/plugins/workflows/src/service.ts#L1371-L1377
4. Expected vs actual
Actual:
Every structured worker's bb_workflow_result tool call completes with status: "interrupted" and a system/thread/interrupted event with reason: "manual-stop". Across 18 consecutive structured worker calls in live runs (e.g., thr_6ycd59awbb, thr_n6y2wrhbr2, thr_apitb346ja, thr_4p25xabqb8, thr_qe94jspfz9), 18/18 had bb_workflow_result interrupted by manual-stop.
Expected:
bb_workflow_result returns { accepted: true } cleanly so the tool call completes (status: "completed") and the worker finishes its turn normally without a self-inflicted manual-stop interruption. If a worker fails to go idle after receiving the terminal tool response, a bounded fallback timer should stop and archive it.
5. Evidence
- Code path (
b0ddaad7):submitStructuredResultcallsawait stopChild(threadId)beforereturn { ok: true }instored === "accepted"andstored === "idempotent", and beforereturn { ok: false, terminal: true, error }whenattempts > MAX_REPAIR_ATTEMPTS.- Additionally,
cleanupWorkers()(https://github.com/get-bb/bb/blob/b0ddaad7/plugins/workflows/src/service.ts#L549-L563) callsarchiveRetiredWorker(which invokesbb.sdk.threads.stop) on any retired worker as soon aswakeCalltriggersmaintenanceTick(), so merely removingawait stopChildwithout guardingcleanupWorkers()still races with the in-flight tool response.
- Existing harness test at
https://github.com/get-bb/bb/blob/b0ddaad7/plugins/workflows/src/server-harness.test.ts#L306-L312currently assertsthreads.stopwas called synchronously beforecallAgentTool("bb_workflow_result", ...)settles.
6. What you ruled out
- Related to process-server crash loop: unhandled AbortError on streamed response cancel (workflows worker stop during bb_workflow_result), Node 26 #8332, which reports a Node 26
process-servercrash on cancelled compressed tool-call streams triggered by this same prematurestopChild; this issue tracks the deterministicworkflowsworker interruption bug itself on all platforms and Node versions (including Node 22 on Linux where process-server crash loop: unhandled AbortError on streamed response cancel (workflows worker stop during bb_workflow_result), Node 26 #8332 did not reproduce). - Still present on
mainatb0ddaad7. - Occurs across multiple providers (
acp-devin,acp-omp,acp-opencode).
7. Suggested priority and effort
High priority, small effort: affects 100% of structured agent() calls in workflows, corrupts session/tool-call metrics, and triggers the cancelled-stream path behind #8332.
AGENT GENERATED
Activity
bb-slop-cop commentedon Nov 29, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotplugins, built-in pluginworkflows. Filled missing classifications without replacing existing values.confirmed-repro.fix(workflows): let structured replies finish before worker cleanup (g…
fix(workflows): let structured replies finish before worker cleanup (g…