feat(assistant): web push on chat completion + ?c= deep-link#19
Merged
Conversation
Close the PWA after sending → get a Web Push when the assistant reply lands → tap to open the right conversation. Previously the reply would sit silently in the DB until you reopened the app. - runChatJob dispatches a tag-deduped push (chat-<msgId>) after persist, with a 140-char preview body and url=/assistant?c=<convId> - AssistantPage reads ?c= on mount and auto-loads that conversation Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Six new tests over POST /api/assistant/chat: - 401 unauthenticated, 400 empty message - happy path: streamed reply triggers tag-deduped Web Push with /assistant?c=<convId> deep-link URL - error path: stream throw → "Assistant: error" push with partial accumulated content as body - empty reply → no push fired - /remind shortcut bypasses LLM and skips push Web suite: 45 → 51 tests, all passing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
runChatJobfinishes (success or error), send a Web Push with a 140-char preview of the reply, tag-deduped per message id, URL/assistant?c=<convId>.AssistantPagereads?c=on mount and auto-loads that conversation, so tapping the notification deep-links to the right thread.Why
Closed/backgrounded PWA used to sit silent — the reply landed in the DB but the user never knew. Now: send a long-running prompt, close the app, get notified, tap to read.
Test plan
pnpm turbo run test --filter=@mysuperapp/web— 45/45 green🤖 Generated with Claude Code