Fix race condition in `update_last_checkpoint` (#44801)

Release Notes:

- Fixed spurious "no checkpoint" error in agent panel

---

## Summary

`update_last_checkpoint` would call `last_user_message()` twice - once
at the start to capture the checkpoint, and again in an async closure
after the checkpoint comparison completed. If a new user message without
a checkpoint was added between these two calls, the second call would
find the new message and fail with "no checkpoint".

## Fix

Capture the user message ID at the start and use `user_message_mut(&id)`
in the async closure to find the specific message.

cc @mikayla-maki
32621dc5deNathan Sobo committed on 12/20/2025, 5:42:58 PM· committed by GitHubparent215ac50
1 file changedLine totals unavailable