Skip to content

Adjusted prompt to include support links, adjusted to use discord bot… #756

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

Merged
merged 5 commits into from
Jul 16, 2025

Conversation

madster456
Copy link
Collaborator

@madster456 madster456 commented Jul 10, 2025

… instead of webhook. Message formatter now supports link

  • Message formatter now includes link formatting
  • LLM now told to respond to users asking for support, or a person to talk to with our email, and discord link.
  • Now sends via bot to discord instead of web hook - this allows for threads with same sessionId to be created
  • Now sends LLM response along with user asked questions.

Important

Enhance Discord integration by using a bot for session management, update AI assistant to provide support links, and add link support in message formatting.

  • Discord Integration:
    • Switch from webhook to Discord bot in discord-webhook.ts for session threading and message handling.
    • Implement sendLLMResponseToDiscord() to send AI responses to Discord.
    • Add findExistingThread(), createNewThread(), and sendToThread() for thread management.
  • AI Assistant:
    • Update route.ts to include support contact information in AI responses.
    • Modify ai-chat.tsx to send AI responses to Discord and handle session data.
  • Message Formatting:
    • Add link support in message-formatter.tsx to render links in AI responses.

This description was created by Ellipsis for f1f5e2b. You can customize this summary. It will automatically update as commits are pushed.

… instead of webhook. Message formatter now supports links
Copy link

vercel bot commented Jul 10, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
stack-backend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 16, 2025 5:13pm
stack-dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 16, 2025 5:13pm
stack-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 16, 2025 5:13pm
stack-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 16, 2025 5:13pm

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

Enhanced Discord support integration by replacing webhook with bot implementation and improved message handling system.

  • Migrated from Discord webhooks to bot API in docs/lib/discord-webhook.ts enabling persistent thread-based conversations tracked by sessionId
  • Added support contact routing in AI prompt to guide users to Discord/email channels when appropriate
  • Implemented link formatting support in docs/src/components/chat/message-formatter.tsx with proper styling and accessibility
  • WARNING: In-memory session mapping in docs/lib/discord-webhook.ts may increase API calls due to serverless context resets
  • New endpoint docs/src/app/api/discord-webhook/response/route.ts lacks standard SmartRouteHandler pattern and input validation

5 files reviewed, 2 comments
Edit PR Review Bot Settings | Greptile

Copy link

recurseml bot commented Jul 10, 2025

😱 Found 1 issue. Time to roll up your sleeves! 😱

🗒️ View all ignored comments in this repo
  • The constraint 'TokenStoreType extends string' is too restrictive. It should likely be 'TokenStoreType extends string | object' to match the condition check in line 113 where TokenStoreType is checked against {}
  • Return type mismatch - the interface declares useUsers() returning ServerUser[] but the Team interface that this extends declares useUsers() returning TeamUser[]
  • There is a syntax error in the super constructor call due to the ellipsis operator used incorrectly. Objects aren't being merged correctly. This syntax usage can lead to runtime errors when trying to pass the merged object to 'super()'. Verify that the intended alterations to the object occur before or outside of the super() call if needed.
  • Throwing an error when no active span is found is too aggressive. The log function should gracefully fallback to console.log or another logging mechanism when there's no active span, since not all execution contexts will have an active span. This makes the code less resilient and could break functionality in non-traced environments.

📚 Relevant Docs

  • Function sets backendContext with a new configuration but doesn't pass 'defaultProjectKeys'. Since defaultProjectKeys is required in the type definition and cannot be updated (throws error if tried to set), this will cause a type error.
  • The schema is using array syntax for pick() which is incorrect for Yup schemas. The pick() method in Yup expects individual arguments, not an array. Should be changed to: emailConfigSchema.pick('type', 'host', 'port', 'username', 'sender_name', 'sender_email')

📚 Relevant Docs

  • Creating a refresh token with current timestamp as expiration means it expires immediately. Should set a future date for token expiration.
  • The 'tools' object is initialized as an empty object, even though 'tools' is presumably expected to contain tool definitions. This could cause the server capabilities to lack necessary tool configurations, thus potentially impacting functionalities that depend on certain tool setups.

📚 Relevant Docs

  • 'STACK_SECRET_SERVER_KEY' is potentially being included in every request header without checking its existence again here. Although it's checked during initialization, this could lead to security issues as it's exposed in all communications where the header is logged or captured.

📚 Relevant Docs

  • When adding 'use client' directive at the beginning, it doesn't check if file.text already contains the 'use client' directive. This could lead to duplicate 'use client' directives if the file already has one.

📚 Relevant Docs

Need help? Join our Discord for support!
https://discord.gg/qEjHQk64Z9

Copy link
Contributor

@N2D4 N2D4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, although next time try to make the PR smaller (the first, second, and 3rd+4th could be separate PRs each). For AI chatbot prompt changes, feel free to push to dev directly without a PR (just gave you permissions)

@N2D4 N2D4 assigned madster456 and unassigned madster456, fomalhautb and N2D4 Jul 10, 2025
- Resolved conflicts in docs/lib/discord-webhook.ts: kept Discord Bot API implementation with threading support while incorporating improved browser detection
- Resolved conflicts in docs/src/app/api/chat/route.ts: combined detailed support guidance with improved limitation handling
- Maintained discord_webhook_update functionality while integrating dev improvements
@N2D4 N2D4 enabled auto-merge (squash) July 16, 2025 17:17
@N2D4 N2D4 disabled auto-merge July 16, 2025 17:17
@N2D4 N2D4 merged commit caf7572 into dev Jul 16, 2025
17 of 19 checks passed
@N2D4 N2D4 deleted the discord_webhook_update branch July 16, 2025 17:18
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.

3 participants