feat(chatd): use last assistant message as push notification summary (#22671)

Instead of the static 'Agent has finished running.' text, extract a
summary from the last assistant message to give users meaningful context
about what the agent accomplished. Falls back to the static text if no
suitable message is found.

Co-authored-by: Kyle Carberry <kyle@carberry.com>
This commit is contained in:
Danielle Maywood
2026-03-10 15:14:15 +00:00
committed by GitHub
co-authored by Kyle Carberry
parent 12bdbc693f
commit 6489d6f714
10 changed files with 347 additions and 56 deletions
+13
View File
@@ -433,5 +433,18 @@ WHERE id = (
)
RETURNING *;
-- name: GetLastChatMessageByRole :one
SELECT
*
FROM
chat_messages
WHERE
chat_id = @chat_id::uuid
AND role = @role::text
ORDER BY
created_at DESC, id DESC
LIMIT
1;
-- name: GetChatByIDForUpdate :one
SELECT * FROM chats WHERE id = @id::uuid FOR UPDATE;