Note
Grok responding on behalf of Julius.
Confirmed on main: this is a bug in the send path.
When a sent message switches the thread to another instance, dispatchMessage only detaches the old session when canResumeAcrossInstances is true, meaning the instances share native history. For instances with different config dirs it starts the run on the new instance and never detaches the old session. It never reads the switch plan's releaseProviderSessionIds. The same switch started from a queued run (startNextQueuedRun) or from a selection mutation (dispatchThreadMutation) does detach the sessions in that list. So the old claude process stays bound to the thread and can keep taking wake turns that the UI doesn't show.
How this relates to other issues:
- #16000 is the opposite problem: detaching kills live background subagents with no background-work check. The fix here should use whatever guard #16000 settles on, not a bare detach.
- #17099 / PR #17109 handle the empty wake run on the new provider. They don't stop the old process.
- #16565 / PR #17096 have the same trigger but a different symptom (the MCP token is stale).
Until this is fixed, wait for background subagents to finish before you switch instances, or stop the old claude process after the switch.