Skip to content

Conversation

@lerouxb
Copy link
Contributor

@lerouxb lerouxb commented Sep 1, 2025

Draft - still needs tests.

@github-actions github-actions bot added the feat label Sep 1, 2025
@lerouxb lerouxb added the feature flagged PRs labeled with this label will not be included in the release notes of the next release label Sep 1, 2025
@lerouxb lerouxb marked this pull request as ready for review September 3, 2025 10:59
@Copilot Copilot AI review requested due to automatic review settings September 3, 2025 10:59
@lerouxb lerouxb requested a review from a team as a code owner September 3, 2025 10:59
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements opt-in functionality for the MongoDB Compass Assistant feature to ensure users provide consent before sending their first message to the AI service. The implementation adds a new ensureOptInAndSend method that checks for AI feature access before sending messages.

  • Adds opt-in requirement before sending messages to the AI assistant
  • Refactors message sending to use the new opt-in flow
  • Updates imports to use @mongodb-js/connection-info instead of compass-connections

Reviewed Changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/compass-generative-ai/src/atlas-ai-service.ts Updates import to use connection-info package
packages/compass-generative-ai/package.json Moves connection-info from dev to production dependencies
packages/compass-assistant/src/compass-assistant-provider.tsx Implements ensureOptInAndSend method and integrates atlas AI service
packages/compass-assistant/src/compass-assistant-provider.spec.tsx Updates tests to mock AtlasAiService and test opt-in behavior
packages/compass-assistant/src/assistant-chat.tsx Replaces direct sendMessage calls with ensureOptInAndSend
packages/compass-assistant/src/assistant-chat.spec.tsx Updates tests to mock ensureOptInAndSend context
packages/compass-assistant/package.json Adds dependency on compass-generative-ai

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@gagik gagik changed the title feat(compass-assistant,) ensure opt-in before sending the first message COMPASS-9759 feat(compass-assistant): ensure opt-in before sending the first message COMPASS-9759 Sep 3, 2025
Copy link
Contributor

@gagik gagik left a comment

Choose a reason for hiding this comment

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

looks reasonable, the Copilot comment about sendMessage options should be addressed although we don't use options ourselves

@lerouxb lerouxb force-pushed the opt-in-before-message branch from 6e50395 to a6f9fdc Compare September 3, 2025 13:21
: undefined,
onDebugClick:
compassAssistant.interpretConnectionError && connectionInfo
compassAssistant.getIsAssistantEnabled() && connectionInfo
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This keeps getting the initial value. I've tried various extra things, can't figure it out and I'm just filing a ticket for now. https://jira.mongodb.org/browse/COMPASS-9803 cc @gagik @gribnoysup

I'm gonna merge for now because that's actually an existing bug that I tried to fix as a drive-by.

@lerouxb lerouxb merged commit 95fdb4e into main Sep 3, 2025
55 of 58 checks passed
@lerouxb lerouxb deleted the opt-in-before-message branch September 3, 2025 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat feature flagged PRs labeled with this label will not be included in the release notes of the next release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants