Skip to content

Provider stays blocked on a question the server interrupted after a same-instance daemon reconnect #6251

Closed

Description

@timsuchanek

Summary

A Claude Code thread was waiting on an AskUserQuestion. Its host daemon's WebSocket dropped and the same daemon instance reconnected 14 s later. The server marked the question interrupted but left the turn active, and the provider kept waiting for an answer nobody could give. bb accepted every later message as a steer into that turn (turn/input/accepted), and none of them was processed. The thread stayed stuck for about five hours until someone ran bb thread stop and re-sent the messages. The interaction's reason says "retry the thread to continue", but the thread was active, so no retry was offered.

Versions and environment

  • Server: bb-app 0.43.4 (npm, systemd unit on Linux).
  • Host daemon: bb-app 0.43.4 on a remote Linux machine (Linux 7.0.0-1008-aws), connected through bb Connect.
  • Provider: claude-code, Claude Code 2.1.308, model claude-opus-5-5, worktree environment.

Steps to reproduce

Observed on 0.43.4:

  1. Start a Claude Code thread on a remote host and have it call AskUserQuestion.
  2. While the question is pending, drop the daemon's WebSocket for 6–29 s without restarting the daemon, so that it reconnects as the same instance.
  3. Once the socket has been closed for 5 s, the question turns interrupted. The thread stays active.
  4. bb thread tell <thread> "continue" is accepted as a steer. The agent never responds.

On 0.43.4 the trigger is the 5 s disconnect timer (completeDaemonDisconnectGrace), which #4271 removed. Main still reaches the same state by another path. When the live interactive.resolve command fails, for example with host_unavailable because the socket closed while the answer was in flight, settleInteractiveResolveCommandResultInTransaction interrupts the interaction. The provider's wait in the daemon's InteractiveRequestRegistry stays open, and nothing tells the daemon that the interaction ended: onSessionOpened does not look at open provider waits. I have not reproduced the main path live. The linked PR adds a daemon test that hangs on main for this case (unverified on a live main server).

Expected vs actual

Expected: after a reconnect, the daemon and the server agree on which provider requests are still open. Either the question can still be answered, or the provider's wait ends so that the turn continues and reads its steers.

Actual (bb thread log --json, trimmed; times UTC):

929 19:43:48 item/started               toolCall AskUserQuestion  status=pending
930 19:43:48 system/interaction/lifecycle pint_rgw7zfam2y status=pending
933 23:04:47 system/interaction/lifecycle pint_rgw7zfam2y status=interrupted
             statusReason="Host daemon disconnected while awaiting user interaction; retry the thread to continue"
934 00:24:11 client/turn/requested      target={kind: steer, expectedTurnId: dabb017328-t1}  <user message>
935 00:24:12 turn/input/accepted
936 00:42:23 client/turn/requested      target=steer  <user message + image>
937 00:42:24 turn/input/accepted
938 01:13:57 client/turn/requested      target=steer  <user message>
939 01:13:58 turn/input/accepted
             (no further events until a manual `bb thread stop` the next day)

Evidence

  • Daemon log on the host: 23:04:42.160 Disconnected from server code=1006, then 23:04:56.136 Connected to server sessionId=hses_vd6r3tb2ek. The server interrupted the question at 23:04:47.198, 5 s after the close.
  • The daemon was not restarted. The bb-provider-bridge-worker and claude processes were 28 h old when inspected, matching the thread's creation time.
  • After bb thread stop, the event log shows turn/completed status=interrupted for dabb017328-t1. The next message started a new turn that resumed the same Claude session.
  • Thread thr_syxtiw4e2i on a self-hosted server.

What you ruled out

Suggested priority and effort (optional)

Work stops until someone notices and runs bb thread stop. Messages sent in the meantime are accepted but silently not processed. Workaround: bb thread stop <thread>, then re-send the messages. The proposed fix is small and daemon-only.

AGENT GENERATED

Activity

  1. added theissue type on Oct 25, 2026
  2. added
    host
    threads
    provider-claude-code
    ask-user-question
    confirmed-repro
    on Oct 25, 2026
  3. bb-slop-cop commented on Oct 25, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    • Classification: Bug · Priority High · Effort Medium. Labels: host, threads, provider-claude-code, ask-user-question, confirmed-repro.
    • Report: https://get-bb.github.io/reports/issues/6251.html — REPRODUCED, root-cause confidence high. The daemon reconnect regression fails identically in two clean trusted-main checkouts; a real-database server test confirms an interrupted interaction with an active thread and rejected registration replay.
    • Root cause: Session reopening never rechecks surviving daemon provider waits after the server ends their interaction.
    • Ready fix: Reconcile daemon interaction waits when sessions reconnect #6254 — 308 changed text lines across four host-daemon files. The regression passes after the fix; 107 relevant tests, scoped build/typecheck, formatting, and diff checks pass. No protocol or stored-data changes. Not merged.
    • Limits: No live Claude session was replayed. Two unrelated broader-suite failures also reproduce on unchanged production code and are documented in the report and PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ask-user-questionconfirmed-reprohostprovider-claude-codethreads

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions