Restore custom Kapa chat with trigger-based support handoff - #466
Restore custom Kapa chat with trigger-based support handoff#466dannyneira wants to merge 35 commits into
Conversation
Adds an always-on Create ticket action in the Kapa chat UI, includes transcript context in submissions, and provides a preview/webhook backend endpoint for handoff testing. Co-Authored-By: Oz <oz-agent@warp.dev>
Set the handoff endpoint to non-prerendered so static/SSR build inputs resolve correctly in CI and Vercel. Co-Authored-By: Oz <oz-agent@warp.dev>
Move the custom handoff POST route to /kapa-handoff and remove the stale /api/kapa-handoff file to avoid CI/Vercel SSR rollup conflicts with the /api docs page. Co-Authored-By: Oz <oz-agent@warp.dev>
Co-authored-by: Oz <oz-agent@warp.dev>
Co-Authored-By: Oz <oz-agent@warp.dev>
Co-Authored-By: Oz <oz-agent@warp.dev>
Co-Authored-By: Oz <oz-agent@warp.dev>
Co-Authored-By: Oz <oz-agent@warp.dev>
Co-Authored-By: Oz <oz-agent@warp.dev>
Co-Authored-By: Oz <oz-agent@warp.dev>
This reverts commit fd762df.
This reverts commit 93f73dd.
This reverts commit c805b22.
This reverts commit a6048d3.
Co-Authored-By: Oz <oz-agent@warp.dev>
Co-Authored-By: Oz <oz-agent@warp.dev>
Co-Authored-By: Oz <oz-agent@warp.dev>
Co-Authored-By: Oz <oz-agent@warp.dev>
Co-Authored-By: Oz <oz-agent@warp.dev>
Co-Authored-By: Oz <oz-agent@warp.dev>
Co-Authored-By: Oz <oz-agent@warp.dev>
Co-Authored-By: Oz <oz-agent@warp.dev>
Co-Authored-By: Warp Agent <agent@warp.dev>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-Authored-By: Warp Agent <agent@warp.dev>
Co-Authored-By: Warp Agent <agent@warp.dev>
Co-Authored-By: Warp Agent <agent@warp.dev>
Co-Authored-By: Warp Agent <agent@warp.dev>
Co-Authored-By: Warp Agent <agent@warp.dev>
Co-Authored-By: Warp Agent <agent@warp.dev>
…By: Warp Agent <agent@warp.dev>
…ored-By: Warp Agent <agent@warp.dev>
…Agent <agent@warp.dev>
Co-Authored-By: Warp Agent <agent@warp.dev>
Co-Authored-By: Warp Agent <agent@warp.dev>
Co-Authored-By: Warp Agent <agent@warp.dev>
|
I'm starting a first review of this pull request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR restores the custom Kapa chat UI, adds a support handoff flow, updates Kapa-related environment configuration, and expands CSP allowances for the chat dependencies.
Concerns
- The new
/api/support-handoffroute is public and forwards ticket-creation payloads without server-side abuse protection. - The route falls back to a hard-coded external endpoint, so missing configuration can still send user email and chat transcript data to an implicit destination.
Security
- Public support ticket forwarding needs server-side bot/rate-limit protection or a validated challenge token before it is exposed.
- User support data should only be forwarded to an explicitly configured endpoint.
Verdict
Found: 0 critical, 2 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
| return `https://app.kapa.ai/${kapaProjectId}/conversations/${kapaThreadId}`; | ||
| } | ||
|
|
||
| export const POST: APIRoute = async ({ request }) => { |
There was a problem hiding this comment.
|
|
||
| export const POST: APIRoute = async ({ request }) => { | ||
| const supportHandoffEndpointUrl = | ||
| SUPPORT_HANDOFF_ENDPOINT_URL || DEFAULT_SUPPORT_HANDOFF_ENDPOINT_URL; |
There was a problem hiding this comment.
SUPPORT_HANDOFF_ENDPOINT_URL will still forward user email and chat transcripts to that endpoint. Fail closed when the env var is absent so PII only leaves via an explicitly configured destination.
Summary
Create tickethandoff in the custom UI (conversation length >= 3, downvote, uncertainty)mailto:handoff draft instead of relying on the prior server endpointPUBLIC_KAPA_PROJECT_IDenv supportValidation
Co-Authored-By: Warp Agent agent@warp.dev