Skip to content

improvement(copilot): adds user info#868

Merged
Sg312 merged 1 commit intostagingfrom
feat/copilot-v1-personalization
Aug 5, 2025
Merged

improvement(copilot): adds user info#868
Sg312 merged 1 commit intostagingfrom
feat/copilot-v1-personalization

Conversation

@Sg312
Copy link
Contributor

@Sg312 Sg312 commented Aug 5, 2025

Summary

Adds user name to prompt

Type of Change

  • New feature

Testing

Manual testing

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Aug 5, 2025

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

Name Status Preview Comments Updated (UTC)
sim ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 5, 2025 0:32am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
docs ⬜️ Skipped (Inspect) Aug 5, 2025 0:32am

@Sg312 Sg312 changed the title improvement(copilot): adds personalization improvement(copilot): adds user info Aug 5, 2025
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.

Greptile Summary

This PR enhances the copilot chat feature by adding user personalization capabilities. The primary change involves modifying the authentication flow in apps/sim/app/api/copilot/chat/route.ts to access the user's name from the session data and include it in API requests when creating new chats.

The implementation replaces the authenticateCopilotRequestSessionOnly() helper function with direct getSession() calls. This change allows the code to access the full user session object, including the user's name, rather than just the user ID and authentication status. The user's name is then conditionally passed to the sim agent API via a userName field in the request payload, but only when creating new chats and when the user actually has a name in their session.

This change integrates well with the existing copilot API architecture by maintaining the same authentication validation while extending the data available for personalization. The conditional spread operator pattern ensures backward compatibility and prevents unnecessary API calls with empty data.

Confidence score: 4/5

  • This PR is relatively safe to merge with low risk of breaking existing functionality
  • Score reflects simple logic changes with proper conditional handling and maintained authentication
  • Pay close attention to the session handling changes in the copilot chat route file

1 file reviewed, 1 comment

Edit Code Review Bot Settings | Greptile

@Sg312 Sg312 merged commit b613010 into staging Aug 5, 2025
5 checks passed
waleedlatif1 pushed a commit that referenced this pull request Aug 5, 2025
@waleedlatif1 waleedlatif1 deleted the feat/copilot-v1-personalization branch August 6, 2025 00:22
waleedlatif1 pushed a commit that referenced this pull request Aug 6, 2025
arenadeveloper02 pushed a commit to arenadeveloper02/p2-sim that referenced this pull request Sep 19, 2025
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