cancelling a running prompt by its admission id stops the turn (#3263)

* fix(daemon): share the worker's prompt-admission registry with the turn runner Worker::new built two prompt-admission registries. The turn runner committed and cleared admissions in one copy, while the worker's cancel_prompt_admission arm registered and read the other. A running prompt therefore always looked like it was still waiting: a cancel answered `cancelled` instead of `owned`, and `cancelOwned: true` never aborted the turn, even though the daemon advertises owned_prompt_cancellation. Worker-side entries were also never cleared. The runner now gets a clone of the worker's registry, matching the single promptAdmissions map in the TS daemon. The new worker test cancel_owned_admission_aborts_the_running_prompt fails on main (`cancelled`) and passes with the fix. * fix(daemon): commit a queued prompt admission at pickup The turn runner committed an admitted prompt's admission inside run_turn, after the pickup had already popped the item out of its lane under the core lock. A cancel_prompt_admission that flipped the admission Waiting -> Cancelled inside that window left it Cancelled but run_turn still ran the prompt: commit only flips Waiting -> Owned, the cancel arm's lane drop was a no-op because the item had already left the lane, and nothing aborted the turn. The admission now commits inside the core-locked pickup, right after gather_delivery_batch (the TS daemon commits the admission at one synchronous point before its turn can start). commit reports a cancelled admission, the runner drops that item before flipping busy, and a batch that empties this way re-reads the lanes instead of starting a turn. The commit loop in run_turn is gone. A cancel that loses the race now sees Owned and answers owned, aborting through the existing cancelOwned path. The owned-cancel worker test now also queues a second prompt behind the held turn and flips its admission while it sits queued: that scenario fails on the PR head (the cancelled admission's turn still ran) and passes with the fix. * fix(daemon): preserve early owned prompt admission on queued work * fix(daemon): abort only the turn that owns an admission * test(daemon): verify owned queued wait and non-wait admission lifetime * test(daemon): keep admission wire test below clippy line limit * fix(daemon): clear withdrawn prompt admissions on abort and clear_queue --------- Co-authored-by: Kevin Thomas <kevin.jt2007@gmail.com>


Author Sebastian Müller Co-author Kevin Thomas Committer GitHub Date Commit Parent 2adb5b57