From fee03624beb8b5b8b5f368a75d09a369354df3ac Mon Sep 17 00:00:00 2001 From: Weyoune Date: Sat, 14 Nov 2026 08:21:18 +0100 Subject: [PATCH] Answer a live intervention only after it has run The kickoff thread moved the posted task out before running it, so the waiting command could read the outcome too early and refuse a substitution or tactic change (without a reason) that was then applied anyway. The task stays posted until it has finished. Co-Authored-By: Claude Fable 5.2 --- src/modern/app/modern_session.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modern/app/modern_session.cpp b/src/modern/app/modern_session.cpp index 97f5934..57295a8 100644 --- a/src/modern/app/modern_session.cpp +++ b/src/modern/app/modern_session.cpp @@ -9884,7 +9884,9 @@ cli::Json ModernSession::ui_command(const cli::Json& request, uint64_t& revision for (;;) { r->changed.wait(lock, [r] { return r->finish || r->remaining > 0 || bool(r->task); }); if (!r->task) break; - auto task = std::move(r->task); + // the task stays posted until it has run: the waiting command reads its outcome + // only after `task` is cleared below (a moved-from function would look done at once) + const auto task = r->task; lock.unlock(); task(); lock.lock();