Skip to content

Recover stranded startup queues without replaying interrupted input - #4392

Closed
ymichael wants to merge 1 commit into
mainfrom
bb/fix-issue-4365-stranded-turn-starting-queue-thr_wu5ekgbe75
Closed

ymichael wants to merge 1 commit into
mainfrom
bb/fix-issue-4365-stranded-turn-starting-queue-thr_wu5ekgbe75

Conversation

@ymichael

@ymichael ymichael commented Sep 26, 2026 •

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

In #4365, reconnect could revive an errored thread from daemon liveness even though its stored turn had already ended. Follow-ups then waited for a turn-start event that would never arrive. Separately, a provider startup watchdog leaves an accepted request pending; the timeline misleadingly showed Working, and explicitly stopping it preserved the follow-up with a stale wait that disabled Send now.

What changed

  • Require a persisted active turn before reconnect revives an errored thread.
  • Preserve startup-waiting input for manual recovery after a definite failure, without scheduling a replay.
  • Clear stale startup waits when Stop settles, while preserving the manual-stop pause on automatic sending.
  • Label genuinely pending startup “Waiting for provider to start…”. A watchdog warning alone does not prove failure and does not replay or cancel ambiguous input.

No daemon wire/protocol, database schema, public API, or CLI changes. Existing stop and queue operations remain the recovery surfaces. Historical phantom-active records are not backfilled.

Related integration boundaries: #4271 changes disconnect retention/reconciliation; #4356 adds parent notices to host interruption and terminal queue failure. Keep manual Stop silent and ensure manual-recovery queue rows are not mistaken for exhausted automatic dispatch retries. #3613 and #4017 also affect late/terminal turn settlement. These combinations have not been tested as a merged stack.

How you verified

  • Pristine-main server regression at the current main parent 68fd492163: 4 failures and 1 healthy control pass; patched regression passes. Timeline regression fails before and passes after.
  • 374 focused tests passed at PR head: 128 server, 98 agent-runtime, 87 daemon, 48 database, 8 fake-provider integration, and 5 UI tests.
  • Turbo typecheck/build passed; formatting and diff checks passed. Targeted lint has the same 58 pre-existing comment violations as baseline; app lint has no errors.
  • CI completed: 16 checks passed, 2 conditional jobs skipped, no failures.
  • Rebuilt persistent PR server at exact head 454010b9d5712282899dd86065e5b1c70a41b797; retained a separate main-parent control server and resettable pending Stop fixtures.
  • Sawyer Hood dev-browser exercised the isolated source app before/after. Stop preserves exact queued text, enables Send now/Edit, and survives reload. Evidence, reset scripts and the handoff are retained in BB thread storage.

Synthetic fixtures prove the state handling, not the original heartbeat outage or Claude startup incident. No reporter thread was modified. Native Claude replay and the original empty-panel report remain unverified.

Fixes #4365

AGENT GENERATED

@SawyerHood

Copy link
Copy Markdown
Collaborator

This is an automated message. We have closed this pull request because it has been open for more than two weeks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Queued messages wait for turn start while interrupted or stalled threads show Working

2 participants