Skip to content

feat(compass-generative-ai): don't require Atlas login, use the unauthenticated NLQ endpoints COMPASS-9688 #7191

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

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

lerouxb
Copy link
Contributor

@lerouxb lerouxb commented Aug 12, 2025

The PR is still making it through the dev -> qa -> staging -> prod deployment phases and at the time of writing it is only deployed to and enabled on dev and qa. So we can't merge and release this yet.

But in the meantime you can test it like:

COMPASS_ATLAS_SERVICE_UNAUTH_BASE_URL_OVERRIDE=https://cloud-dev.mongodb.com/api/private npm start

or

COMPASS_ATLAS_SERVICE_UNAUTH_BASE_URL_OVERRIDE=https://cloud-qa.mongodb.com/api/private npm start

You can find other values to test different stages here.

This is in preparation for #7150. Probably only for after #7164 ?

@Copilot Copilot AI review requested due to automatic review settings August 12, 2025 13:04
@lerouxb lerouxb requested a review from a team as a code owner August 12, 2025 13:04
@github-actions github-actions bot added the feat label Aug 12, 2025
@@ -151,13 +150,6 @@ export const featureFlags: Required<{
},
},

enableUnauthenticatedGenAI: {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can just remove this rather than set stage to released, right? Or was there some reason you can't do that? I can never remember.

Copy link
Contributor

Choose a reason for hiding this comment

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

sounds fine to me, not sure how it works generally though

Copy link
Collaborator

Choose a reason for hiding this comment

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

We generally just set these to released, yes. Makes sure that we're not breaking anything that happens to set this flag and expect it to be recognized, and that it won't conflict with a future Compass option

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed it now, but does that mean we can never remove these?

@lerouxb lerouxb force-pushed the use-unauthenticated-endpoints branch from 5f4645c to e8b4554 Compare August 12, 2025 13:07
Copy link
Contributor

@Copilot 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 removes the feature flag for unauthenticated GenAI and updates the service to use unauthenticated endpoints by default, eliminating the requirement for Atlas login when using generative AI features.

  • Removes the enableUnauthenticatedGenAI feature flag from the preferences model
  • Updates AI service endpoints to use unauthenticated paths (unauth/ai/api/v1/)
  • Simplifies the ensureAiFeatureAccess method to only handle opt-in prompts

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
packages/compass-preferences-model/src/feature-flags.ts Removes the enableUnauthenticatedGenAI feature flag definition
packages/compass-generative-ai/src/atlas-ai-service.ts Updates endpoints to unauthenticated paths and simplifies access flow
packages/compass-generative-ai/src/atlas-ai-service.spec.ts Removes test setup for the deleted feature flag

@lerouxb lerouxb marked this pull request as draft August 12, 2025 13:08
@lerouxb lerouxb force-pushed the use-unauthenticated-endpoints branch from e8b4554 to 969bca8 Compare August 12, 2025 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants