Pending self-settle is silently dropped when a queued message is steered into the running turn #36891
Before submitting#
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area#
apps/server
Steps to reproduce#
- Start a thread with a task that takes a while (for example a 40 second shell command, then a small file write).
- While that turn runs, send a second message such as "then settle this thread". It queues as a new run.
- Promote the queued message to steer into the running turn (the "send now" action in the composer, or
t3_queue promote_to_steerover MCP). - The agent finishes the work and calls
t3_thread_organize {"action":"settle"}on its own thread as its last tool call. The tool answers{"settlesWhenTurnEnds":true}. - The turn completes.
Expected behavior#
The thread settles when the turn ends. The steered message was handled by that same turn.
Actual behavior#
The thread stays open. Nothing tells the agent or the user that the settle was dropped: the tool call reported success and the agent's last line says it settled.
Cause, from reading apps/server/src/orchestration-v2/ThreadManagementService.ts (settleAfterRun): promoting a queued message to steer cancels the queued run, but that cancelled run keeps its userMessageId. The message itself now belongs to the running turn. settleAfterRun sees a later run that carries a human message, treats it as a new follow-up and gives up without settling.
Seen twice: once in normal use on 2026-11-14 (second message sent 4 seconds after the first, promoted 2 seconds later), and once reproduced on purpose with the steps above. In the store, the runs of the thread read completed, cancelled and settledAt stays null; the server trace has no thread.settle for that run.
Impact#
Minor bug or occasional failure
It bites exactly when a user adds "and settle when done" as an afterthought while the agent is already working, so finished threads pile up in the sidebar.
Version or commit#
0.1.9 (desktop, macOS). The same check is on main at 3238db7a86.
Environment#
macOS 26, Apple silicon, Claude provider (Claude Code). The code path is provider independent.
Workaround#
Send the settle request after the turn has finished, or settle by hand.
I have a fix with tests and will link the PR.
tanstack-source added labelsbug
juliusmarminge closed this
Sign in to join this conversation.