-
Notifications
You must be signed in to change notification settings - Fork 0
Instrument Pendo Track Agent #113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -77,6 +77,12 @@ const Chat: FC = () => { | |
|
|
||
| const sendMessageMutation = trpc.sendMessage.useMutation({ | ||
| onSuccess: (newMessage: Message, context) => { | ||
| pendo.trackAgent("agent_response", { | ||
| agentId: "ENqdE-F1Bgedm5TdtfzXYCNw2lo", | ||
| conversationId: openChat.id, | ||
| messageId: crypto.randomUUID(), | ||
| content: newMessage.content, | ||
| }) | ||
| setOpenChat({ | ||
| ...openChat, | ||
| messages: [...openChat.messages, newMessage], | ||
|
|
@@ -264,6 +270,14 @@ const Chat: FC = () => { | |
| }, | ||
| ]) | ||
| } | ||
| const promptMessageId = crypto.randomUUID() | ||
| pendo.trackAgent("prompt", { | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [critical] Was this review helpful? React with 👍 or 👎 to share your feedback. |
||
| agentId: "ENqdE-F1Bgedm5TdtfzXYCNw2lo", | ||
| conversationId: openChat.id, | ||
| messageId: promptMessageId, | ||
| content: strippedMessage, | ||
| suggestedPrompt: !!selectedCommand, | ||
| }) | ||
| sendMessageMutation.mutate({ | ||
| chatId: openChat.id, | ||
| message: newMessage, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[critical] Same
pendonull-safety issue on the response side: if Pendo is blocked and this throws inonSuccess, thesetOpenChat(...)call below never executes — meaning the AI response is received from the server but never rendered in the UI. The user sees the typing indicator disappear and nothing appear. This silently swallows a successful response.Was this review helpful? React with 👍 or 👎 to share your feedback.