From 79307b7933d9607a7f0033dbbf8446b2027279b5 Mon Sep 17 00:00:00 2001 From: Ahmed Ibrahim Date: Mon, 9 Mar 2026 22:28:43 -0700 Subject: [PATCH] Delay pending cleanup until task aborts (#14000) ## Summary - move interrupted-turn cleanup so running tasks are aborted before pending approvals are cleared - keep unified exec shutdown behavior unchanged ## Why this fixes the flake The interrupted-turn path could clear pending approvals before the in-flight task had observed cancellation. On slower runners that let an approval wait resolve in between those steps, tests would sometimes surface a model-visible rejection instead of the expected TurnAborted flow. Draining the active turn first and only then clearing pending approval state makes the abort ordering deterministic.