Skip to content

feat(assistant): web push on chat completion + ?c= deep-link#19

Merged
sbeashwar merged 2 commits into
mainfrom
fix/chat-push-on-completion
May 3, 2026
Merged

feat(assistant): web push on chat completion + ?c= deep-link#19
sbeashwar merged 2 commits into
mainfrom
fix/chat-push-on-completion

Conversation

@sbeashwar

Copy link
Copy Markdown
Owner

Summary

  • After runChatJob finishes (success or error), send a Web Push with a 140-char preview of the reply, tag-deduped per message id, URL /assistant?c=<convId>.
  • AssistantPage reads ?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
  • Smoke: send a chat turn, close the PWA, confirm push arrives with reply preview, tap → opens the right conversation

🤖 Generated with Claude Code

sbeashwar and others added 2 commits May 2, 2026 20:14
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>
@sbeashwar sbeashwar merged commit c9349a2 into main May 3, 2026
1 check passed
@sbeashwar sbeashwar deleted the fix/chat-push-on-completion branch May 3, 2026 03:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant