Repository navigation
Description
Summary
A mode: "start" send can be evaluated from a stale idle Thread object after the persisted thread status has become active. When the host is suspended, dispatch currently checks host readiness first and queues host-offline instead of returning thread_not_writable/already_active. The dispatcher should refresh thread state and reject the stale start before the host-wait path.
Versions and environment
Source checkout based on 7c54dbf7d4ecf9fc818c96e15fe059edeae1d52f (bb-app 0.43.3), Ubuntu 24.04. The affected order is still unchanged on current main at c00623d16ea93bbf18779f4f2b3062d956fe82ea; I have not rerun the full suite on that newer SHA.
Steps to reproduce
- Seed a provider-backed thread and retain its initial
idlerow as the request snapshot. - Set the backing host to
phase: "suspended". - Apply
run.startedso the persisted thread becomesactive, while keeping the stale idle snapshot. - Call
acceptThreadSendRequestwith the stale snapshot and{ mode: "start" }. - Inspect the result and queued messages.
A deterministic regression test is included in the linked fork commit.
Expected vs actual
Actual: dispatch enters the suspended-host path, queues the message with `waitingOn: { kind: "host-offline" }`, and requests host readiness. The caller does not receive the active-thread conflict.
Expected: dispatch refreshes thread state first and returns HTTP 409 with `code: "thread_not_writable"` and `details.reason: "already_active"`. `queue-if-active` must keep its existing host-wait behavior.
Evidence
Patch and regression tests: AlexeySapsay@f81db13
The patch moves the current-thread freshness check and explicit mode: "start" active-thread rejection before host readiness handling. It also verifies that queue-if-active still waits for a suspended host. Targeted regression tests passed 2/2; the adjacent dispatch group passed 30/30.
What you ruled out
- Not caused by the client adapter: the wrong wait outcome is produced inside server dispatch.
- Not a generic suspended-host bug:
queue-if-activeshould still wait and has a regression test. - Exact searches for
already_active host-offlineandqueue-if-active suspendedfound no open or closed duplicate issue.
AGENT GENERATED — implementation and evidence: AlexeySapsay@f81db13
Suggested priority and effort (optional)
Medium. No data loss. A start request can receive incorrect queued semantics and wait on host readiness. Workaround: refresh state and avoid sending mode:start to an active thread.
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.
Activity
bb-slop-cop commentedon Sep 22, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotClassification: Bug · Priority: Medium · Effort: Low ·
threads.Reproduction report: REPRODUCED, high root-cause confidence; label:
confirmed-repro.Host readiness queues the message before refreshing thread state and rejecting an explicit start on an active thread. The regression failed in two clean trusted-main checkouts for both stale and fresh snapshots; the queue-if-active control passed.
Fix: PR #4038 — ready, not merged. Two files, 120 changed text lines. All 118 relevant tests, server typecheck, and diff checks passed after the fix.
Reject active thread starts before host readiness waits (get-bb#4038)