mirror of
https://github.com/coder/coder.git
synced 2026-06-06 22:48:19 +00:00
7bcd9f6de8
When a user interrupts a chat, the status transitions to `waiting` which previously triggered an "Agent has finished running." web push notification. This is incorrect — the user interrupted it themselves, so no notification is needed. ## Changes ### `coderd/chatd/chatd.go` - Added `wasInterrupted` flag alongside the existing `status` variable - Set the flag when `ErrInterrupted` is detected in the error handler - Added `!wasInterrupted` to the web push dispatch condition ### `coderd/chatd/chatd_test.go` - Added `TestInterruptChatDoesNotSendWebPushNotification` that creates a chat with a mock webpush dispatcher, processes it, interrupts it, and verifies no push notification was dispatched - Added `mockWebpushDispatcher` implementing the `webpush.Dispatcher` interface