sendMessage captured currentSession at call time; if the user switched sessions while a prompt was in flight and it failed, the catch handler surfaced the error on and refetched the NOW-current session. Clear the sending flag for the session we actually sent to, but only set error / refreshMessages when it's still on screen. Found via runtime bug audit. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>